diff --git a/examples/typescript/end-users/createEvmEip7702Delegation.ts b/examples/typescript/end-users/createEvmEip7702Delegation.ts new file mode 100644 index 000000000..6e48aef5a --- /dev/null +++ b/examples/typescript/end-users/createEvmEip7702Delegation.ts @@ -0,0 +1,46 @@ +// Usage: pnpm tsx end-users/createEvmEip7702Delegation.ts + +import { CdpClient } from "@coinbase/cdp-sdk"; +import "dotenv/config"; + +const userId = process.argv[2]; +if (!userId) { + console.error( + "Usage: pnpm tsx end-users/createEvmEip7702Delegation.ts " + ); + process.exit(1); +} + +const cdp = new CdpClient(); + +try { + const endUser = await cdp.endUser.getEndUser({ userId }); + + console.log("EVM address:", endUser.evmAccountObjects[0]?.address); + + // Create an EIP-7702 delegation using the client method (developer calls on behalf of end user) + const result = await cdp.endUser.createEvmEip7702Delegation({ + userId: endUser.userId, + address: endUser.evmAccountObjects[0].address, + network: "base-sepolia", + enableSpendPermissions: true, + }); + + console.log( + "Delegation operation ID (via client):", + result.delegationOperationId + ); + + // Alternatively, create directly on the EndUserAccount (auto-picks first EVM address) + const result2 = await endUser.createEvmEip7702Delegation({ + network: "base-sepolia", + enableSpendPermissions: true, + }); + + console.log( + "Delegation operation ID (via account):", + result2.delegationOperationId + ); +} catch (error) { + console.error("Error: ", (error as { errorMessage: string }).errorMessage); +} diff --git a/examples/typescript/end-users/revokeDelegation.ts b/examples/typescript/end-users/revokeDelegation.ts new file mode 100644 index 000000000..12cf5fc89 --- /dev/null +++ b/examples/typescript/end-users/revokeDelegation.ts @@ -0,0 +1,30 @@ +// Usage: pnpm tsx end-users/revokeDelegation.ts + +import { CdpClient } from "@coinbase/cdp-sdk"; +import "dotenv/config"; + +const userId = process.argv[2]; +if (!userId) { + console.error("Usage: pnpm tsx end-users/revokeDelegation.ts "); + process.exit(1); +} + +const cdp = new CdpClient(); + +try { + const endUser = await cdp.endUser.getEndUser({ userId }); + + // Revoke all active delegations for the end user using the client method + await cdp.endUser.revokeDelegationForEndUser({ + userId: endUser.userId, + }); + + console.log("Revoked delegation for end user via client method"); + + // Alternatively, revoke delegation directly on the EndUserAccount object + await endUser.revokeDelegation(); + + console.log("Revoked delegation for end user via account method"); +} catch (error) { + console.error("Error: ", (error as { errorMessage: string }).errorMessage); +} diff --git a/examples/typescript/end-users/sendEvmAsset.ts b/examples/typescript/end-users/sendEvmAsset.ts new file mode 100644 index 000000000..45148fbce --- /dev/null +++ b/examples/typescript/end-users/sendEvmAsset.ts @@ -0,0 +1,42 @@ +// Usage: pnpm tsx end-users/sendEvmAsset.ts + +import { CdpClient } from "@coinbase/cdp-sdk"; +import "dotenv/config"; + +const userId = process.argv[2]; +if (!userId) { + console.error("Usage: pnpm tsx end-users/sendEvmAsset.ts "); + process.exit(1); +} + +const cdp = new CdpClient(); + +try { + const endUser = await cdp.endUser.getEndUser({ userId }); + + console.log("EVM address:", endUser.evmAccountObjects[0]?.address); + + // Send USDC using the client method (developer calls on behalf of end user) + const result = await cdp.endUser.sendEvmAsset({ + userId: endUser.userId, + address: endUser.evmAccountObjects[0].address, + asset: "usdc", + to: "0x0000000000000000000000000000000000000001", // recipient address + amount: "1000000", // 1 USDC (6 decimals) + network: "base-sepolia", + }); + + console.log("Transaction hash (via client):", result.transactionHash); + + // Alternatively, send directly on the EndUserAccount (auto-picks first EVM address) + const result2 = await endUser.sendEvmAsset({ + asset: "usdc", + to: "0x0000000000000000000000000000000000000001", + amount: "1000000", + network: "base-sepolia", + }); + + console.log("Transaction hash (via account):", result2.transactionHash); +} catch (error) { + console.error("Error: ", (error as { errorMessage: string }).errorMessage); +} diff --git a/examples/typescript/end-users/sendEvmTransaction.ts b/examples/typescript/end-users/sendEvmTransaction.ts new file mode 100644 index 000000000..dd15ee3f0 --- /dev/null +++ b/examples/typescript/end-users/sendEvmTransaction.ts @@ -0,0 +1,38 @@ +// Usage: pnpm tsx end-users/sendEvmTransaction.ts + +import { CdpClient } from "@coinbase/cdp-sdk"; +import "dotenv/config"; + +const userId = process.argv[2]; +if (!userId) { + console.error("Usage: pnpm tsx end-users/sendEvmTransaction.ts "); + process.exit(1); +} + +const cdp = new CdpClient(); + +try { + const endUser = await cdp.endUser.getEndUser({ userId }); + + console.log("EVM address:", endUser.evmAccountObjects[0]?.address); + + // Send an EVM transaction using the client method (developer calls on behalf of end user) + const result = await cdp.endUser.sendEvmTransaction({ + userId: endUser.userId, + address: endUser.evmAccountObjects[0].address, + transaction: "0x02...", // RLP-serialized EIP-1559 transaction + network: "base-sepolia", + }); + + console.log("Transaction hash (via client):", result.transactionHash); + + // Alternatively, send directly on the EndUserAccount (auto-picks first EVM address) + const result2 = await endUser.sendEvmTransaction({ + transaction: "0x02...", + network: "base-sepolia", + }); + + console.log("Transaction hash (via account):", result2.transactionHash); +} catch (error) { + console.error("Error: ", (error as { errorMessage: string }).errorMessage); +} diff --git a/examples/typescript/end-users/sendUserOperation.ts b/examples/typescript/end-users/sendUserOperation.ts new file mode 100644 index 000000000..e63b3057d --- /dev/null +++ b/examples/typescript/end-users/sendUserOperation.ts @@ -0,0 +1,58 @@ +// Usage: pnpm tsx end-users/sendUserOperation.ts + +import { CdpClient } from "@coinbase/cdp-sdk"; +import "dotenv/config"; + +const userId = process.argv[2]; +if (!userId) { + console.error("Usage: pnpm tsx end-users/sendUserOperation.ts "); + process.exit(1); +} + +const cdp = new CdpClient(); + +try { + const endUser = await cdp.endUser.getEndUser({ userId }); + + if (!endUser.evmSmartAccountObjects?.length) { + console.error("End user has no smart account. Create one first."); + process.exit(1); + } + + console.log("Smart account address:", endUser.evmSmartAccountObjects[0]?.address); + + // Send a user operation using the client method. + // User operations can batch multiple calls in a single transaction. + const result = await cdp.endUser.sendUserOperation({ + userId: endUser.userId, + address: endUser.evmSmartAccountObjects[0].address, + network: "base-sepolia", + calls: [ + { + to: "0x0000000000000000000000000000000000000000", + value: "0", + data: "0x", + }, + ], + useCdpPaymaster: true, // CDP sponsors the gas + }); + + console.log("User operation hash (via client):", result.userOpHash); + + // Alternatively, send directly on the EndUserAccount (auto-picks first smart account) + const result2 = await endUser.sendUserOperation({ + network: "base-sepolia", + calls: [ + { + to: "0x0000000000000000000000000000000000000000", + value: "0", + data: "0x", + }, + ], + useCdpPaymaster: true, + }); + + console.log("User operation hash (via account):", result2.userOpHash); +} catch (error) { + console.error("Error: ", (error as { errorMessage: string }).errorMessage); +} diff --git a/examples/typescript/end-users/signEvmHash.ts b/examples/typescript/end-users/signEvmHash.ts new file mode 100644 index 000000000..14c3d77bf --- /dev/null +++ b/examples/typescript/end-users/signEvmHash.ts @@ -0,0 +1,36 @@ +// Usage: pnpm tsx end-users/signEvmHash.ts + +import { CdpClient } from "@coinbase/cdp-sdk"; +import "dotenv/config"; + +const userId = process.argv[2]; +if (!userId) { + console.error("Usage: pnpm tsx end-users/signEvmHash.ts "); + process.exit(1); +} + +const cdp = new CdpClient(); + +try { + const endUser = await cdp.endUser.getEndUser({ userId }); + + console.log("EVM address:", endUser.evmAccountObjects[0]?.address); + +// Sign an EVM hash using the client method (developer calls on behalf of end user) + const result = await cdp.endUser.signEvmHash({ + userId: endUser.userId, + hash: "0x0000000000000000000000000000000000000000000000000000000000000001", + address: endUser.evmAccountObjects[0].address, + }); + + console.log("Signature (via client):", result.signature); + + // Alternatively, sign directly on the EndUserAccount (auto-picks first EVM address) + const result2 = await endUser.signEvmHash({ + hash: "0x0000000000000000000000000000000000000000000000000000000000000002", + }); + + console.log("Signature (via account):", result2.signature); +} catch (error) { + console.error("Error: ", error); +} diff --git a/examples/typescript/end-users/signSolanaMessage.ts b/examples/typescript/end-users/signSolanaMessage.ts new file mode 100644 index 000000000..7f7d09805 --- /dev/null +++ b/examples/typescript/end-users/signSolanaMessage.ts @@ -0,0 +1,36 @@ +// Usage: pnpm tsx end-users/signSolanaMessage.ts + +import { CdpClient } from "@coinbase/cdp-sdk"; +import "dotenv/config"; + +const userId = process.argv[2]; +if (!userId) { + console.error("Usage: pnpm tsx end-users/signSolanaMessage.ts "); + process.exit(1); +} + +const cdp = new CdpClient(); + +try { + const endUser = await cdp.endUser.getEndUser({ userId }); + + console.log("Solana address:", endUser.solanaAccountObjects[0]?.address); + + // Sign a Solana message using the client method (developer calls on behalf of end user) + const result = await cdp.endUser.signSolanaMessage({ + userId: endUser.userId, + address: endUser.solanaAccountObjects[0].address, + message: Buffer.from("Hello, World!").toString("base64"), + }); + + console.log("Signature (via client):", result.signature); + + // Alternatively, sign directly on the EndUserAccount (auto-picks first Solana address) + const result2 = await endUser.signSolanaMessage({ + message: Buffer.from("Hello again!").toString("base64"), + }); + + console.log("Signature (via account):", result2.signature); +} catch (error) { + console.error("Error: ", (error as { errorMessage: string }).errorMessage); +} diff --git a/go/openapi/client.gen.go b/go/openapi/client.gen.go index 60c859092..cdc295e50 100644 --- a/go/openapi/client.gen.go +++ b/go/openapi/client.gen.go @@ -19,7 +19,8 @@ import ( ) const ( - ApiKeyAuthScopes = "apiKeyAuth.Scopes" + ApiKeyAuthScopes = "apiKeyAuth.Scopes" + EndUserAuthScopes = "endUserAuth.Scopes" ) // Defines values for AbiFunctionType. @@ -80,7 +81,9 @@ const ( ErrorTypeGuestTransactionCount ErrorType = "guest_transaction_count" ErrorTypeGuestTransactionLimit ErrorType = "guest_transaction_limit" ErrorTypeIdempotencyError ErrorType = "idempotency_error" + ErrorTypeInsufficientAllowance ErrorType = "insufficient_allowance" ErrorTypeInsufficientBalance ErrorType = "insufficient_balance" + ErrorTypeInsufficientLiquidity ErrorType = "insufficient_liquidity" ErrorTypeInternalServerError ErrorType = "internal_server_error" ErrorTypeInvalidRequest ErrorType = "invalid_request" ErrorTypeInvalidSignature ErrorType = "invalid_signature" @@ -119,6 +122,7 @@ const ( ErrorTypeTargetEmailInvalid ErrorType = "target_email_invalid" ErrorTypeTargetOnchainAddressInvalid ErrorType = "target_onchain_address_invalid" ErrorTypeTimedOut ErrorType = "timed_out" + ErrorTypeTransactionSimulationFailed ErrorType = "transaction_simulation_failed" ErrorTypeTransferAmountInvalid ErrorType = "transfer_amount_invalid" ErrorTypeTransferAssetNotSupported ErrorType = "transfer_asset_not_supported" ErrorTypeTravelRulesFieldMissing ErrorType = "travel_rules_field_missing" @@ -329,6 +333,7 @@ const ( // Defines values for OAuth2ProviderType. const ( Apple OAuth2ProviderType = "apple" + Github OAuth2ProviderType = "github" Google OAuth2ProviderType = "google" Telegram OAuth2ProviderType = "telegram" X OAuth2ProviderType = "x" @@ -902,6 +907,42 @@ const ( ListTokensForAccountParamsNetworkBaseSepolia ListTokensForAccountParamsNetwork = "base-sepolia" ) +// Defines values for SendEvmTransactionWithEndUserAccountJSONBodyNetwork. +const ( + SendEvmTransactionWithEndUserAccountJSONBodyNetworkArbitrum SendEvmTransactionWithEndUserAccountJSONBodyNetwork = "arbitrum" + SendEvmTransactionWithEndUserAccountJSONBodyNetworkAvalanche SendEvmTransactionWithEndUserAccountJSONBodyNetwork = "avalanche" + SendEvmTransactionWithEndUserAccountJSONBodyNetworkBase SendEvmTransactionWithEndUserAccountJSONBodyNetwork = "base" + SendEvmTransactionWithEndUserAccountJSONBodyNetworkBaseSepolia SendEvmTransactionWithEndUserAccountJSONBodyNetwork = "base-sepolia" + SendEvmTransactionWithEndUserAccountJSONBodyNetworkEthereum SendEvmTransactionWithEndUserAccountJSONBodyNetwork = "ethereum" + SendEvmTransactionWithEndUserAccountJSONBodyNetworkEthereumSepolia SendEvmTransactionWithEndUserAccountJSONBodyNetwork = "ethereum-sepolia" + SendEvmTransactionWithEndUserAccountJSONBodyNetworkOptimism SendEvmTransactionWithEndUserAccountJSONBodyNetwork = "optimism" + SendEvmTransactionWithEndUserAccountJSONBodyNetworkPolygon SendEvmTransactionWithEndUserAccountJSONBodyNetwork = "polygon" +) + +// Defines values for SendEvmAssetWithEndUserAccountJSONBodyNetwork. +const ( + SendEvmAssetWithEndUserAccountJSONBodyNetworkArbitrum SendEvmAssetWithEndUserAccountJSONBodyNetwork = "arbitrum" + SendEvmAssetWithEndUserAccountJSONBodyNetworkAvalanche SendEvmAssetWithEndUserAccountJSONBodyNetwork = "avalanche" + SendEvmAssetWithEndUserAccountJSONBodyNetworkBase SendEvmAssetWithEndUserAccountJSONBodyNetwork = "base" + SendEvmAssetWithEndUserAccountJSONBodyNetworkBaseSepolia SendEvmAssetWithEndUserAccountJSONBodyNetwork = "base-sepolia" + SendEvmAssetWithEndUserAccountJSONBodyNetworkEthereum SendEvmAssetWithEndUserAccountJSONBodyNetwork = "ethereum" + SendEvmAssetWithEndUserAccountJSONBodyNetworkEthereumSepolia SendEvmAssetWithEndUserAccountJSONBodyNetwork = "ethereum-sepolia" + SendEvmAssetWithEndUserAccountJSONBodyNetworkOptimism SendEvmAssetWithEndUserAccountJSONBodyNetwork = "optimism" + SendEvmAssetWithEndUserAccountJSONBodyNetworkPolygon SendEvmAssetWithEndUserAccountJSONBodyNetwork = "polygon" +) + +// Defines values for SendSolanaTransactionWithEndUserAccountJSONBodyNetwork. +const ( + SendSolanaTransactionWithEndUserAccountJSONBodyNetworkSolana SendSolanaTransactionWithEndUserAccountJSONBodyNetwork = "solana" + SendSolanaTransactionWithEndUserAccountJSONBodyNetworkSolanaDevnet SendSolanaTransactionWithEndUserAccountJSONBodyNetwork = "solana-devnet" +) + +// Defines values for SendSolanaAssetWithEndUserAccountJSONBodyNetwork. +const ( + SendSolanaAssetWithEndUserAccountJSONBodyNetworkSolana SendSolanaAssetWithEndUserAccountJSONBodyNetwork = "solana" + SendSolanaAssetWithEndUserAccountJSONBodyNetworkSolanaDevnet SendSolanaAssetWithEndUserAccountJSONBodyNetwork = "solana-devnet" +) + // Defines values for ListEndUsersParamsSort. const ( CreatedAtAsc ListEndUsersParamsSort = "createdAt=asc" @@ -961,8 +1002,9 @@ const ( // Defines values for RequestSolanaFaucetJSONBodyToken. const ( - RequestSolanaFaucetJSONBodyTokenSol RequestSolanaFaucetJSONBodyToken = "sol" - RequestSolanaFaucetJSONBodyTokenUsdc RequestSolanaFaucetJSONBodyToken = "usdc" + RequestSolanaFaucetJSONBodyTokenCbtusd RequestSolanaFaucetJSONBodyToken = "cbtusd" + RequestSolanaFaucetJSONBodyTokenSol RequestSolanaFaucetJSONBodyToken = "sol" + RequestSolanaFaucetJSONBodyTokenUsdc RequestSolanaFaucetJSONBodyToken = "usdc" ) // Abi Contract ABI Specification following Solidity's external JSON interface format. @@ -1045,6 +1087,9 @@ type AccountTokenAddressesResponse struct { TotalCount *int `json:"totalCount,omitempty"` } +// Asset The symbol of the asset (e.g., eth, usd, usdc, usdt). +type Asset = string + // AuthenticationMethod Information about how the end user is authenticated. type AuthenticationMethod struct { union json.RawMessage @@ -2197,6 +2242,12 @@ type RevokeSpendPermissionRequest struct { // PermissionHash The hash of the spend permission to revoke. PermissionHash string `json:"permissionHash"` + + // UseCdpPaymaster Whether to use the CDP Paymaster for the user operation. + UseCdpPaymaster bool `json:"useCdpPaymaster"` + + // WalletSecretId The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header. + WalletSecretId string `json:"walletSecretId"` } // Rule A rule that limits the behavior of an account. @@ -3142,6 +3193,9 @@ type WebhookSubscriptionResponse struct { // Target Target configuration for webhook delivery. // Specifies the destination URL and any custom headers to include in webhook requests. Target WebhookTarget `json:"target"` + + // UpdatedAt When the subscription was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` } // WebhookSubscriptionResponse_Metadata defines model for WebhookSubscriptionResponse.Metadata. @@ -3193,6 +3247,18 @@ type WebhookTarget struct { // X402Version The version of the x402 protocol. type X402Version int +// EvmSpendPermissionsRevokeSpendPermissionRequest Request parameters for revoking a Spend Permission. +type EvmSpendPermissionsRevokeSpendPermissionRequest struct { + // Network The network the spend permission is on. + Network SpendPermissionNetwork `json:"network"` + + // PaymasterUrl The paymaster URL of the spend permission. + PaymasterUrl *Url `json:"paymasterUrl,omitempty"` + + // PermissionHash The hash of the spend permission to revoke. + PermissionHash string `json:"permissionHash"` +} + // FromAmount The amount of the `fromToken` to send in atomic units of the token. For example, `1000000000000000000` when sending ETH equates to 1 ETH, `1000000` when sending USDC equates to 1 USDC, etc. type FromAmount = string @@ -3528,9 +3594,15 @@ type PageSize = int // PageToken defines model for PageToken. type PageToken = string +// XDeveloperAuth defines model for XDeveloperAuth. +type XDeveloperAuth = string + // XWalletAuth defines model for XWalletAuth. type XWalletAuth = string +// XWalletAuthOptional defines model for XWalletAuthOptional. +type XWalletAuthOptional = string + // AlreadyExistsError An error response including the code for the type of error and a human-readable message describing the error. type AlreadyExistsError = Error @@ -3649,53 +3721,23 @@ type ListWebhookSubscriptionsParams struct { PageToken *string `form:"pageToken,omitempty" json:"pageToken,omitempty"` } -// ListEndUsersParams defines parameters for ListEndUsers. -type ListEndUsersParams struct { - // PageSize The number of end users to return per page. - PageSize *int `form:"pageSize,omitempty" json:"pageSize,omitempty"` - - // PageToken The token for the desired page of end users. Will be empty if there are no more end users to fetch. - PageToken *string `form:"pageToken,omitempty" json:"pageToken,omitempty"` - - // Sort Sort end users. Defaults to ascending order (oldest first). - Sort *[]ListEndUsersParamsSort `form:"sort,omitempty" json:"sort,omitempty"` -} - -// ListEndUsersParamsSort defines parameters for ListEndUsers. -type ListEndUsersParamsSort string - -// CreateEndUserJSONBody defines parameters for CreateEndUser. -type CreateEndUserJSONBody struct { - // AuthenticationMethods The list of valid authentication methods linked to the end user. - AuthenticationMethods AuthenticationMethods `json:"authenticationMethods"` - - // EvmAccount Configuration for creating an EVM account for the end user. - EvmAccount *struct { - // CreateSmartAccount If true, creates an EVM smart account and a default EVM EOA account as the owner. If false, only a EVM EOA account is created. - CreateSmartAccount *bool `json:"createSmartAccount,omitempty"` - - // EnableSpendPermissions If true, enables spend permissions for the EVM smart account. - EnableSpendPermissions *bool `json:"enableSpendPermissions,omitempty"` - } `json:"evmAccount,omitempty"` - - // SolanaAccount Configuration for creating a Solana account for the end user. - SolanaAccount *struct { - // CreateSmartAccount Only false is a valid option since currently smart accounts on Solana are not supported. - CreateSmartAccount *bool `json:"createSmartAccount,omitempty"` - } `json:"solanaAccount,omitempty"` - - // UserId A stable, unique identifier for the end user. The `userId` must be unique across all end users in the developer's CDP Project. It must be between 1 and 100 characters long and can only contain alphanumeric characters and hyphens. - // - // If `userId` is not provided in the request, the server will generate a random UUID. - UserId *string `json:"userId,omitempty"` +// RevokeDelegationForEndUserJSONBody defines parameters for RevokeDelegationForEndUser. +type RevokeDelegationForEndUserJSONBody struct { + // WalletSecretId When revoking with a wallet authentication scheme, the ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header. + WalletSecretId *string `json:"walletSecretId,omitempty"` } -// CreateEndUserParams defines parameters for CreateEndUser. -type CreateEndUserParams struct { +// RevokeDelegationForEndUserParams defines parameters for RevokeDelegationForEndUser. +type RevokeDelegationForEndUserParams struct { // XWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the // [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) // section of our Authentication docs for more details on how to generate your Wallet Token. - XWalletAuth *XWalletAuth `json:"X-Wallet-Auth,omitempty"` + XWalletAuth *XWalletAuthOptional `json:"X-Wallet-Auth,omitempty"` + + // XDeveloperAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the + // [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) + // section of our Authentication docs for more details on how to generate your Wallet Token. + XDeveloperAuth *XDeveloperAuth `json:"X-Developer-Auth,omitempty"` // XIdempotencyKey An optional string request header for making requests safely retryable. // When included, duplicate requests with the same key will return identical responses. @@ -3703,29 +3745,23 @@ type CreateEndUserParams struct { XIdempotencyKey *IdempotencyKey `json:"X-Idempotency-Key,omitempty"` } -// ValidateEndUserAccessTokenJSONBody defines parameters for ValidateEndUserAccessToken. -type ValidateEndUserAccessTokenJSONBody struct { - // AccessToken The access token in JWT format to verify. - AccessToken string `json:"accessToken"` -} - -// ImportEndUserJSONBody defines parameters for ImportEndUser. -type ImportEndUserJSONBody struct { - // AuthenticationMethods The list of valid authentication methods linked to the end user. - AuthenticationMethods AuthenticationMethods `json:"authenticationMethods"` +// CreateEvmEip7702DelegationWithEndUserAccountJSONBody defines parameters for CreateEvmEip7702DelegationWithEndUserAccount. +type CreateEvmEip7702DelegationWithEndUserAccountJSONBody struct { + // Address The 0x-prefixed address of the EVM account to delegate. + Address string `json:"address"` - // EncryptedPrivateKey The base64-encoded, encrypted private key to import. The private key must be encrypted using the CDP SDK's encryption scheme. This is a 32-byte raw private key. - EncryptedPrivateKey string `json:"encryptedPrivateKey"` + // EnableSpendPermissions Whether to configure spend permissions for the upgraded, delegated account. When enabled, the account can grant permissions for third parties to spend on its behalf. + EnableSpendPermissions *bool `json:"enableSpendPermissions,omitempty"` - // KeyType The type of key being imported. Determines what type of account will be associated for the end user. - KeyType ImportEndUserJSONBodyKeyType `json:"keyType"` + // Network The network for the EIP-7702 delegation. + Network EvmEip7702DelegationNetwork `json:"network"` - // UserId A stable, unique identifier for the end user. The `userId` must be unique across all end users in the developer's CDP Project. It must be between 1 and 100 characters long and can only contain alphanumeric characters and hyphens. - UserId string `json:"userId"` + // WalletSecretId Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header. + WalletSecretId *string `json:"walletSecretId,omitempty"` } -// ImportEndUserParams defines parameters for ImportEndUser. -type ImportEndUserParams struct { +// CreateEvmEip7702DelegationWithEndUserAccountParams defines parameters for CreateEvmEip7702DelegationWithEndUserAccount. +type CreateEvmEip7702DelegationWithEndUserAccountParams struct { // XWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the // [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) // section of our Authentication docs for more details on how to generate your Wallet Token. @@ -3735,16 +3771,30 @@ type ImportEndUserParams struct { // When included, duplicate requests with the same key will return identical responses. // Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. XIdempotencyKey *IdempotencyKey `json:"X-Idempotency-Key,omitempty"` + + // XDeveloperAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the + // [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) + // section of our Authentication docs for more details on how to generate your Wallet Token. + XDeveloperAuth *XDeveloperAuth `json:"X-Developer-Auth,omitempty"` } -// ImportEndUserJSONBodyKeyType defines parameters for ImportEndUser. -type ImportEndUserJSONBodyKeyType string +// SendEvmTransactionWithEndUserAccountJSONBody defines parameters for SendEvmTransactionWithEndUserAccount. +type SendEvmTransactionWithEndUserAccountJSONBody struct { + // Address The 0x-prefixed address of the EVM account belonging to the end user. + Address string `json:"address"` -// AddEndUserEvmAccountJSONBody defines parameters for AddEndUserEvmAccount. -type AddEndUserEvmAccountJSONBody = map[string]interface{} + // Network The network to send the transaction to. + Network SendEvmTransactionWithEndUserAccountJSONBodyNetwork `json:"network"` -// AddEndUserEvmAccountParams defines parameters for AddEndUserEvmAccount. -type AddEndUserEvmAccountParams struct { + // Transaction The RLP-encoded transaction to sign and send, as a 0x-prefixed hex string. + Transaction string `json:"transaction"` + + // WalletSecretId Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header. + WalletSecretId *string `json:"walletSecretId,omitempty"` +} + +// SendEvmTransactionWithEndUserAccountParams defines parameters for SendEvmTransactionWithEndUserAccount. +type SendEvmTransactionWithEndUserAccountParams struct { // XWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the // [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) // section of our Authentication docs for more details on how to generate your Wallet Token. @@ -3754,16 +3804,30 @@ type AddEndUserEvmAccountParams struct { // When included, duplicate requests with the same key will return identical responses. // Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. XIdempotencyKey *IdempotencyKey `json:"X-Idempotency-Key,omitempty"` + + // XDeveloperAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the + // [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) + // section of our Authentication docs for more details on how to generate your Wallet Token. + XDeveloperAuth *XDeveloperAuth `json:"X-Developer-Auth,omitempty"` } -// AddEndUserEvmSmartAccountJSONBody defines parameters for AddEndUserEvmSmartAccount. -type AddEndUserEvmSmartAccountJSONBody struct { - // EnableSpendPermissions If true, enables spend permissions for the EVM smart account. - EnableSpendPermissions *bool `json:"enableSpendPermissions,omitempty"` +// SendEvmTransactionWithEndUserAccountJSONBodyNetwork defines parameters for SendEvmTransactionWithEndUserAccount. +type SendEvmTransactionWithEndUserAccountJSONBodyNetwork string + +// SignEvmHashWithEndUserAccountJSONBody defines parameters for SignEvmHashWithEndUserAccount. +type SignEvmHashWithEndUserAccountJSONBody struct { + // Address The 0x-prefixed address of the EVM account belonging to the end user. + Address string `json:"address"` + + // Hash The arbitrary 32 byte hash to sign. + Hash string `json:"hash"` + + // WalletSecretId Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header. + WalletSecretId *string `json:"walletSecretId,omitempty"` } -// AddEndUserEvmSmartAccountParams defines parameters for AddEndUserEvmSmartAccount. -type AddEndUserEvmSmartAccountParams struct { +// SignEvmHashWithEndUserAccountParams defines parameters for SignEvmHashWithEndUserAccount. +type SignEvmHashWithEndUserAccountParams struct { // XWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the // [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) // section of our Authentication docs for more details on how to generate your Wallet Token. @@ -3773,46 +3837,27 @@ type AddEndUserEvmSmartAccountParams struct { // When included, duplicate requests with the same key will return identical responses. // Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. XIdempotencyKey *IdempotencyKey `json:"X-Idempotency-Key,omitempty"` -} - -// AddEndUserSolanaAccountJSONBody defines parameters for AddEndUserSolanaAccount. -type AddEndUserSolanaAccountJSONBody = map[string]interface{} -// AddEndUserSolanaAccountParams defines parameters for AddEndUserSolanaAccount. -type AddEndUserSolanaAccountParams struct { - // XWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the + // XDeveloperAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the // [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) // section of our Authentication docs for more details on how to generate your Wallet Token. - XWalletAuth *XWalletAuth `json:"X-Wallet-Auth,omitempty"` - - // XIdempotencyKey An optional string request header for making requests safely retryable. - // When included, duplicate requests with the same key will return identical responses. - // Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. - XIdempotencyKey *IdempotencyKey `json:"X-Idempotency-Key,omitempty"` + XDeveloperAuth *XDeveloperAuth `json:"X-Developer-Auth,omitempty"` } -// ListEvmAccountsParams defines parameters for ListEvmAccounts. -type ListEvmAccountsParams struct { - // PageSize The number of resources to return per page. - PageSize *PageSize `form:"pageSize,omitempty" json:"pageSize,omitempty"` - - // PageToken The token for the next page of resources, if any. - PageToken *PageToken `form:"pageToken,omitempty" json:"pageToken,omitempty"` -} +// SignEvmMessageWithEndUserAccountJSONBody defines parameters for SignEvmMessageWithEndUserAccount. +type SignEvmMessageWithEndUserAccountJSONBody struct { + // Address The 0x-prefixed address of the EVM account belonging to the end user. + Address string `json:"address"` -// CreateEvmAccountJSONBody defines parameters for CreateEvmAccount. -type CreateEvmAccountJSONBody struct { - // AccountPolicy The ID of the account-level policy to apply to the account. - AccountPolicy *string `json:"accountPolicy,omitempty"` + // Message The message to sign. + Message string `json:"message"` - // Name An optional name for the account. - // Account names can consist of alphanumeric characters and hyphens, and be between 2 and 36 characters long. - // Account names must be unique across all EVM accounts in the developer's CDP Project. - Name *string `json:"name,omitempty"` + // WalletSecretId Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header. + WalletSecretId *string `json:"walletSecretId,omitempty"` } -// CreateEvmAccountParams defines parameters for CreateEvmAccount. -type CreateEvmAccountParams struct { +// SignEvmMessageWithEndUserAccountParams defines parameters for SignEvmMessageWithEndUserAccount. +type SignEvmMessageWithEndUserAccountParams struct { // XWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the // [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) // section of our Authentication docs for more details on how to generate your Wallet Token. @@ -3822,16 +3867,27 @@ type CreateEvmAccountParams struct { // When included, duplicate requests with the same key will return identical responses. // Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. XIdempotencyKey *IdempotencyKey `json:"X-Idempotency-Key,omitempty"` + + // XDeveloperAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the + // [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) + // section of our Authentication docs for more details on how to generate your Wallet Token. + XDeveloperAuth *XDeveloperAuth `json:"X-Developer-Auth,omitempty"` } -// ExportEvmAccountByNameJSONBody defines parameters for ExportEvmAccountByName. -type ExportEvmAccountByNameJSONBody struct { - // ExportEncryptionKey The base64-encoded, public part of the RSA key in DER format used to encrypt the account private key. - ExportEncryptionKey string `json:"exportEncryptionKey"` +// SignEvmTransactionWithEndUserAccountJSONBody defines parameters for SignEvmTransactionWithEndUserAccount. +type SignEvmTransactionWithEndUserAccountJSONBody struct { + // Address The 0x-prefixed address of the EVM account belonging to the end user. + Address string `json:"address"` + + // Transaction The RLP-encoded transaction to sign, as a 0x-prefixed hex string. + Transaction string `json:"transaction"` + + // WalletSecretId Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header. + WalletSecretId *string `json:"walletSecretId,omitempty"` } -// ExportEvmAccountByNameParams defines parameters for ExportEvmAccountByName. -type ExportEvmAccountByNameParams struct { +// SignEvmTransactionWithEndUserAccountParams defines parameters for SignEvmTransactionWithEndUserAccount. +type SignEvmTransactionWithEndUserAccountParams struct { // XWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the // [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) // section of our Authentication docs for more details on how to generate your Wallet Token. @@ -3841,24 +3897,27 @@ type ExportEvmAccountByNameParams struct { // When included, duplicate requests with the same key will return identical responses. // Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. XIdempotencyKey *IdempotencyKey `json:"X-Idempotency-Key,omitempty"` + + // XDeveloperAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the + // [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) + // section of our Authentication docs for more details on how to generate your Wallet Token. + XDeveloperAuth *XDeveloperAuth `json:"X-Developer-Auth,omitempty"` } -// ImportEvmAccountJSONBody defines parameters for ImportEvmAccount. -type ImportEvmAccountJSONBody struct { - // AccountPolicy The ID of the account-level policy to apply to the account. - AccountPolicy *string `json:"accountPolicy,omitempty"` +// SignEvmTypedDataWithEndUserAccountJSONBody defines parameters for SignEvmTypedDataWithEndUserAccount. +type SignEvmTypedDataWithEndUserAccountJSONBody struct { + // Address The 0x-prefixed address of the EVM account belonging to the end user. + Address string `json:"address"` - // EncryptedPrivateKey The base64-encoded, encrypted private key of the EVM account. The private key must be encrypted using the CDP SDK's encryption scheme. - EncryptedPrivateKey string `json:"encryptedPrivateKey"` + // TypedData The message to sign using EIP-712. + TypedData EIP712Message `json:"typedData"` - // Name An optional name for the account. - // Account names can consist of alphanumeric characters and hyphens, and be between 2 and 36 characters long. - // Account names must be unique across all EVM accounts in the developer's CDP Project. - Name *string `json:"name,omitempty"` + // WalletSecretId Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header. + WalletSecretId *string `json:"walletSecretId,omitempty"` } -// ImportEvmAccountParams defines parameters for ImportEvmAccount. -type ImportEvmAccountParams struct { +// SignEvmTypedDataWithEndUserAccountParams defines parameters for SignEvmTypedDataWithEndUserAccount. +type SignEvmTypedDataWithEndUserAccountParams struct { // XWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the // [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) // section of our Authentication docs for more details on how to generate your Wallet Token. @@ -3868,57 +3927,54 @@ type ImportEvmAccountParams struct { // When included, duplicate requests with the same key will return identical responses. // Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. XIdempotencyKey *IdempotencyKey `json:"X-Idempotency-Key,omitempty"` + + // XDeveloperAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the + // [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) + // section of our Authentication docs for more details on how to generate your Wallet Token. + XDeveloperAuth *XDeveloperAuth `json:"X-Developer-Auth,omitempty"` } -// UpdateEvmAccountJSONBody defines parameters for UpdateEvmAccount. -type UpdateEvmAccountJSONBody struct { - // AccountPolicy The ID of the account-level policy to apply to the account, or an empty string to unset attached policy. - AccountPolicy *string `json:"accountPolicy,omitempty"` +// SendUserOperationWithEndUserAccountJSONBody defines parameters for SendUserOperationWithEndUserAccount. +type SendUserOperationWithEndUserAccountJSONBody struct { + // Calls The list of calls to make from the Smart Account. + Calls []EvmCall `json:"calls"` - // Name An optional name for the account. - // Account names can consist of alphanumeric characters and hyphens, and be between 2 and 36 characters long. - // Account names must be unique across all EVM accounts in the developer's CDP Project. - Name *string `json:"name,omitempty"` + // DataSuffix The EIP-8021 data suffix (hex-encoded) that enables transaction attribution for the user operation. + DataSuffix *string `json:"dataSuffix,omitempty"` + + // Network The network the user operation is for. + Network EvmUserOperationNetwork `json:"network"` + + // PaymasterUrl The URL of the paymaster to use for the user operation. If using the CDP Paymaster, use the `useCdpPaymaster` option. + PaymasterUrl *Url `json:"paymasterUrl,omitempty"` + + // UseCdpPaymaster Whether to use the CDP Paymaster for the user operation. + UseCdpPaymaster bool `json:"useCdpPaymaster"` + + // WalletSecretId Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header. + WalletSecretId *string `json:"walletSecretId,omitempty"` } -// UpdateEvmAccountParams defines parameters for UpdateEvmAccount. -type UpdateEvmAccountParams struct { +// SendUserOperationWithEndUserAccountParams defines parameters for SendUserOperationWithEndUserAccount. +type SendUserOperationWithEndUserAccountParams struct { // XIdempotencyKey An optional string request header for making requests safely retryable. // When included, duplicate requests with the same key will return identical responses. // Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. XIdempotencyKey *IdempotencyKey `json:"X-Idempotency-Key,omitempty"` -} - -// CreateEvmEip7702DelegationJSONBody defines parameters for CreateEvmEip7702Delegation. -type CreateEvmEip7702DelegationJSONBody struct { - // EnableSpendPermissions Whether to configure spend permissions for the upgraded, delegated account. When enabled, the account can grant permissions for third parties to spend on its behalf. - EnableSpendPermissions *bool `json:"enableSpendPermissions,omitempty"` - - // Network The network for the EIP-7702 delegation. - Network EvmEip7702DelegationNetwork `json:"network"` -} -// CreateEvmEip7702DelegationParams defines parameters for CreateEvmEip7702Delegation. -type CreateEvmEip7702DelegationParams struct { // XWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the // [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) // section of our Authentication docs for more details on how to generate your Wallet Token. XWalletAuth *XWalletAuth `json:"X-Wallet-Auth,omitempty"` - // XIdempotencyKey An optional string request header for making requests safely retryable. - // When included, duplicate requests with the same key will return identical responses. - // Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. - XIdempotencyKey *IdempotencyKey `json:"X-Idempotency-Key,omitempty"` -} - -// ExportEvmAccountJSONBody defines parameters for ExportEvmAccount. -type ExportEvmAccountJSONBody struct { - // ExportEncryptionKey The base64-encoded, public part of the RSA key in DER format used to encrypt the account private key. - ExportEncryptionKey string `json:"exportEncryptionKey"` + // XDeveloperAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the + // [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) + // section of our Authentication docs for more details on how to generate your Wallet Token. + XDeveloperAuth *XDeveloperAuth `json:"X-Developer-Auth,omitempty"` } -// ExportEvmAccountParams defines parameters for ExportEvmAccount. -type ExportEvmAccountParams struct { +// RevokeSpendPermissionWithEndUserAccountParams defines parameters for RevokeSpendPermissionWithEndUserAccount. +type RevokeSpendPermissionWithEndUserAccountParams struct { // XWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the // [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) // section of our Authentication docs for more details on how to generate your Wallet Token. @@ -3930,17 +3986,29 @@ type ExportEvmAccountParams struct { XIdempotencyKey *IdempotencyKey `json:"X-Idempotency-Key,omitempty"` } -// SendEvmTransactionJSONBody defines parameters for SendEvmTransaction. -type SendEvmTransactionJSONBody struct { - // Network The network to send the transaction to. - Network SendEvmTransactionJSONBodyNetwork `json:"network"` +// SendEvmAssetWithEndUserAccountJSONBody defines parameters for SendEvmAssetWithEndUserAccount. +type SendEvmAssetWithEndUserAccountJSONBody struct { + // Amount The amount of USDC to send as a decimal string (e.g., "1.5" or "25.50"). + Amount string `json:"amount"` - // Transaction The RLP-encoded transaction to sign and send, as a 0x-prefixed hex string. - Transaction string `json:"transaction"` + // Network The EVM network to send USDC on. + Network SendEvmAssetWithEndUserAccountJSONBodyNetwork `json:"network"` + + // PaymasterUrl Optional custom Paymaster URL to use for gas sponsorship. Only applicable for EVM Smart Accounts. This allows you to use your own Paymaster service instead of CDP's Paymaster. Cannot be used together with `useCdpPaymaster`. + PaymasterUrl *Url `json:"paymasterUrl,omitempty"` + + // To The 0x-prefixed address of the recipient. + To BlockchainAddress `json:"to"` + + // UseCdpPaymaster Whether to use CDP Paymaster to sponsor gas fees. Only applicable for EVM Smart Accounts. When true, the transaction gas will be paid by the Paymaster, allowing users to send USDC without holding native gas tokens. Ignored for EOA accounts. Cannot be used together with `paymasterUrl`. + UseCdpPaymaster *bool `json:"useCdpPaymaster,omitempty"` + + // WalletSecretId Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header. + WalletSecretId *string `json:"walletSecretId,omitempty"` } -// SendEvmTransactionParams defines parameters for SendEvmTransaction. -type SendEvmTransactionParams struct { +// SendEvmAssetWithEndUserAccountParams defines parameters for SendEvmAssetWithEndUserAccount. +type SendEvmAssetWithEndUserAccountParams struct { // XWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the // [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) // section of our Authentication docs for more details on how to generate your Wallet Token. @@ -3950,19 +4018,69 @@ type SendEvmTransactionParams struct { // When included, duplicate requests with the same key will return identical responses. // Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. XIdempotencyKey *IdempotencyKey `json:"X-Idempotency-Key,omitempty"` + + // XDeveloperAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the + // [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) + // section of our Authentication docs for more details on how to generate your Wallet Token. + XDeveloperAuth *XDeveloperAuth `json:"X-Developer-Auth,omitempty"` } -// SendEvmTransactionJSONBodyNetwork defines parameters for SendEvmTransaction. -type SendEvmTransactionJSONBodyNetwork string +// SendEvmAssetWithEndUserAccountJSONBodyNetwork defines parameters for SendEvmAssetWithEndUserAccount. +type SendEvmAssetWithEndUserAccountJSONBodyNetwork string -// SignEvmHashJSONBody defines parameters for SignEvmHash. -type SignEvmHashJSONBody struct { - // Hash The arbitrary 32 byte hash to sign. +// SendSolanaTransactionWithEndUserAccountJSONBody defines parameters for SendSolanaTransactionWithEndUserAccount. +type SendSolanaTransactionWithEndUserAccountJSONBody struct { + // Address The base58 encoded address of the Solana account belonging to the end user. + Address string `json:"address"` + + // Network The Solana network to send the transaction to. + Network SendSolanaTransactionWithEndUserAccountJSONBodyNetwork `json:"network"` + + // Transaction The base64 encoded transaction to sign and send. This transaction can contain multiple instructions for native Solana batching. + Transaction string `json:"transaction"` + + // UseCdpSponsor Whether transaction fees should be sponsored by CDP. When true, CDP sponsors the transaction fees on behalf of the end user. When false, the end user is responsible for paying the transaction fees. + UseCdpSponsor *bool `json:"useCdpSponsor,omitempty"` + + // WalletSecretId Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header. + WalletSecretId *string `json:"walletSecretId,omitempty"` +} + +// SendSolanaTransactionWithEndUserAccountParams defines parameters for SendSolanaTransactionWithEndUserAccount. +type SendSolanaTransactionWithEndUserAccountParams struct { + // XWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the + // [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) + // section of our Authentication docs for more details on how to generate your Wallet Token. + XWalletAuth *XWalletAuth `json:"X-Wallet-Auth,omitempty"` + + // XIdempotencyKey An optional string request header for making requests safely retryable. + // When included, duplicate requests with the same key will return identical responses. + // Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. + XIdempotencyKey *IdempotencyKey `json:"X-Idempotency-Key,omitempty"` + + // XDeveloperAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the + // [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) + // section of our Authentication docs for more details on how to generate your Wallet Token. + XDeveloperAuth *XDeveloperAuth `json:"X-Developer-Auth,omitempty"` +} + +// SendSolanaTransactionWithEndUserAccountJSONBodyNetwork defines parameters for SendSolanaTransactionWithEndUserAccount. +type SendSolanaTransactionWithEndUserAccountJSONBodyNetwork string + +// SignSolanaHashWithEndUserAccountJSONBody defines parameters for SignSolanaHashWithEndUserAccount. +type SignSolanaHashWithEndUserAccountJSONBody struct { + // Address The base58 encoded address of the Solana account belonging to the end user. + Address string `json:"address"` + + // Hash The arbitrary 32 byte hash to sign as base58 encoded string. Hash string `json:"hash"` + + // WalletSecretId Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header. + WalletSecretId *string `json:"walletSecretId,omitempty"` } -// SignEvmHashParams defines parameters for SignEvmHash. -type SignEvmHashParams struct { +// SignSolanaHashWithEndUserAccountParams defines parameters for SignSolanaHashWithEndUserAccount. +type SignSolanaHashWithEndUserAccountParams struct { // XWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the // [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) // section of our Authentication docs for more details on how to generate your Wallet Token. @@ -3972,16 +4090,27 @@ type SignEvmHashParams struct { // When included, duplicate requests with the same key will return identical responses. // Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. XIdempotencyKey *IdempotencyKey `json:"X-Idempotency-Key,omitempty"` + + // XDeveloperAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the + // [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) + // section of our Authentication docs for more details on how to generate your Wallet Token. + XDeveloperAuth *XDeveloperAuth `json:"X-Developer-Auth,omitempty"` } -// SignEvmMessageJSONBody defines parameters for SignEvmMessage. -type SignEvmMessageJSONBody struct { - // Message The message to sign. +// SignSolanaMessageWithEndUserAccountJSONBody defines parameters for SignSolanaMessageWithEndUserAccount. +type SignSolanaMessageWithEndUserAccountJSONBody struct { + // Address The base58 encoded address of the Solana account belonging to the end user. + Address string `json:"address"` + + // Message The base64 encoded arbitrary message to sign. Message string `json:"message"` + + // WalletSecretId Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header. + WalletSecretId *string `json:"walletSecretId,omitempty"` } -// SignEvmMessageParams defines parameters for SignEvmMessage. -type SignEvmMessageParams struct { +// SignSolanaMessageWithEndUserAccountParams defines parameters for SignSolanaMessageWithEndUserAccount. +type SignSolanaMessageWithEndUserAccountParams struct { // XWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the // [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) // section of our Authentication docs for more details on how to generate your Wallet Token. @@ -3991,16 +4120,27 @@ type SignEvmMessageParams struct { // When included, duplicate requests with the same key will return identical responses. // Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. XIdempotencyKey *IdempotencyKey `json:"X-Idempotency-Key,omitempty"` + + // XDeveloperAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the + // [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) + // section of our Authentication docs for more details on how to generate your Wallet Token. + XDeveloperAuth *XDeveloperAuth `json:"X-Developer-Auth,omitempty"` } -// SignEvmTransactionJSONBody defines parameters for SignEvmTransaction. -type SignEvmTransactionJSONBody struct { - // Transaction The RLP-encoded transaction to sign, as a 0x-prefixed hex string. +// SignSolanaTransactionWithEndUserAccountJSONBody defines parameters for SignSolanaTransactionWithEndUserAccount. +type SignSolanaTransactionWithEndUserAccountJSONBody struct { + // Address The base58 encoded address of the Solana account belonging to the end user. + Address string `json:"address"` + + // Transaction The base64 encoded transaction to sign. Transaction string `json:"transaction"` + + // WalletSecretId Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header. + WalletSecretId *string `json:"walletSecretId,omitempty"` } -// SignEvmTransactionParams defines parameters for SignEvmTransaction. -type SignEvmTransactionParams struct { +// SignSolanaTransactionWithEndUserAccountParams defines parameters for SignSolanaTransactionWithEndUserAccount. +type SignSolanaTransactionWithEndUserAccountParams struct { // XWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the // [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) // section of our Authentication docs for more details on how to generate your Wallet Token. @@ -4010,10 +4150,36 @@ type SignEvmTransactionParams struct { // When included, duplicate requests with the same key will return identical responses. // Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. XIdempotencyKey *IdempotencyKey `json:"X-Idempotency-Key,omitempty"` + + // XDeveloperAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the + // [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) + // section of our Authentication docs for more details on how to generate your Wallet Token. + XDeveloperAuth *XDeveloperAuth `json:"X-Developer-Auth,omitempty"` } -// SignEvmTypedDataParams defines parameters for SignEvmTypedData. -type SignEvmTypedDataParams struct { +// SendSolanaAssetWithEndUserAccountJSONBody defines parameters for SendSolanaAssetWithEndUserAccount. +type SendSolanaAssetWithEndUserAccountJSONBody struct { + // Amount The amount of USDC to send as a decimal string (e.g., "1.5" or "25.50"). + Amount string `json:"amount"` + + // CreateRecipientAta Whether to automatically create an Associated Token Account (ATA) for the recipient if it doesn't exist. When true, the sender pays the rent-exempt minimum to create the recipient's USDC ATA. When false, the transaction will fail if the recipient doesn't have a USDC ATA. + CreateRecipientAta *bool `json:"createRecipientAta,omitempty"` + + // Network The Solana network to send USDC on. + Network SendSolanaAssetWithEndUserAccountJSONBodyNetwork `json:"network"` + + // To The base58 encoded address of the recipient. + To BlockchainAddress `json:"to"` + + // UseCdpSponsor Whether transaction fees should be sponsored by CDP. When true, CDP sponsors the transaction fees on behalf of the end user. When false, the end user is responsible for paying the transaction fees. + UseCdpSponsor *bool `json:"useCdpSponsor,omitempty"` + + // WalletSecretId Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header. + WalletSecretId *string `json:"walletSecretId,omitempty"` +} + +// SendSolanaAssetWithEndUserAccountParams defines parameters for SendSolanaAssetWithEndUserAccount. +type SendSolanaAssetWithEndUserAccountParams struct { // XWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the // [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) // section of our Authentication docs for more details on how to generate your Wallet Token. @@ -4023,64 +4189,93 @@ type SignEvmTypedDataParams struct { // When included, duplicate requests with the same key will return identical responses. // Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. XIdempotencyKey *IdempotencyKey `json:"X-Idempotency-Key,omitempty"` + + // XDeveloperAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the + // [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) + // section of our Authentication docs for more details on how to generate your Wallet Token. + XDeveloperAuth *XDeveloperAuth `json:"X-Developer-Auth,omitempty"` } -// RequestEvmFaucetJSONBody defines parameters for RequestEvmFaucet. -type RequestEvmFaucetJSONBody struct { - // Address The address to request funds to, which is a 0x-prefixed hexadecimal string. - Address string `json:"address"` +// SendSolanaAssetWithEndUserAccountJSONBodyNetwork defines parameters for SendSolanaAssetWithEndUserAccount. +type SendSolanaAssetWithEndUserAccountJSONBodyNetwork string - // Network The network to request funds from. - Network RequestEvmFaucetJSONBodyNetwork `json:"network"` +// ListEndUsersParams defines parameters for ListEndUsers. +type ListEndUsersParams struct { + // PageSize The number of end users to return per page. + PageSize *int `form:"pageSize,omitempty" json:"pageSize,omitempty"` - // Token The token to request funds for. - Token RequestEvmFaucetJSONBodyToken `json:"token"` + // PageToken The token for the desired page of end users. Will be empty if there are no more end users to fetch. + PageToken *string `form:"pageToken,omitempty" json:"pageToken,omitempty"` + + // Sort Sort end users. Defaults to ascending order (oldest first). + Sort *[]ListEndUsersParamsSort `form:"sort,omitempty" json:"sort,omitempty"` } -// RequestEvmFaucetJSONBodyNetwork defines parameters for RequestEvmFaucet. -type RequestEvmFaucetJSONBodyNetwork string +// ListEndUsersParamsSort defines parameters for ListEndUsers. +type ListEndUsersParamsSort string -// RequestEvmFaucetJSONBodyToken defines parameters for RequestEvmFaucet. -type RequestEvmFaucetJSONBodyToken string +// CreateEndUserJSONBody defines parameters for CreateEndUser. +type CreateEndUserJSONBody struct { + // AuthenticationMethods The list of valid authentication methods linked to the end user. + AuthenticationMethods AuthenticationMethods `json:"authenticationMethods"` -// ListEvmSmartAccountsParams defines parameters for ListEvmSmartAccounts. -type ListEvmSmartAccountsParams struct { - // PageSize The number of resources to return per page. - PageSize *PageSize `form:"pageSize,omitempty" json:"pageSize,omitempty"` + // EvmAccount Configuration for creating an EVM account for the end user. + EvmAccount *struct { + // CreateSmartAccount If true, creates an EVM smart account and a default EVM EOA account as the owner. If false, only a EVM EOA account is created. + CreateSmartAccount *bool `json:"createSmartAccount,omitempty"` - // PageToken The token for the next page of resources, if any. - PageToken *PageToken `form:"pageToken,omitempty" json:"pageToken,omitempty"` -} + // EnableSpendPermissions If true, enables spend permissions for the EVM smart account. + EnableSpendPermissions *bool `json:"enableSpendPermissions,omitempty"` + } `json:"evmAccount,omitempty"` -// CreateEvmSmartAccountJSONBody defines parameters for CreateEvmSmartAccount. -type CreateEvmSmartAccountJSONBody struct { - // Name An optional name for the account. - // Account names can consist of alphanumeric characters and hyphens, and be between 2 and 36 characters long. - // Account names must be unique across all EVM accounts in the developer's CDP Project. - Name *string `json:"name,omitempty"` + // SolanaAccount Configuration for creating a Solana account for the end user. + SolanaAccount *struct { + // CreateSmartAccount Only false is a valid option since currently smart accounts on Solana are not supported. + CreateSmartAccount *bool `json:"createSmartAccount,omitempty"` + } `json:"solanaAccount,omitempty"` - // Owners Today, only a single owner can be set for a Smart Account, but this is an array to allow setting multiple owners in the future. - Owners []string `json:"owners"` + // UserId A stable, unique identifier for the end user. The `userId` must be unique across all end users in the developer's CDP Project. It must be between 1 and 100 characters long and can only contain alphanumeric characters and hyphens. + // + // If `userId` is not provided in the request, the server will generate a random UUID. + UserId *string `json:"userId,omitempty"` } -// CreateEvmSmartAccountParams defines parameters for CreateEvmSmartAccount. -type CreateEvmSmartAccountParams struct { +// CreateEndUserParams defines parameters for CreateEndUser. +type CreateEndUserParams struct { + // XWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the + // [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) + // section of our Authentication docs for more details on how to generate your Wallet Token. + XWalletAuth *XWalletAuth `json:"X-Wallet-Auth,omitempty"` + // XIdempotencyKey An optional string request header for making requests safely retryable. // When included, duplicate requests with the same key will return identical responses. // Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. XIdempotencyKey *IdempotencyKey `json:"X-Idempotency-Key,omitempty"` } -// UpdateEvmSmartAccountJSONBody defines parameters for UpdateEvmSmartAccount. -type UpdateEvmSmartAccountJSONBody struct { - // Name An optional name for the smart account. - // Account names can consist of alphanumeric characters and hyphens, and be between 2 and 36 characters long. - // Account names must be unique across all EVM smart accounts in the developer's CDP Project. - Name *string `json:"name,omitempty"` +// ValidateEndUserAccessTokenJSONBody defines parameters for ValidateEndUserAccessToken. +type ValidateEndUserAccessTokenJSONBody struct { + // AccessToken The access token in JWT format to verify. + AccessToken string `json:"accessToken"` } -// CreateSpendPermissionParams defines parameters for CreateSpendPermission. -type CreateSpendPermissionParams struct { +// ImportEndUserJSONBody defines parameters for ImportEndUser. +type ImportEndUserJSONBody struct { + // AuthenticationMethods The list of valid authentication methods linked to the end user. + AuthenticationMethods AuthenticationMethods `json:"authenticationMethods"` + + // EncryptedPrivateKey The base64-encoded, encrypted private key to import. The private key must be encrypted using the CDP SDK's encryption scheme. This is a 32-byte raw private key. + EncryptedPrivateKey string `json:"encryptedPrivateKey"` + + // KeyType The type of key being imported. Determines what type of account will be associated for the end user. + KeyType ImportEndUserJSONBodyKeyType `json:"keyType"` + + // UserId A stable, unique identifier for the end user. The `userId` must be unique across all end users in the developer's CDP Project. It must be between 1 and 100 characters long and can only contain alphanumeric characters and hyphens. + UserId string `json:"userId"` +} + +// ImportEndUserParams defines parameters for ImportEndUser. +type ImportEndUserParams struct { // XWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the // [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) // section of our Authentication docs for more details on how to generate your Wallet Token. @@ -4092,17 +4287,14 @@ type CreateSpendPermissionParams struct { XIdempotencyKey *IdempotencyKey `json:"X-Idempotency-Key,omitempty"` } -// ListSpendPermissionsParams defines parameters for ListSpendPermissions. -type ListSpendPermissionsParams struct { - // PageSize The number of spend permissions to return per page. - PageSize *int `form:"pageSize,omitempty" json:"pageSize,omitempty"` +// ImportEndUserJSONBodyKeyType defines parameters for ImportEndUser. +type ImportEndUserJSONBodyKeyType string - // PageToken The token for the next page of spend permissions. Will be empty if there are no more spend permissions to fetch. - PageToken *string `form:"pageToken,omitempty" json:"pageToken,omitempty"` -} +// AddEndUserEvmAccountJSONBody defines parameters for AddEndUserEvmAccount. +type AddEndUserEvmAccountJSONBody = map[string]interface{} -// RevokeSpendPermissionParams defines parameters for RevokeSpendPermission. -type RevokeSpendPermissionParams struct { +// AddEndUserEvmAccountParams defines parameters for AddEndUserEvmAccount. +type AddEndUserEvmAccountParams struct { // XWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the // [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) // section of our Authentication docs for more details on how to generate your Wallet Token. @@ -4114,312 +4306,213 @@ type RevokeSpendPermissionParams struct { XIdempotencyKey *IdempotencyKey `json:"X-Idempotency-Key,omitempty"` } -// PrepareUserOperationJSONBody defines parameters for PrepareUserOperation. -type PrepareUserOperationJSONBody struct { - // Calls The list of calls to make from the Smart Account. - Calls []EvmCall `json:"calls"` - - // DataSuffix The EIP-8021 data suffix (hex-encoded) that enables transaction attribution for the user operation. - DataSuffix *string `json:"dataSuffix,omitempty"` - - // Network The network the user operation is for. - Network EvmUserOperationNetwork `json:"network"` - - // PaymasterUrl The URL of the paymaster to use for the user operation. - PaymasterUrl *Url `json:"paymasterUrl,omitempty"` +// AddEndUserEvmSmartAccountJSONBody defines parameters for AddEndUserEvmSmartAccount. +type AddEndUserEvmSmartAccountJSONBody struct { + // EnableSpendPermissions If true, enables spend permissions for the EVM smart account. + EnableSpendPermissions *bool `json:"enableSpendPermissions,omitempty"` } -// PrepareAndSendUserOperationJSONBody defines parameters for PrepareAndSendUserOperation. -type PrepareAndSendUserOperationJSONBody struct { - // Calls The list of calls to make from the Smart Account. - Calls []EvmCall `json:"calls"` - - // Network The network the user operation is for. - Network EvmUserOperationNetwork `json:"network"` - - // PaymasterUrl The URL of the paymaster to use for the user operation. - PaymasterUrl *Url `json:"paymasterUrl,omitempty"` -} +// AddEndUserEvmSmartAccountParams defines parameters for AddEndUserEvmSmartAccount. +type AddEndUserEvmSmartAccountParams struct { + // XWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the + // [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) + // section of our Authentication docs for more details on how to generate your Wallet Token. + XWalletAuth *XWalletAuth `json:"X-Wallet-Auth,omitempty"` -// PrepareAndSendUserOperationParams defines parameters for PrepareAndSendUserOperation. -type PrepareAndSendUserOperationParams struct { // XIdempotencyKey An optional string request header for making requests safely retryable. // When included, duplicate requests with the same key will return identical responses. // Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. XIdempotencyKey *IdempotencyKey `json:"X-Idempotency-Key,omitempty"` +} + +// AddEndUserSolanaAccountJSONBody defines parameters for AddEndUserSolanaAccount. +type AddEndUserSolanaAccountJSONBody = map[string]interface{} +// AddEndUserSolanaAccountParams defines parameters for AddEndUserSolanaAccount. +type AddEndUserSolanaAccountParams struct { // XWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the // [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) // section of our Authentication docs for more details on how to generate your Wallet Token. XWalletAuth *XWalletAuth `json:"X-Wallet-Auth,omitempty"` -} -// SendUserOperationJSONBody defines parameters for SendUserOperation. -type SendUserOperationJSONBody struct { - // Signature The hex-encoded signature of the user operation. This should be a 65-byte signature consisting of the `r`, `s`, and `v` values of the ECDSA signature. Note that the `v` value should conform to the `personal_sign` standard, which means it should be 27 or 28. - Signature string `json:"signature"` + // XIdempotencyKey An optional string request header for making requests safely retryable. + // When included, duplicate requests with the same key will return identical responses. + // Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. + XIdempotencyKey *IdempotencyKey `json:"X-Idempotency-Key,omitempty"` } -// CreateEvmSwapQuoteJSONBody defines parameters for CreateEvmSwapQuote. -type CreateEvmSwapQuoteJSONBody struct { - // FromAmount The amount of the `fromToken` to send in atomic units of the token. For example, `1000000000000000000` when sending ETH equates to 1 ETH, `1000000` when sending USDC equates to 1 USDC, etc. - FromAmount string `json:"fromAmount"` - - // FromToken The 0x-prefixed contract address of the token to send. - FromToken string `json:"fromToken"` +// ListEvmAccountsParams defines parameters for ListEvmAccounts. +type ListEvmAccountsParams struct { + // PageSize The number of resources to return per page. + PageSize *PageSize `form:"pageSize,omitempty" json:"pageSize,omitempty"` - // GasPrice The target gas price for the swap transaction, in Wei. For EIP-1559 transactions, this value should be seen as the `maxFeePerGas` value. If not provided, the API will use an estimate based on the current network conditions. - GasPrice *string `json:"gasPrice,omitempty"` + // PageToken The token for the next page of resources, if any. + PageToken *PageToken `form:"pageToken,omitempty" json:"pageToken,omitempty"` +} - // Network The network on which to perform the swap. - Network EvmSwapsNetwork `json:"network"` - - // SignerAddress The 0x-prefixed Externally Owned Account (EOA) address that will sign the `Permit2` EIP-712 permit message. This is only needed if `taker` is a smart contract. - SignerAddress *string `json:"signerAddress,omitempty"` - - // SlippageBps The maximum acceptable slippage of the `toToken` in basis points. If this parameter is set to 0, no slippage will be tolerated. If not provided, the default slippage tolerance is 100 bps (i.e., 1%). - SlippageBps *int `json:"slippageBps,omitempty"` - - // Taker The 0x-prefixed address that holds the `fromToken` balance and has the `Permit2` allowance set for the swap. - Taker string `json:"taker"` +// CreateEvmAccountJSONBody defines parameters for CreateEvmAccount. +type CreateEvmAccountJSONBody struct { + // AccountPolicy The ID of the account-level policy to apply to the account. + AccountPolicy *string `json:"accountPolicy,omitempty"` - // ToToken The 0x-prefixed contract address of the token to receive. - ToToken string `json:"toToken"` + // Name An optional name for the account. + // Account names can consist of alphanumeric characters and hyphens, and be between 2 and 36 characters long. + // Account names must be unique across all EVM accounts in the developer's CDP Project. + Name *string `json:"name,omitempty"` } -// CreateEvmSwapQuoteParams defines parameters for CreateEvmSwapQuote. -type CreateEvmSwapQuoteParams struct { +// CreateEvmAccountParams defines parameters for CreateEvmAccount. +type CreateEvmAccountParams struct { + // XWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the + // [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) + // section of our Authentication docs for more details on how to generate your Wallet Token. + XWalletAuth *XWalletAuth `json:"X-Wallet-Auth,omitempty"` + // XIdempotencyKey An optional string request header for making requests safely retryable. // When included, duplicate requests with the same key will return identical responses. // Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. XIdempotencyKey *IdempotencyKey `json:"X-Idempotency-Key,omitempty"` } -// GetEvmSwapPriceParams defines parameters for GetEvmSwapPrice. -type GetEvmSwapPriceParams struct { - Network EvmSwapsNetwork `form:"network" json:"network"` - ToToken ToToken `form:"toToken" json:"toToken"` - FromToken FromToken `form:"fromToken" json:"fromToken"` - FromAmount FromAmount `form:"fromAmount" json:"fromAmount"` - Taker Taker `form:"taker" json:"taker"` - SignerAddress *SignerAddress `form:"signerAddress,omitempty" json:"signerAddress,omitempty"` - GasPrice *GasPrice `form:"gasPrice,omitempty" json:"gasPrice,omitempty"` - SlippageBps *SlippageBps `form:"slippageBps,omitempty" json:"slippageBps,omitempty"` +// ExportEvmAccountByNameJSONBody defines parameters for ExportEvmAccountByName. +type ExportEvmAccountByNameJSONBody struct { + // ExportEncryptionKey The base64-encoded, public part of the RSA key in DER format used to encrypt the account private key. + ExportEncryptionKey string `json:"exportEncryptionKey"` } -// ListEvmTokenBalancesParams defines parameters for ListEvmTokenBalances. -type ListEvmTokenBalancesParams struct { - // PageSize The number of resources to return per page. - PageSize *PageSize `form:"pageSize,omitempty" json:"pageSize,omitempty"` +// ExportEvmAccountByNameParams defines parameters for ExportEvmAccountByName. +type ExportEvmAccountByNameParams struct { + // XWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the + // [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) + // section of our Authentication docs for more details on how to generate your Wallet Token. + XWalletAuth *XWalletAuth `json:"X-Wallet-Auth,omitempty"` - // PageToken The token for the next page of resources, if any. - PageToken *PageToken `form:"pageToken,omitempty" json:"pageToken,omitempty"` + // XIdempotencyKey An optional string request header for making requests safely retryable. + // When included, duplicate requests with the same key will return identical responses. + // Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. + XIdempotencyKey *IdempotencyKey `json:"X-Idempotency-Key,omitempty"` } -// GetOnrampUserLimitsJSONBody defines parameters for GetOnrampUserLimits. -type GetOnrampUserLimitsJSONBody struct { - // PaymentMethodType The type of payment method to be used to complete an onramp order. - PaymentMethodType OnrampOrderPaymentMethodTypeId `json:"paymentMethodType"` +// ImportEvmAccountJSONBody defines parameters for ImportEvmAccount. +type ImportEvmAccountJSONBody struct { + // AccountPolicy The ID of the account-level policy to apply to the account. + AccountPolicy *string `json:"accountPolicy,omitempty"` - // UserId The user identifier value. For `phone_number` type, this must be in E.164 format. - UserId string `json:"userId"` + // EncryptedPrivateKey The base64-encoded, encrypted private key of the EVM account. The private key must be encrypted using the CDP SDK's encryption scheme. + EncryptedPrivateKey string `json:"encryptedPrivateKey"` - // UserIdType The type of user identifier: - // - `phone_number`: A phone number in E.164 format associated with an onramp user. - UserIdType OnrampUserIdType `json:"userIdType"` + // Name An optional name for the account. + // Account names can consist of alphanumeric characters and hyphens, and be between 2 and 36 characters long. + // Account names must be unique across all EVM accounts in the developer's CDP Project. + Name *string `json:"name,omitempty"` } -// CreateOnrampOrderJSONBody defines parameters for CreateOnrampOrder. -type CreateOnrampOrderJSONBody struct { - // AgreementAcceptedAt The timestamp of when the user acknowledged that by using Coinbase Onramp they are accepting the Coinbase Terms (https://www.coinbase.com/legal/guest-checkout/us), User Agreement (https://www.coinbase.com/legal/user_agreement), and Privacy Policy (https://www.coinbase.com/legal/privacy). - AgreementAcceptedAt time.Time `json:"agreementAcceptedAt"` - - // ClientIp The IP address of the end user requesting the onramp transaction. - ClientIp *string `json:"clientIp,omitempty"` - - // DestinationAddress The address the purchased crypto will be sent to. - DestinationAddress BlockchainAddress `json:"destinationAddress"` - - // DestinationNetwork The name of the crypto network the purchased currency will be sent on. - // - // Use the [Onramp Buy Options API](https://docs.cdp.coinbase.com/api-reference/rest-api/onramp-offramp/get-buy-options) to discover the supported networks for your user's location. - DestinationNetwork string `json:"destinationNetwork"` - - // Domain The domain that the Apple Pay button will be rendered on. Required when using the `GUEST_CHECKOUT_APPLE_PAY` payment method and embedding the payment link in an iframe. - Domain *string `json:"domain,omitempty"` - - // Email The verified email address of the user requesting the onramp transaction. This email must be verified by your app (via OTP) before being used with the Onramp API. - Email string `json:"email"` - - // IsQuote If true, this API will return a quote without creating any transaction. - IsQuote *bool `json:"isQuote,omitempty"` - - // PartnerOrderRef Optional partner order reference ID. - PartnerOrderRef *string `json:"partnerOrderRef,omitempty"` - - // PartnerUserRef A unique string that represents the user in your app. This can be used to link individual transactions together so you can retrieve the transaction history for your users. Prefix this string with “sandbox-” (e.g. "sandbox-user-1234") to perform a sandbox transaction which will allow you to test your integration without any real transfer of funds. - // - // This value can be used with with [Onramp User Transactions API](https://docs.cdp.coinbase.com/api-reference/rest-api/onramp-offramp/get-onramp-transactions-by-id) to retrieve all transactions created by the user. - PartnerUserRef string `json:"partnerUserRef"` - - // PaymentAmount A string representing the amount of fiat the user wishes to pay in exchange for crypto. When using this parameter, the returned quote will be inclusive of fees i.e. the user will pay this exact amount of the payment currency. - PaymentAmount *string `json:"paymentAmount,omitempty"` - - // PaymentCurrency The fiat currency to be converted to crypto. - PaymentCurrency string `json:"paymentCurrency"` - - // PaymentMethod The type of payment method to be used to complete an onramp order. - PaymentMethod OnrampOrderPaymentMethodTypeId `json:"paymentMethod"` - - // PhoneNumber The phone number of the user requesting the onramp transaction in E.164 format. This phone number must be verified by your app (via OTP) before being used with the Onramp API. - // - // Please refer to the [Onramp docs](https://docs.cdp.coinbase.com/onramp-&-offramp/onramp-apis/apple-pay-onramp-api) for more details on phone number verification requirements and best practices. - PhoneNumber string `json:"phoneNumber"` - - // PhoneNumberVerifiedAt Timestamp of when the user's phone number was verified via OTP. User phone number must be verified every 60 days. If this timestamp is older than 60 days, an error will be returned. - PhoneNumberVerifiedAt time.Time `json:"phoneNumberVerifiedAt"` - - // PurchaseAmount A string representing the amount of crypto the user wishes to purchase. When using this parameter the returned quote will be exclusive of fees i.e. the user will receive this exact amount of the purchase currency. - PurchaseAmount *string `json:"purchaseAmount,omitempty"` +// ImportEvmAccountParams defines parameters for ImportEvmAccount. +type ImportEvmAccountParams struct { + // XWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the + // [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) + // section of our Authentication docs for more details on how to generate your Wallet Token. + XWalletAuth *XWalletAuth `json:"X-Wallet-Auth,omitempty"` - // PurchaseCurrency The ticker (e.g. `BTC`, `USDC`, `SOL`) or the Coinbase UUID (e.g. `d85dce9b-5b73-5c3c-8978-522ce1d1c1b4`) of the crypto asset to be purchased. - // - // Use the [Onramp Buy Options API](https://docs.cdp.coinbase.com/api-reference/rest-api/onramp-offramp/get-buy-options) to discover the supported purchase currencies for your user's location. - PurchaseCurrency string `json:"purchaseCurrency"` + // XIdempotencyKey An optional string request header for making requests safely retryable. + // When included, duplicate requests with the same key will return identical responses. + // Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. + XIdempotencyKey *IdempotencyKey `json:"X-Idempotency-Key,omitempty"` } -// CreateOnrampSessionJSONBody defines parameters for CreateOnrampSession. -type CreateOnrampSessionJSONBody struct { - // ClientIp The IP address of the end user requesting the onramp transaction. - ClientIp *string `json:"clientIp,omitempty"` - - // Country The ISO 3166-1 two letter country code (e.g. US). - Country *string `json:"country,omitempty"` - - // DestinationAddress The address the purchased crypto will be sent to. - DestinationAddress BlockchainAddress `json:"destinationAddress"` - - // DestinationNetwork The name of the crypto network the purchased currency will be sent on. - // - // Use the [Onramp Buy Options API](https://docs.cdp.coinbase.com/api-reference/rest-api/onramp-offramp/get-buy-options) to discover the supported networks for your user's location. - DestinationNetwork string `json:"destinationNetwork"` - - // PartnerUserRef A unique string that represents the user in your app. This can be used to link individual transactions together so you can retrieve the transaction history for your users. Prefix this string with “sandbox-” (e.g. "sandbox-user-1234") to perform a sandbox transaction which will allow you to test your integration without any real transfer of funds. - // - // This value can be used with with [Onramp User Transactions API](https://docs.cdp.coinbase.com/api-reference/rest-api/onramp-offramp/get-onramp-transactions-by-id) to retrieve all transactions created by the user. - PartnerUserRef *string `json:"partnerUserRef,omitempty"` - - // PaymentAmount A string representing the amount of fiat the user wishes to pay in exchange for crypto. When using this parameter, the returned quote will be inclusive of fees i.e. the user will pay this exact amount of the payment currency. - PaymentAmount *string `json:"paymentAmount,omitempty"` - - // PaymentCurrency The fiat currency to be converted to crypto. - PaymentCurrency *string `json:"paymentCurrency,omitempty"` - - // PaymentMethod The type of payment method used to generate the onramp quote. - PaymentMethod *OnrampQuotePaymentMethodTypeId `json:"paymentMethod,omitempty"` - - // PurchaseAmount A string representing the amount of crypto the user wishes to purchase. When using this parameter, the returned quote will be exclusive of fees i.e. the user will receive this exact amount of the purchase currency. - PurchaseAmount *string `json:"purchaseAmount,omitempty"` - - // PurchaseCurrency The ticker (e.g. `BTC`, `USDC`, `SOL`) or the Coinbase UUID (e.g. `d85dce9b-5b73-5c3c-8978-522ce1d1c1b4`) of the crypto asset to be purchased. - // - // Use the [Onramp Buy Options API](https://docs.cdp.coinbase.com/api-reference/rest-api/onramp-offramp/get-buy-options) to discover the supported purchase currencies for your user's location. - PurchaseCurrency string `json:"purchaseCurrency"` - - // RedirectUrl URI to redirect the user to when they successfully complete a transaction. This URI will be embedded in the returned onramp URI as a query parameter. - RedirectUrl *Uri `json:"redirectUrl,omitempty"` +// UpdateEvmAccountJSONBody defines parameters for UpdateEvmAccount. +type UpdateEvmAccountJSONBody struct { + // AccountPolicy The ID of the account-level policy to apply to the account, or an empty string to unset attached policy. + AccountPolicy *string `json:"accountPolicy,omitempty"` - // Subdivision The ISO 3166-2 two letter state code (e.g. NY). Only required for US. - Subdivision *string `json:"subdivision,omitempty"` + // Name An optional name for the account. + // Account names can consist of alphanumeric characters and hyphens, and be between 2 and 36 characters long. + // Account names must be unique across all EVM accounts in the developer's CDP Project. + Name *string `json:"name,omitempty"` } -// ListPoliciesParams defines parameters for ListPolicies. -type ListPoliciesParams struct { - // PageSize The number of resources to return per page. - PageSize *PageSize `form:"pageSize,omitempty" json:"pageSize,omitempty"` - - // PageToken The token for the next page of resources, if any. - PageToken *PageToken `form:"pageToken,omitempty" json:"pageToken,omitempty"` - - // Scope The scope of the policies to return. If `project`, the response will include exactly one policy, which is the project-level policy. If `account`, the response will include all account-level policies for the developer's CDP Project. - Scope *ListPoliciesParamsScope `form:"scope,omitempty" json:"scope,omitempty"` +// UpdateEvmAccountParams defines parameters for UpdateEvmAccount. +type UpdateEvmAccountParams struct { + // XIdempotencyKey An optional string request header for making requests safely retryable. + // When included, duplicate requests with the same key will return identical responses. + // Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. + XIdempotencyKey *IdempotencyKey `json:"X-Idempotency-Key,omitempty"` } -// ListPoliciesParamsScope defines parameters for ListPolicies. -type ListPoliciesParamsScope string - -// CreatePolicyJSONBody defines parameters for CreatePolicy. -type CreatePolicyJSONBody struct { - // Description An optional human-readable description for the policy. - // Policy descriptions can consist of alphanumeric characters, spaces, commas, and periods, and be 50 characters or less. - Description *string `json:"description,omitempty"` - - // Rules A list of rules that comprise the policy. There is a limit of 10 rules per policy. - Rules []Rule `json:"rules"` +// CreateEvmEip7702DelegationJSONBody defines parameters for CreateEvmEip7702Delegation. +type CreateEvmEip7702DelegationJSONBody struct { + // EnableSpendPermissions Whether to configure spend permissions for the upgraded, delegated account. When enabled, the account can grant permissions for third parties to spend on its behalf. + EnableSpendPermissions *bool `json:"enableSpendPermissions,omitempty"` - // Scope The scope of the policy. - Scope CreatePolicyJSONBodyScope `json:"scope"` + // Network The network for the EIP-7702 delegation. + Network EvmEip7702DelegationNetwork `json:"network"` } -// CreatePolicyParams defines parameters for CreatePolicy. -type CreatePolicyParams struct { +// CreateEvmEip7702DelegationParams defines parameters for CreateEvmEip7702Delegation. +type CreateEvmEip7702DelegationParams struct { + // XWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the + // [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) + // section of our Authentication docs for more details on how to generate your Wallet Token. + XWalletAuth *XWalletAuth `json:"X-Wallet-Auth,omitempty"` + // XIdempotencyKey An optional string request header for making requests safely retryable. // When included, duplicate requests with the same key will return identical responses. // Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. XIdempotencyKey *IdempotencyKey `json:"X-Idempotency-Key,omitempty"` } -// CreatePolicyJSONBodyScope defines parameters for CreatePolicy. -type CreatePolicyJSONBodyScope string +// ExportEvmAccountJSONBody defines parameters for ExportEvmAccount. +type ExportEvmAccountJSONBody struct { + // ExportEncryptionKey The base64-encoded, public part of the RSA key in DER format used to encrypt the account private key. + ExportEncryptionKey string `json:"exportEncryptionKey"` +} + +// ExportEvmAccountParams defines parameters for ExportEvmAccount. +type ExportEvmAccountParams struct { + // XWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the + // [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) + // section of our Authentication docs for more details on how to generate your Wallet Token. + XWalletAuth *XWalletAuth `json:"X-Wallet-Auth,omitempty"` -// DeletePolicyParams defines parameters for DeletePolicy. -type DeletePolicyParams struct { // XIdempotencyKey An optional string request header for making requests safely retryable. // When included, duplicate requests with the same key will return identical responses. // Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. XIdempotencyKey *IdempotencyKey `json:"X-Idempotency-Key,omitempty"` } -// UpdatePolicyJSONBody defines parameters for UpdatePolicy. -type UpdatePolicyJSONBody struct { - // Description An optional human-readable description for the policy. - // Policy descriptions can consist of alphanumeric characters, spaces, commas, and periods, and be 50 characters or less. - Description *string `json:"description,omitempty"` +// SendEvmTransactionJSONBody defines parameters for SendEvmTransaction. +type SendEvmTransactionJSONBody struct { + // Network The network to send the transaction to. + Network SendEvmTransactionJSONBodyNetwork `json:"network"` - // Rules A list of rules that comprise the policy. There is a limit of 10 rules per policy. - Rules []Rule `json:"rules"` + // Transaction The RLP-encoded transaction to sign and send, as a 0x-prefixed hex string. + Transaction string `json:"transaction"` } -// UpdatePolicyParams defines parameters for UpdatePolicy. -type UpdatePolicyParams struct { +// SendEvmTransactionParams defines parameters for SendEvmTransaction. +type SendEvmTransactionParams struct { + // XWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the + // [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) + // section of our Authentication docs for more details on how to generate your Wallet Token. + XWalletAuth *XWalletAuth `json:"X-Wallet-Auth,omitempty"` + // XIdempotencyKey An optional string request header for making requests safely retryable. // When included, duplicate requests with the same key will return identical responses. // Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. XIdempotencyKey *IdempotencyKey `json:"X-Idempotency-Key,omitempty"` } -// ListSolanaAccountsParams defines parameters for ListSolanaAccounts. -type ListSolanaAccountsParams struct { - // PageSize The number of resources to return per page. - PageSize *PageSize `form:"pageSize,omitempty" json:"pageSize,omitempty"` - - // PageToken The token for the next page of resources, if any. - PageToken *PageToken `form:"pageToken,omitempty" json:"pageToken,omitempty"` -} - -// CreateSolanaAccountJSONBody defines parameters for CreateSolanaAccount. -type CreateSolanaAccountJSONBody struct { - // AccountPolicy The ID of the account-level policy to apply to the account. - AccountPolicy *string `json:"accountPolicy,omitempty"` +// SendEvmTransactionJSONBodyNetwork defines parameters for SendEvmTransaction. +type SendEvmTransactionJSONBodyNetwork string - // Name An optional name for the account. - // Account names can consist of alphanumeric characters and hyphens, and be between 2 and 36 characters long. - // Account names must be unique across all Solana accounts in the developer's CDP Project. - Name *string `json:"name,omitempty"` +// SignEvmHashJSONBody defines parameters for SignEvmHash. +type SignEvmHashJSONBody struct { + // Hash The arbitrary 32 byte hash to sign. + Hash string `json:"hash"` } -// CreateSolanaAccountParams defines parameters for CreateSolanaAccount. -type CreateSolanaAccountParams struct { +// SignEvmHashParams defines parameters for SignEvmHash. +type SignEvmHashParams struct { // XWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the // [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) // section of our Authentication docs for more details on how to generate your Wallet Token. @@ -4431,14 +4524,14 @@ type CreateSolanaAccountParams struct { XIdempotencyKey *IdempotencyKey `json:"X-Idempotency-Key,omitempty"` } -// ExportSolanaAccountByNameJSONBody defines parameters for ExportSolanaAccountByName. -type ExportSolanaAccountByNameJSONBody struct { - // ExportEncryptionKey The base64-encoded, public part of the RSA key in DER format used to encrypt the account private key. - ExportEncryptionKey string `json:"exportEncryptionKey"` +// SignEvmMessageJSONBody defines parameters for SignEvmMessage. +type SignEvmMessageJSONBody struct { + // Message The message to sign. + Message string `json:"message"` } -// ExportSolanaAccountByNameParams defines parameters for ExportSolanaAccountByName. -type ExportSolanaAccountByNameParams struct { +// SignEvmMessageParams defines parameters for SignEvmMessage. +type SignEvmMessageParams struct { // XWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the // [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) // section of our Authentication docs for more details on how to generate your Wallet Token. @@ -4450,19 +4543,14 @@ type ExportSolanaAccountByNameParams struct { XIdempotencyKey *IdempotencyKey `json:"X-Idempotency-Key,omitempty"` } -// ImportSolanaAccountJSONBody defines parameters for ImportSolanaAccount. -type ImportSolanaAccountJSONBody struct { - // EncryptedPrivateKey The base64-encoded, encrypted 32-byte private key of the Solana account. The private key must be encrypted using the CDP SDK's encryption scheme. - EncryptedPrivateKey string `json:"encryptedPrivateKey"` - - // Name An optional name for the account. - // Account names can consist of alphanumeric characters and hyphens, and be between 2 and 36 characters long. - // Account names must be unique across all EVM accounts in the developer's CDP Project. - Name *string `json:"name,omitempty"` +// SignEvmTransactionJSONBody defines parameters for SignEvmTransaction. +type SignEvmTransactionJSONBody struct { + // Transaction The RLP-encoded transaction to sign, as a 0x-prefixed hex string. + Transaction string `json:"transaction"` } -// ImportSolanaAccountParams defines parameters for ImportSolanaAccount. -type ImportSolanaAccountParams struct { +// SignEvmTransactionParams defines parameters for SignEvmTransaction. +type SignEvmTransactionParams struct { // XWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the // [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) // section of our Authentication docs for more details on how to generate your Wallet Token. @@ -4474,17 +4562,8 @@ type ImportSolanaAccountParams struct { XIdempotencyKey *IdempotencyKey `json:"X-Idempotency-Key,omitempty"` } -// SendSolanaTransactionJSONBody defines parameters for SendSolanaTransaction. -type SendSolanaTransactionJSONBody struct { - // Network The Solana network to send the transaction to. - Network SendSolanaTransactionJSONBodyNetwork `json:"network"` - - // Transaction The base64 encoded transaction to sign and send. This transaction can contain multiple instructions for native Solana batching. - Transaction string `json:"transaction"` -} - -// SendSolanaTransactionParams defines parameters for SendSolanaTransaction. -type SendSolanaTransactionParams struct { +// SignEvmTypedDataParams defines parameters for SignEvmTypedData. +type SignEvmTypedDataParams struct { // XWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the // [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) // section of our Authentication docs for more details on how to generate your Wallet Token. @@ -4496,54 +4575,62 @@ type SendSolanaTransactionParams struct { XIdempotencyKey *IdempotencyKey `json:"X-Idempotency-Key,omitempty"` } -// SendSolanaTransactionJSONBodyNetwork defines parameters for SendSolanaTransaction. -type SendSolanaTransactionJSONBodyNetwork string +// RequestEvmFaucetJSONBody defines parameters for RequestEvmFaucet. +type RequestEvmFaucetJSONBody struct { + // Address The address to request funds to, which is a 0x-prefixed hexadecimal string. + Address string `json:"address"` -// UpdateSolanaAccountJSONBody defines parameters for UpdateSolanaAccount. -type UpdateSolanaAccountJSONBody struct { - // AccountPolicy The ID of the account-level policy to apply to the account, or an empty string to unset attached policy. - AccountPolicy *string `json:"accountPolicy,omitempty"` + // Network The network to request funds from. + Network RequestEvmFaucetJSONBodyNetwork `json:"network"` - // Name An optional name for the account. Account names can consist of alphanumeric characters and hyphens, and be between 2 and 36 characters long. - // Account names must be unique across all Solana accounts in the developer's CDP Project. - Name *string `json:"name,omitempty"` + // Token The token to request funds for. + Token RequestEvmFaucetJSONBodyToken `json:"token"` } -// UpdateSolanaAccountParams defines parameters for UpdateSolanaAccount. -type UpdateSolanaAccountParams struct { - // XIdempotencyKey An optional string request header for making requests safely retryable. - // When included, duplicate requests with the same key will return identical responses. - // Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. - XIdempotencyKey *IdempotencyKey `json:"X-Idempotency-Key,omitempty"` -} +// RequestEvmFaucetJSONBodyNetwork defines parameters for RequestEvmFaucet. +type RequestEvmFaucetJSONBodyNetwork string -// ExportSolanaAccountJSONBody defines parameters for ExportSolanaAccount. -type ExportSolanaAccountJSONBody struct { - // ExportEncryptionKey The base64-encoded, public part of the RSA key in DER format used to encrypt the account private key. - ExportEncryptionKey string `json:"exportEncryptionKey"` +// RequestEvmFaucetJSONBodyToken defines parameters for RequestEvmFaucet. +type RequestEvmFaucetJSONBodyToken string + +// ListEvmSmartAccountsParams defines parameters for ListEvmSmartAccounts. +type ListEvmSmartAccountsParams struct { + // PageSize The number of resources to return per page. + PageSize *PageSize `form:"pageSize,omitempty" json:"pageSize,omitempty"` + + // PageToken The token for the next page of resources, if any. + PageToken *PageToken `form:"pageToken,omitempty" json:"pageToken,omitempty"` } -// ExportSolanaAccountParams defines parameters for ExportSolanaAccount. -type ExportSolanaAccountParams struct { - // XWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the - // [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) - // section of our Authentication docs for more details on how to generate your Wallet Token. - XWalletAuth *XWalletAuth `json:"X-Wallet-Auth,omitempty"` +// CreateEvmSmartAccountJSONBody defines parameters for CreateEvmSmartAccount. +type CreateEvmSmartAccountJSONBody struct { + // Name An optional name for the account. + // Account names can consist of alphanumeric characters and hyphens, and be between 2 and 36 characters long. + // Account names must be unique across all EVM accounts in the developer's CDP Project. + Name *string `json:"name,omitempty"` + + // Owners Today, only a single owner can be set for a Smart Account, but this is an array to allow setting multiple owners in the future. + Owners []string `json:"owners"` +} +// CreateEvmSmartAccountParams defines parameters for CreateEvmSmartAccount. +type CreateEvmSmartAccountParams struct { // XIdempotencyKey An optional string request header for making requests safely retryable. // When included, duplicate requests with the same key will return identical responses. // Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. XIdempotencyKey *IdempotencyKey `json:"X-Idempotency-Key,omitempty"` } -// SignSolanaMessageJSONBody defines parameters for SignSolanaMessage. -type SignSolanaMessageJSONBody struct { - // Message The arbitrary message to sign. - Message string `json:"message"` +// UpdateEvmSmartAccountJSONBody defines parameters for UpdateEvmSmartAccount. +type UpdateEvmSmartAccountJSONBody struct { + // Name An optional name for the smart account. + // Account names can consist of alphanumeric characters and hyphens, and be between 2 and 36 characters long. + // Account names must be unique across all EVM smart accounts in the developer's CDP Project. + Name *string `json:"name,omitempty"` } -// SignSolanaMessageParams defines parameters for SignSolanaMessage. -type SignSolanaMessageParams struct { +// CreateSpendPermissionParams defines parameters for CreateSpendPermission. +type CreateSpendPermissionParams struct { // XWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the // [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) // section of our Authentication docs for more details on how to generate your Wallet Token. @@ -4555,14 +4642,17 @@ type SignSolanaMessageParams struct { XIdempotencyKey *IdempotencyKey `json:"X-Idempotency-Key,omitempty"` } -// SignSolanaTransactionJSONBody defines parameters for SignSolanaTransaction. -type SignSolanaTransactionJSONBody struct { - // Transaction The base64 encoded transaction to sign. - Transaction string `json:"transaction"` +// ListSpendPermissionsParams defines parameters for ListSpendPermissions. +type ListSpendPermissionsParams struct { + // PageSize The number of spend permissions to return per page. + PageSize *int `form:"pageSize,omitempty" json:"pageSize,omitempty"` + + // PageToken The token for the next page of spend permissions. Will be empty if there are no more spend permissions to fetch. + PageToken *string `form:"pageToken,omitempty" json:"pageToken,omitempty"` } -// SignSolanaTransactionParams defines parameters for SignSolanaTransaction. -type SignSolanaTransactionParams struct { +// RevokeSpendPermissionParams defines parameters for RevokeSpendPermission. +type RevokeSpendPermissionParams struct { // XWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the // [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) // section of our Authentication docs for more details on how to generate your Wallet Token. @@ -4574,660 +4664,777 @@ type SignSolanaTransactionParams struct { XIdempotencyKey *IdempotencyKey `json:"X-Idempotency-Key,omitempty"` } -// RequestSolanaFaucetJSONBody defines parameters for RequestSolanaFaucet. -type RequestSolanaFaucetJSONBody struct { - // Address The address to request funds to, which is a base58-encoded string. - Address string `json:"address"` - - // Token The token to request funds for. - Token RequestSolanaFaucetJSONBodyToken `json:"token"` -} +// PrepareUserOperationJSONBody defines parameters for PrepareUserOperation. +type PrepareUserOperationJSONBody struct { + // Calls The list of calls to make from the Smart Account. + Calls []EvmCall `json:"calls"` -// RequestSolanaFaucetJSONBodyToken defines parameters for RequestSolanaFaucet. -type RequestSolanaFaucetJSONBodyToken string + // DataSuffix The EIP-8021 data suffix (hex-encoded) that enables transaction attribution for the user operation. + DataSuffix *string `json:"dataSuffix,omitempty"` -// ListSolanaTokenBalancesParams defines parameters for ListSolanaTokenBalances. -type ListSolanaTokenBalancesParams struct { - // PageSize The number of balances to return per page. - PageSize *int `form:"pageSize,omitempty" json:"pageSize,omitempty"` + // Network The network the user operation is for. + Network EvmUserOperationNetwork `json:"network"` - // PageToken The token for the next page of balances. Will be empty if there are no more balances to fetch. - PageToken *string `form:"pageToken,omitempty" json:"pageToken,omitempty"` + // PaymasterUrl The URL of the paymaster to use for the user operation. + PaymasterUrl *Url `json:"paymasterUrl,omitempty"` } -// SettleX402PaymentJSONBody defines parameters for SettleX402Payment. -type SettleX402PaymentJSONBody struct { - // PaymentPayload The x402 protocol payment payload that the client attaches to x402-paid API requests to the resource server in the X-PAYMENT header. - // For EVM networks, smart account signatures can be longer than 65 bytes. - PaymentPayload X402PaymentPayload `json:"paymentPayload"` +// PrepareAndSendUserOperationJSONBody defines parameters for PrepareAndSendUserOperation. +type PrepareAndSendUserOperationJSONBody struct { + // Calls The list of calls to make from the Smart Account. + Calls []EvmCall `json:"calls"` - // PaymentRequirements The x402 protocol payment requirements that the resource server expects the client's payment payload to meet. - PaymentRequirements X402PaymentRequirements `json:"paymentRequirements"` + // Network The network the user operation is for. + Network EvmUserOperationNetwork `json:"network"` - // X402Version The version of the x402 protocol. - X402Version X402Version `json:"x402Version"` + // PaymasterUrl The URL of the paymaster to use for the user operation. + PaymasterUrl *Url `json:"paymasterUrl,omitempty"` } -// VerifyX402PaymentJSONBody defines parameters for VerifyX402Payment. -type VerifyX402PaymentJSONBody struct { - // PaymentPayload The x402 protocol payment payload that the client attaches to x402-paid API requests to the resource server in the X-PAYMENT header. - // For EVM networks, smart account signatures can be longer than 65 bytes. - PaymentPayload X402PaymentPayload `json:"paymentPayload"` - - // PaymentRequirements The x402 protocol payment requirements that the resource server expects the client's payment payload to meet. - PaymentRequirements X402PaymentRequirements `json:"paymentRequirements"` +// PrepareAndSendUserOperationParams defines parameters for PrepareAndSendUserOperation. +type PrepareAndSendUserOperationParams struct { + // XIdempotencyKey An optional string request header for making requests safely retryable. + // When included, duplicate requests with the same key will return identical responses. + // Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. + XIdempotencyKey *IdempotencyKey `json:"X-Idempotency-Key,omitempty"` - // X402Version The version of the x402 protocol. - X402Version X402Version `json:"x402Version"` + // XWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the + // [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) + // section of our Authentication docs for more details on how to generate your Wallet Token. + XWalletAuth *XWalletAuth `json:"X-Wallet-Auth,omitempty"` } -// RunSQLQueryJSONRequestBody defines body for RunSQLQuery for application/json ContentType. -type RunSQLQueryJSONRequestBody = OnchainDataQuery +// SendUserOperationJSONBody defines parameters for SendUserOperation. +type SendUserOperationJSONBody struct { + // Signature The hex-encoded signature of the user operation. This should be a 65-byte signature consisting of the `r`, `s`, and `v` values of the ECDSA signature. Note that the `v` value should conform to the `personal_sign` standard, which means it should be 27 or 28. + Signature string `json:"signature"` +} -// CreateWebhookSubscriptionJSONRequestBody defines body for CreateWebhookSubscription for application/json ContentType. -type CreateWebhookSubscriptionJSONRequestBody = WebhookSubscriptionRequest +// CreateEvmSwapQuoteJSONBody defines parameters for CreateEvmSwapQuote. +type CreateEvmSwapQuoteJSONBody struct { + // FromAmount The amount of the `fromToken` to send in atomic units of the token. For example, `1000000000000000000` when sending ETH equates to 1 ETH, `1000000` when sending USDC equates to 1 USDC, etc. + FromAmount string `json:"fromAmount"` -// UpdateWebhookSubscriptionJSONRequestBody defines body for UpdateWebhookSubscription for application/json ContentType. -type UpdateWebhookSubscriptionJSONRequestBody = WebhookSubscriptionUpdateRequest + // FromToken The 0x-prefixed contract address of the token to send. + FromToken string `json:"fromToken"` -// CreateEndUserJSONRequestBody defines body for CreateEndUser for application/json ContentType. -type CreateEndUserJSONRequestBody CreateEndUserJSONBody + // GasPrice The target gas price for the swap transaction, in Wei. For EIP-1559 transactions, this value should be seen as the `maxFeePerGas` value. If not provided, the API will use an estimate based on the current network conditions. + GasPrice *string `json:"gasPrice,omitempty"` -// ValidateEndUserAccessTokenJSONRequestBody defines body for ValidateEndUserAccessToken for application/json ContentType. -type ValidateEndUserAccessTokenJSONRequestBody ValidateEndUserAccessTokenJSONBody + // Network The network on which to perform the swap. + Network EvmSwapsNetwork `json:"network"` -// ImportEndUserJSONRequestBody defines body for ImportEndUser for application/json ContentType. -type ImportEndUserJSONRequestBody ImportEndUserJSONBody + // SignerAddress The 0x-prefixed Externally Owned Account (EOA) address that will sign the `Permit2` EIP-712 permit message. This is only needed if `taker` is a smart contract. + SignerAddress *string `json:"signerAddress,omitempty"` -// AddEndUserEvmAccountJSONRequestBody defines body for AddEndUserEvmAccount for application/json ContentType. -type AddEndUserEvmAccountJSONRequestBody = AddEndUserEvmAccountJSONBody + // SlippageBps The maximum acceptable slippage of the `toToken` in basis points. If this parameter is set to 0, no slippage will be tolerated. If not provided, the default slippage tolerance is 100 bps (i.e., 1%). + SlippageBps *int `json:"slippageBps,omitempty"` -// AddEndUserEvmSmartAccountJSONRequestBody defines body for AddEndUserEvmSmartAccount for application/json ContentType. -type AddEndUserEvmSmartAccountJSONRequestBody AddEndUserEvmSmartAccountJSONBody + // Taker The 0x-prefixed address that holds the `fromToken` balance and has the `Permit2` allowance set for the swap. + Taker string `json:"taker"` -// AddEndUserSolanaAccountJSONRequestBody defines body for AddEndUserSolanaAccount for application/json ContentType. -type AddEndUserSolanaAccountJSONRequestBody = AddEndUserSolanaAccountJSONBody + // ToToken The 0x-prefixed contract address of the token to receive. + ToToken string `json:"toToken"` +} -// CreateEvmAccountJSONRequestBody defines body for CreateEvmAccount for application/json ContentType. -type CreateEvmAccountJSONRequestBody CreateEvmAccountJSONBody +// CreateEvmSwapQuoteParams defines parameters for CreateEvmSwapQuote. +type CreateEvmSwapQuoteParams struct { + // XIdempotencyKey An optional string request header for making requests safely retryable. + // When included, duplicate requests with the same key will return identical responses. + // Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. + XIdempotencyKey *IdempotencyKey `json:"X-Idempotency-Key,omitempty"` +} -// ExportEvmAccountByNameJSONRequestBody defines body for ExportEvmAccountByName for application/json ContentType. -type ExportEvmAccountByNameJSONRequestBody ExportEvmAccountByNameJSONBody +// GetEvmSwapPriceParams defines parameters for GetEvmSwapPrice. +type GetEvmSwapPriceParams struct { + Network EvmSwapsNetwork `form:"network" json:"network"` + ToToken ToToken `form:"toToken" json:"toToken"` + FromToken FromToken `form:"fromToken" json:"fromToken"` + FromAmount FromAmount `form:"fromAmount" json:"fromAmount"` + Taker Taker `form:"taker" json:"taker"` + SignerAddress *SignerAddress `form:"signerAddress,omitempty" json:"signerAddress,omitempty"` + GasPrice *GasPrice `form:"gasPrice,omitempty" json:"gasPrice,omitempty"` + SlippageBps *SlippageBps `form:"slippageBps,omitempty" json:"slippageBps,omitempty"` +} -// ImportEvmAccountJSONRequestBody defines body for ImportEvmAccount for application/json ContentType. -type ImportEvmAccountJSONRequestBody ImportEvmAccountJSONBody +// ListEvmTokenBalancesParams defines parameters for ListEvmTokenBalances. +type ListEvmTokenBalancesParams struct { + // PageSize The number of resources to return per page. + PageSize *PageSize `form:"pageSize,omitempty" json:"pageSize,omitempty"` -// UpdateEvmAccountJSONRequestBody defines body for UpdateEvmAccount for application/json ContentType. -type UpdateEvmAccountJSONRequestBody UpdateEvmAccountJSONBody + // PageToken The token for the next page of resources, if any. + PageToken *PageToken `form:"pageToken,omitempty" json:"pageToken,omitempty"` +} -// CreateEvmEip7702DelegationJSONRequestBody defines body for CreateEvmEip7702Delegation for application/json ContentType. -type CreateEvmEip7702DelegationJSONRequestBody CreateEvmEip7702DelegationJSONBody +// GetOnrampUserLimitsJSONBody defines parameters for GetOnrampUserLimits. +type GetOnrampUserLimitsJSONBody struct { + // PaymentMethodType The type of payment method to be used to complete an onramp order. + PaymentMethodType OnrampOrderPaymentMethodTypeId `json:"paymentMethodType"` -// ExportEvmAccountJSONRequestBody defines body for ExportEvmAccount for application/json ContentType. -type ExportEvmAccountJSONRequestBody ExportEvmAccountJSONBody + // UserId The user identifier value. For `phone_number` type, this must be in E.164 format. + UserId string `json:"userId"` -// SendEvmTransactionJSONRequestBody defines body for SendEvmTransaction for application/json ContentType. -type SendEvmTransactionJSONRequestBody SendEvmTransactionJSONBody + // UserIdType The type of user identifier: + // - `phone_number`: A phone number in E.164 format associated with an onramp user. + UserIdType OnrampUserIdType `json:"userIdType"` +} -// SignEvmHashJSONRequestBody defines body for SignEvmHash for application/json ContentType. -type SignEvmHashJSONRequestBody SignEvmHashJSONBody +// CreateOnrampOrderJSONBody defines parameters for CreateOnrampOrder. +type CreateOnrampOrderJSONBody struct { + // AgreementAcceptedAt The timestamp of when the user acknowledged that by using Coinbase Onramp they are accepting the Coinbase Terms (https://www.coinbase.com/legal/guest-checkout/us), User Agreement (https://www.coinbase.com/legal/user_agreement), and Privacy Policy (https://www.coinbase.com/legal/privacy). + AgreementAcceptedAt time.Time `json:"agreementAcceptedAt"` -// SignEvmMessageJSONRequestBody defines body for SignEvmMessage for application/json ContentType. -type SignEvmMessageJSONRequestBody SignEvmMessageJSONBody + // ClientIp The IP address of the end user requesting the onramp transaction. + ClientIp *string `json:"clientIp,omitempty"` -// SignEvmTransactionJSONRequestBody defines body for SignEvmTransaction for application/json ContentType. -type SignEvmTransactionJSONRequestBody SignEvmTransactionJSONBody + // DestinationAddress The address the purchased crypto will be sent to. + DestinationAddress BlockchainAddress `json:"destinationAddress"` -// SignEvmTypedDataJSONRequestBody defines body for SignEvmTypedData for application/json ContentType. -type SignEvmTypedDataJSONRequestBody = EIP712Message + // DestinationNetwork The name of the crypto network the purchased currency will be sent on. + // + // Use the [Onramp Buy Options API](https://docs.cdp.coinbase.com/api-reference/rest-api/onramp-offramp/get-buy-options) to discover the supported networks for your user's location. + DestinationNetwork string `json:"destinationNetwork"` -// RequestEvmFaucetJSONRequestBody defines body for RequestEvmFaucet for application/json ContentType. -type RequestEvmFaucetJSONRequestBody RequestEvmFaucetJSONBody + // Domain The domain that the Apple Pay button will be rendered on. Required when using the `GUEST_CHECKOUT_APPLE_PAY` payment method and embedding the payment link in an iframe. + Domain *string `json:"domain,omitempty"` -// CreateEvmSmartAccountJSONRequestBody defines body for CreateEvmSmartAccount for application/json ContentType. -type CreateEvmSmartAccountJSONRequestBody CreateEvmSmartAccountJSONBody + // Email The verified email address of the user requesting the onramp transaction. This email must be verified by your app (via OTP) before being used with the Onramp API. + Email string `json:"email"` -// UpdateEvmSmartAccountJSONRequestBody defines body for UpdateEvmSmartAccount for application/json ContentType. -type UpdateEvmSmartAccountJSONRequestBody UpdateEvmSmartAccountJSONBody + // IsQuote If true, this API will return a quote without creating any transaction. + IsQuote *bool `json:"isQuote,omitempty"` -// CreateSpendPermissionJSONRequestBody defines body for CreateSpendPermission for application/json ContentType. -type CreateSpendPermissionJSONRequestBody = CreateSpendPermissionRequest + // PartnerOrderRef Optional partner order reference ID. + PartnerOrderRef *string `json:"partnerOrderRef,omitempty"` -// RevokeSpendPermissionJSONRequestBody defines body for RevokeSpendPermission for application/json ContentType. -type RevokeSpendPermissionJSONRequestBody = RevokeSpendPermissionRequest + // PartnerUserRef A unique string that represents the user in your app. This can be used to link individual transactions together so you can retrieve the transaction history for your users. Prefix this string with “sandbox-” (e.g. "sandbox-user-1234") to perform a sandbox transaction which will allow you to test your integration without any real transfer of funds. + // + // This value can be used with with [Onramp User Transactions API](https://docs.cdp.coinbase.com/api-reference/rest-api/onramp-offramp/get-onramp-transactions-by-id) to retrieve all transactions created by the user. + PartnerUserRef string `json:"partnerUserRef"` -// PrepareUserOperationJSONRequestBody defines body for PrepareUserOperation for application/json ContentType. -type PrepareUserOperationJSONRequestBody PrepareUserOperationJSONBody + // PaymentAmount A string representing the amount of fiat the user wishes to pay in exchange for crypto. When using this parameter, the returned quote will be inclusive of fees i.e. the user will pay this exact amount of the payment currency. + PaymentAmount *string `json:"paymentAmount,omitempty"` -// PrepareAndSendUserOperationJSONRequestBody defines body for PrepareAndSendUserOperation for application/json ContentType. -type PrepareAndSendUserOperationJSONRequestBody PrepareAndSendUserOperationJSONBody + // PaymentCurrency The fiat currency to be converted to crypto. + PaymentCurrency string `json:"paymentCurrency"` -// SendUserOperationJSONRequestBody defines body for SendUserOperation for application/json ContentType. -type SendUserOperationJSONRequestBody SendUserOperationJSONBody + // PaymentMethod The type of payment method to be used to complete an onramp order. + PaymentMethod OnrampOrderPaymentMethodTypeId `json:"paymentMethod"` -// CreateEvmSwapQuoteJSONRequestBody defines body for CreateEvmSwapQuote for application/json ContentType. -type CreateEvmSwapQuoteJSONRequestBody CreateEvmSwapQuoteJSONBody + // PhoneNumber The phone number of the user requesting the onramp transaction in E.164 format. This phone number must be verified by your app (via OTP) before being used with the Onramp API. + // + // Please refer to the [Onramp docs](https://docs.cdp.coinbase.com/onramp-&-offramp/onramp-apis/apple-pay-onramp-api) for more details on phone number verification requirements and best practices. + PhoneNumber string `json:"phoneNumber"` -// GetOnrampUserLimitsJSONRequestBody defines body for GetOnrampUserLimits for application/json ContentType. -type GetOnrampUserLimitsJSONRequestBody GetOnrampUserLimitsJSONBody + // PhoneNumberVerifiedAt Timestamp of when the user's phone number was verified via OTP. User phone number must be verified every 60 days. If this timestamp is older than 60 days, an error will be returned. + PhoneNumberVerifiedAt time.Time `json:"phoneNumberVerifiedAt"` -// CreateOnrampOrderJSONRequestBody defines body for CreateOnrampOrder for application/json ContentType. -type CreateOnrampOrderJSONRequestBody CreateOnrampOrderJSONBody + // PurchaseAmount A string representing the amount of crypto the user wishes to purchase. When using this parameter the returned quote will be exclusive of fees i.e. the user will receive this exact amount of the purchase currency. + PurchaseAmount *string `json:"purchaseAmount,omitempty"` -// CreateOnrampSessionJSONRequestBody defines body for CreateOnrampSession for application/json ContentType. -type CreateOnrampSessionJSONRequestBody CreateOnrampSessionJSONBody + // PurchaseCurrency The ticker (e.g. `BTC`, `USDC`, `SOL`) or the Coinbase UUID (e.g. `d85dce9b-5b73-5c3c-8978-522ce1d1c1b4`) of the crypto asset to be purchased. + // + // Use the [Onramp Buy Options API](https://docs.cdp.coinbase.com/api-reference/rest-api/onramp-offramp/get-buy-options) to discover the supported purchase currencies for your user's location. + PurchaseCurrency string `json:"purchaseCurrency"` +} -// CreatePolicyJSONRequestBody defines body for CreatePolicy for application/json ContentType. -type CreatePolicyJSONRequestBody CreatePolicyJSONBody +// CreateOnrampSessionJSONBody defines parameters for CreateOnrampSession. +type CreateOnrampSessionJSONBody struct { + // ClientIp The IP address of the end user requesting the onramp transaction. + ClientIp *string `json:"clientIp,omitempty"` -// UpdatePolicyJSONRequestBody defines body for UpdatePolicy for application/json ContentType. -type UpdatePolicyJSONRequestBody UpdatePolicyJSONBody + // Country The ISO 3166-1 two letter country code (e.g. US). + Country *string `json:"country,omitempty"` -// CreateSolanaAccountJSONRequestBody defines body for CreateSolanaAccount for application/json ContentType. -type CreateSolanaAccountJSONRequestBody CreateSolanaAccountJSONBody + // DestinationAddress The address the purchased crypto will be sent to. + DestinationAddress BlockchainAddress `json:"destinationAddress"` -// ExportSolanaAccountByNameJSONRequestBody defines body for ExportSolanaAccountByName for application/json ContentType. -type ExportSolanaAccountByNameJSONRequestBody ExportSolanaAccountByNameJSONBody + // DestinationNetwork The name of the crypto network the purchased currency will be sent on. + // + // Use the [Onramp Buy Options API](https://docs.cdp.coinbase.com/api-reference/rest-api/onramp-offramp/get-buy-options) to discover the supported networks for your user's location. + DestinationNetwork string `json:"destinationNetwork"` -// ImportSolanaAccountJSONRequestBody defines body for ImportSolanaAccount for application/json ContentType. -type ImportSolanaAccountJSONRequestBody ImportSolanaAccountJSONBody + // PartnerUserRef A unique string that represents the user in your app. This can be used to link individual transactions together so you can retrieve the transaction history for your users. Prefix this string with “sandbox-” (e.g. "sandbox-user-1234") to perform a sandbox transaction which will allow you to test your integration without any real transfer of funds. + // + // This value can be used with with [Onramp User Transactions API](https://docs.cdp.coinbase.com/api-reference/rest-api/onramp-offramp/get-onramp-transactions-by-id) to retrieve all transactions created by the user. + PartnerUserRef *string `json:"partnerUserRef,omitempty"` -// SendSolanaTransactionJSONRequestBody defines body for SendSolanaTransaction for application/json ContentType. -type SendSolanaTransactionJSONRequestBody SendSolanaTransactionJSONBody + // PaymentAmount A string representing the amount of fiat the user wishes to pay in exchange for crypto. When using this parameter, the returned quote will be inclusive of fees i.e. the user will pay this exact amount of the payment currency. + PaymentAmount *string `json:"paymentAmount,omitempty"` -// UpdateSolanaAccountJSONRequestBody defines body for UpdateSolanaAccount for application/json ContentType. -type UpdateSolanaAccountJSONRequestBody UpdateSolanaAccountJSONBody + // PaymentCurrency The fiat currency to be converted to crypto. + PaymentCurrency *string `json:"paymentCurrency,omitempty"` -// ExportSolanaAccountJSONRequestBody defines body for ExportSolanaAccount for application/json ContentType. -type ExportSolanaAccountJSONRequestBody ExportSolanaAccountJSONBody + // PaymentMethod The type of payment method used to generate the onramp quote. + PaymentMethod *OnrampQuotePaymentMethodTypeId `json:"paymentMethod,omitempty"` -// SignSolanaMessageJSONRequestBody defines body for SignSolanaMessage for application/json ContentType. -type SignSolanaMessageJSONRequestBody SignSolanaMessageJSONBody + // PurchaseAmount A string representing the amount of crypto the user wishes to purchase. When using this parameter, the returned quote will be exclusive of fees i.e. the user will receive this exact amount of the purchase currency. + PurchaseAmount *string `json:"purchaseAmount,omitempty"` -// SignSolanaTransactionJSONRequestBody defines body for SignSolanaTransaction for application/json ContentType. -type SignSolanaTransactionJSONRequestBody SignSolanaTransactionJSONBody + // PurchaseCurrency The ticker (e.g. `BTC`, `USDC`, `SOL`) or the Coinbase UUID (e.g. `d85dce9b-5b73-5c3c-8978-522ce1d1c1b4`) of the crypto asset to be purchased. + // + // Use the [Onramp Buy Options API](https://docs.cdp.coinbase.com/api-reference/rest-api/onramp-offramp/get-buy-options) to discover the supported purchase currencies for your user's location. + PurchaseCurrency string `json:"purchaseCurrency"` -// RequestSolanaFaucetJSONRequestBody defines body for RequestSolanaFaucet for application/json ContentType. -type RequestSolanaFaucetJSONRequestBody RequestSolanaFaucetJSONBody + // RedirectUrl URI to redirect the user to when they successfully complete a transaction. This URI will be embedded in the returned onramp URI as a query parameter. + RedirectUrl *Uri `json:"redirectUrl,omitempty"` -// SettleX402PaymentJSONRequestBody defines body for SettleX402Payment for application/json ContentType. -type SettleX402PaymentJSONRequestBody SettleX402PaymentJSONBody + // Subdivision The ISO 3166-2 two letter state code (e.g. NY). Only required for US. + Subdivision *string `json:"subdivision,omitempty"` +} -// VerifyX402PaymentJSONRequestBody defines body for VerifyX402Payment for application/json ContentType. -type VerifyX402PaymentJSONRequestBody VerifyX402PaymentJSONBody +// ListPoliciesParams defines parameters for ListPolicies. +type ListPoliciesParams struct { + // PageSize The number of resources to return per page. + PageSize *PageSize `form:"pageSize,omitempty" json:"pageSize,omitempty"` -// Getter for additional properties for WebhookSubscriptionResponse_Metadata. Returns the specified -// element and whether it was found -func (a WebhookSubscriptionResponse_Metadata) Get(fieldName string) (value string, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} + // PageToken The token for the next page of resources, if any. + PageToken *PageToken `form:"pageToken,omitempty" json:"pageToken,omitempty"` -// Setter for additional properties for WebhookSubscriptionResponse_Metadata -func (a *WebhookSubscriptionResponse_Metadata) Set(fieldName string, value string) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]string) - } - a.AdditionalProperties[fieldName] = value + // Scope The scope of the policies to return. If `project`, the response will include exactly one policy, which is the project-level policy. If `account`, the response will include all account-level policies for the developer's CDP Project. + Scope *ListPoliciesParamsScope `form:"scope,omitempty" json:"scope,omitempty"` } -// Override default JSON handling for WebhookSubscriptionResponse_Metadata to handle AdditionalProperties -func (a *WebhookSubscriptionResponse_Metadata) UnmarshalJSON(b []byte) error { - object := make(map[string]json.RawMessage) - err := json.Unmarshal(b, &object) - if err != nil { - return err - } +// ListPoliciesParamsScope defines parameters for ListPolicies. +type ListPoliciesParamsScope string - if raw, found := object["secret"]; found { - err = json.Unmarshal(raw, &a.Secret) - if err != nil { - return fmt.Errorf("error reading 'secret': %w", err) - } - delete(object, "secret") - } +// CreatePolicyJSONBody defines parameters for CreatePolicy. +type CreatePolicyJSONBody struct { + // Description An optional human-readable description for the policy. + // Policy descriptions can consist of alphanumeric characters, spaces, commas, and periods, and be 50 characters or less. + Description *string `json:"description,omitempty"` - if len(object) != 0 { - a.AdditionalProperties = make(map[string]string) - for fieldName, fieldBuf := range object { - var fieldVal string - err := json.Unmarshal(fieldBuf, &fieldVal) - if err != nil { - return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) - } - a.AdditionalProperties[fieldName] = fieldVal - } - } - return nil + // Rules A list of rules that comprise the policy. There is a limit of 10 rules per policy. + Rules []Rule `json:"rules"` + + // Scope The scope of the policy. + Scope CreatePolicyJSONBodyScope `json:"scope"` } -// Override default JSON handling for WebhookSubscriptionResponse_Metadata to handle AdditionalProperties -func (a WebhookSubscriptionResponse_Metadata) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) +// CreatePolicyParams defines parameters for CreatePolicy. +type CreatePolicyParams struct { + // XIdempotencyKey An optional string request header for making requests safely retryable. + // When included, duplicate requests with the same key will return identical responses. + // Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. + XIdempotencyKey *IdempotencyKey `json:"X-Idempotency-Key,omitempty"` +} - if a.Secret != nil { - object["secret"], err = json.Marshal(a.Secret) - if err != nil { - return nil, fmt.Errorf("error marshaling 'secret': %w", err) - } - } +// CreatePolicyJSONBodyScope defines parameters for CreatePolicy. +type CreatePolicyJSONBodyScope string - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) - if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) - } - } - return json.Marshal(object) +// DeletePolicyParams defines parameters for DeletePolicy. +type DeletePolicyParams struct { + // XIdempotencyKey An optional string request header for making requests safely retryable. + // When included, duplicate requests with the same key will return identical responses. + // Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. + XIdempotencyKey *IdempotencyKey `json:"X-Idempotency-Key,omitempty"` } -// AsAbiFunction returns the union data inside the Abi_Item as a AbiFunction -func (t Abi_Item) AsAbiFunction() (AbiFunction, error) { - var body AbiFunction - err := json.Unmarshal(t.union, &body) - return body, err +// UpdatePolicyJSONBody defines parameters for UpdatePolicy. +type UpdatePolicyJSONBody struct { + // Description An optional human-readable description for the policy. + // Policy descriptions can consist of alphanumeric characters, spaces, commas, and periods, and be 50 characters or less. + Description *string `json:"description,omitempty"` + + // Rules A list of rules that comprise the policy. There is a limit of 10 rules per policy. + Rules []Rule `json:"rules"` } -// FromAbiFunction overwrites any union data inside the Abi_Item as the provided AbiFunction -func (t *Abi_Item) FromAbiFunction(v AbiFunction) error { - b, err := json.Marshal(v) - t.union = b - return err +// UpdatePolicyParams defines parameters for UpdatePolicy. +type UpdatePolicyParams struct { + // XIdempotencyKey An optional string request header for making requests safely retryable. + // When included, duplicate requests with the same key will return identical responses. + // Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. + XIdempotencyKey *IdempotencyKey `json:"X-Idempotency-Key,omitempty"` } -// MergeAbiFunction performs a merge with any union data inside the Abi_Item, using the provided AbiFunction -func (t *Abi_Item) MergeAbiFunction(v AbiFunction) error { - b, err := json.Marshal(v) - if err != nil { - return err - } +// ListSolanaAccountsParams defines parameters for ListSolanaAccounts. +type ListSolanaAccountsParams struct { + // PageSize The number of resources to return per page. + PageSize *PageSize `form:"pageSize,omitempty" json:"pageSize,omitempty"` - merged, err := runtime.JsonMerge(t.union, b) - t.union = merged - return err + // PageToken The token for the next page of resources, if any. + PageToken *PageToken `form:"pageToken,omitempty" json:"pageToken,omitempty"` } -// AsAbiInput returns the union data inside the Abi_Item as a AbiInput -func (t Abi_Item) AsAbiInput() (AbiInput, error) { - var body AbiInput - err := json.Unmarshal(t.union, &body) - return body, err -} +// CreateSolanaAccountJSONBody defines parameters for CreateSolanaAccount. +type CreateSolanaAccountJSONBody struct { + // AccountPolicy The ID of the account-level policy to apply to the account. + AccountPolicy *string `json:"accountPolicy,omitempty"` -// FromAbiInput overwrites any union data inside the Abi_Item as the provided AbiInput -func (t *Abi_Item) FromAbiInput(v AbiInput) error { - b, err := json.Marshal(v) - t.union = b - return err + // Name An optional name for the account. + // Account names can consist of alphanumeric characters and hyphens, and be between 2 and 36 characters long. + // Account names must be unique across all Solana accounts in the developer's CDP Project. + Name *string `json:"name,omitempty"` } -// MergeAbiInput performs a merge with any union data inside the Abi_Item, using the provided AbiInput -func (t *Abi_Item) MergeAbiInput(v AbiInput) error { - b, err := json.Marshal(v) - if err != nil { - return err - } +// CreateSolanaAccountParams defines parameters for CreateSolanaAccount. +type CreateSolanaAccountParams struct { + // XWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the + // [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) + // section of our Authentication docs for more details on how to generate your Wallet Token. + XWalletAuth *XWalletAuth `json:"X-Wallet-Auth,omitempty"` - merged, err := runtime.JsonMerge(t.union, b) - t.union = merged - return err + // XIdempotencyKey An optional string request header for making requests safely retryable. + // When included, duplicate requests with the same key will return identical responses. + // Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. + XIdempotencyKey *IdempotencyKey `json:"X-Idempotency-Key,omitempty"` } -func (t Abi_Item) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err +// ExportSolanaAccountByNameJSONBody defines parameters for ExportSolanaAccountByName. +type ExportSolanaAccountByNameJSONBody struct { + // ExportEncryptionKey The base64-encoded, public part of the RSA key in DER format used to encrypt the account private key. + ExportEncryptionKey string `json:"exportEncryptionKey"` } -func (t *Abi_Item) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} +// ExportSolanaAccountByNameParams defines parameters for ExportSolanaAccountByName. +type ExportSolanaAccountByNameParams struct { + // XWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the + // [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) + // section of our Authentication docs for more details on how to generate your Wallet Token. + XWalletAuth *XWalletAuth `json:"X-Wallet-Auth,omitempty"` -// AsEmailAuthentication returns the union data inside the AuthenticationMethod as a EmailAuthentication -func (t AuthenticationMethod) AsEmailAuthentication() (EmailAuthentication, error) { - var body EmailAuthentication - err := json.Unmarshal(t.union, &body) - return body, err + // XIdempotencyKey An optional string request header for making requests safely retryable. + // When included, duplicate requests with the same key will return identical responses. + // Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. + XIdempotencyKey *IdempotencyKey `json:"X-Idempotency-Key,omitempty"` } -// FromEmailAuthentication overwrites any union data inside the AuthenticationMethod as the provided EmailAuthentication -func (t *AuthenticationMethod) FromEmailAuthentication(v EmailAuthentication) error { - b, err := json.Marshal(v) - t.union = b - return err +// ImportSolanaAccountJSONBody defines parameters for ImportSolanaAccount. +type ImportSolanaAccountJSONBody struct { + // EncryptedPrivateKey The base64-encoded, encrypted 32-byte private key of the Solana account. The private key must be encrypted using the CDP SDK's encryption scheme. + EncryptedPrivateKey string `json:"encryptedPrivateKey"` + + // Name An optional name for the account. + // Account names can consist of alphanumeric characters and hyphens, and be between 2 and 36 characters long. + // Account names must be unique across all EVM accounts in the developer's CDP Project. + Name *string `json:"name,omitempty"` } -// MergeEmailAuthentication performs a merge with any union data inside the AuthenticationMethod, using the provided EmailAuthentication -func (t *AuthenticationMethod) MergeEmailAuthentication(v EmailAuthentication) error { - b, err := json.Marshal(v) - if err != nil { - return err - } +// ImportSolanaAccountParams defines parameters for ImportSolanaAccount. +type ImportSolanaAccountParams struct { + // XWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the + // [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) + // section of our Authentication docs for more details on how to generate your Wallet Token. + XWalletAuth *XWalletAuth `json:"X-Wallet-Auth,omitempty"` - merged, err := runtime.JsonMerge(t.union, b) - t.union = merged - return err + // XIdempotencyKey An optional string request header for making requests safely retryable. + // When included, duplicate requests with the same key will return identical responses. + // Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. + XIdempotencyKey *IdempotencyKey `json:"X-Idempotency-Key,omitempty"` } -// AsSmsAuthentication returns the union data inside the AuthenticationMethod as a SmsAuthentication -func (t AuthenticationMethod) AsSmsAuthentication() (SmsAuthentication, error) { - var body SmsAuthentication - err := json.Unmarshal(t.union, &body) - return body, err -} +// SendSolanaTransactionJSONBody defines parameters for SendSolanaTransaction. +type SendSolanaTransactionJSONBody struct { + // Network The Solana network to send the transaction to. + Network SendSolanaTransactionJSONBodyNetwork `json:"network"` -// FromSmsAuthentication overwrites any union data inside the AuthenticationMethod as the provided SmsAuthentication -func (t *AuthenticationMethod) FromSmsAuthentication(v SmsAuthentication) error { - b, err := json.Marshal(v) - t.union = b - return err + // Transaction The base64 encoded transaction to sign and send. This transaction can contain multiple instructions for native Solana batching. + Transaction string `json:"transaction"` } -// MergeSmsAuthentication performs a merge with any union data inside the AuthenticationMethod, using the provided SmsAuthentication -func (t *AuthenticationMethod) MergeSmsAuthentication(v SmsAuthentication) error { - b, err := json.Marshal(v) - if err != nil { - return err - } +// SendSolanaTransactionParams defines parameters for SendSolanaTransaction. +type SendSolanaTransactionParams struct { + // XWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the + // [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) + // section of our Authentication docs for more details on how to generate your Wallet Token. + XWalletAuth *XWalletAuth `json:"X-Wallet-Auth,omitempty"` - merged, err := runtime.JsonMerge(t.union, b) - t.union = merged - return err + // XIdempotencyKey An optional string request header for making requests safely retryable. + // When included, duplicate requests with the same key will return identical responses. + // Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. + XIdempotencyKey *IdempotencyKey `json:"X-Idempotency-Key,omitempty"` } -// AsDeveloperJWTAuthentication returns the union data inside the AuthenticationMethod as a DeveloperJWTAuthentication -func (t AuthenticationMethod) AsDeveloperJWTAuthentication() (DeveloperJWTAuthentication, error) { - var body DeveloperJWTAuthentication - err := json.Unmarshal(t.union, &body) - return body, err -} +// SendSolanaTransactionJSONBodyNetwork defines parameters for SendSolanaTransaction. +type SendSolanaTransactionJSONBodyNetwork string -// FromDeveloperJWTAuthentication overwrites any union data inside the AuthenticationMethod as the provided DeveloperJWTAuthentication -func (t *AuthenticationMethod) FromDeveloperJWTAuthentication(v DeveloperJWTAuthentication) error { - b, err := json.Marshal(v) - t.union = b - return err +// UpdateSolanaAccountJSONBody defines parameters for UpdateSolanaAccount. +type UpdateSolanaAccountJSONBody struct { + // AccountPolicy The ID of the account-level policy to apply to the account, or an empty string to unset attached policy. + AccountPolicy *string `json:"accountPolicy,omitempty"` + + // Name An optional name for the account. Account names can consist of alphanumeric characters and hyphens, and be between 2 and 36 characters long. + // Account names must be unique across all Solana accounts in the developer's CDP Project. + Name *string `json:"name,omitempty"` } -// MergeDeveloperJWTAuthentication performs a merge with any union data inside the AuthenticationMethod, using the provided DeveloperJWTAuthentication -func (t *AuthenticationMethod) MergeDeveloperJWTAuthentication(v DeveloperJWTAuthentication) error { - b, err := json.Marshal(v) - if err != nil { - return err - } +// UpdateSolanaAccountParams defines parameters for UpdateSolanaAccount. +type UpdateSolanaAccountParams struct { + // XIdempotencyKey An optional string request header for making requests safely retryable. + // When included, duplicate requests with the same key will return identical responses. + // Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. + XIdempotencyKey *IdempotencyKey `json:"X-Idempotency-Key,omitempty"` +} - merged, err := runtime.JsonMerge(t.union, b) - t.union = merged - return err +// ExportSolanaAccountJSONBody defines parameters for ExportSolanaAccount. +type ExportSolanaAccountJSONBody struct { + // ExportEncryptionKey The base64-encoded, public part of the RSA key in DER format used to encrypt the account private key. + ExportEncryptionKey string `json:"exportEncryptionKey"` } -// AsOAuth2Authentication returns the union data inside the AuthenticationMethod as a OAuth2Authentication -func (t AuthenticationMethod) AsOAuth2Authentication() (OAuth2Authentication, error) { - var body OAuth2Authentication - err := json.Unmarshal(t.union, &body) - return body, err +// ExportSolanaAccountParams defines parameters for ExportSolanaAccount. +type ExportSolanaAccountParams struct { + // XWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the + // [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) + // section of our Authentication docs for more details on how to generate your Wallet Token. + XWalletAuth *XWalletAuth `json:"X-Wallet-Auth,omitempty"` + + // XIdempotencyKey An optional string request header for making requests safely retryable. + // When included, duplicate requests with the same key will return identical responses. + // Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. + XIdempotencyKey *IdempotencyKey `json:"X-Idempotency-Key,omitempty"` } -// FromOAuth2Authentication overwrites any union data inside the AuthenticationMethod as the provided OAuth2Authentication -func (t *AuthenticationMethod) FromOAuth2Authentication(v OAuth2Authentication) error { - b, err := json.Marshal(v) - t.union = b - return err +// SignSolanaMessageJSONBody defines parameters for SignSolanaMessage. +type SignSolanaMessageJSONBody struct { + // Message The arbitrary message to sign. + Message string `json:"message"` } -// MergeOAuth2Authentication performs a merge with any union data inside the AuthenticationMethod, using the provided OAuth2Authentication -func (t *AuthenticationMethod) MergeOAuth2Authentication(v OAuth2Authentication) error { - b, err := json.Marshal(v) - if err != nil { - return err - } +// SignSolanaMessageParams defines parameters for SignSolanaMessage. +type SignSolanaMessageParams struct { + // XWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the + // [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) + // section of our Authentication docs for more details on how to generate your Wallet Token. + XWalletAuth *XWalletAuth `json:"X-Wallet-Auth,omitempty"` - merged, err := runtime.JsonMerge(t.union, b) - t.union = merged - return err + // XIdempotencyKey An optional string request header for making requests safely retryable. + // When included, duplicate requests with the same key will return identical responses. + // Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. + XIdempotencyKey *IdempotencyKey `json:"X-Idempotency-Key,omitempty"` } -// AsTelegramAuthentication returns the union data inside the AuthenticationMethod as a TelegramAuthentication -func (t AuthenticationMethod) AsTelegramAuthentication() (TelegramAuthentication, error) { - var body TelegramAuthentication - err := json.Unmarshal(t.union, &body) - return body, err +// SignSolanaTransactionJSONBody defines parameters for SignSolanaTransaction. +type SignSolanaTransactionJSONBody struct { + // Transaction The base64 encoded transaction to sign. + Transaction string `json:"transaction"` } -// FromTelegramAuthentication overwrites any union data inside the AuthenticationMethod as the provided TelegramAuthentication -func (t *AuthenticationMethod) FromTelegramAuthentication(v TelegramAuthentication) error { - b, err := json.Marshal(v) - t.union = b - return err +// SignSolanaTransactionParams defines parameters for SignSolanaTransaction. +type SignSolanaTransactionParams struct { + // XWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the + // [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) + // section of our Authentication docs for more details on how to generate your Wallet Token. + XWalletAuth *XWalletAuth `json:"X-Wallet-Auth,omitempty"` + + // XIdempotencyKey An optional string request header for making requests safely retryable. + // When included, duplicate requests with the same key will return identical responses. + // Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. + XIdempotencyKey *IdempotencyKey `json:"X-Idempotency-Key,omitempty"` } -// MergeTelegramAuthentication performs a merge with any union data inside the AuthenticationMethod, using the provided TelegramAuthentication -func (t *AuthenticationMethod) MergeTelegramAuthentication(v TelegramAuthentication) error { - b, err := json.Marshal(v) - if err != nil { - return err - } +// RequestSolanaFaucetJSONBody defines parameters for RequestSolanaFaucet. +type RequestSolanaFaucetJSONBody struct { + // Address The address to request funds to, which is a base58-encoded string. + Address string `json:"address"` - merged, err := runtime.JsonMerge(t.union, b) - t.union = merged - return err + // Token The token to request funds for. + Token RequestSolanaFaucetJSONBodyToken `json:"token"` } -func (t AuthenticationMethod) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} +// RequestSolanaFaucetJSONBodyToken defines parameters for RequestSolanaFaucet. +type RequestSolanaFaucetJSONBodyToken string -func (t *AuthenticationMethod) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} +// ListSolanaTokenBalancesParams defines parameters for ListSolanaTokenBalances. +type ListSolanaTokenBalancesParams struct { + // PageSize The number of balances to return per page. + PageSize *int `form:"pageSize,omitempty" json:"pageSize,omitempty"` -// AsCreateSwapQuoteResponse returns the union data inside the CreateSwapQuoteResponseWrapper as a CreateSwapQuoteResponse -func (t CreateSwapQuoteResponseWrapper) AsCreateSwapQuoteResponse() (CreateSwapQuoteResponse, error) { - var body CreateSwapQuoteResponse - err := json.Unmarshal(t.union, &body) - return body, err + // PageToken The token for the next page of balances. Will be empty if there are no more balances to fetch. + PageToken *string `form:"pageToken,omitempty" json:"pageToken,omitempty"` } -// FromCreateSwapQuoteResponse overwrites any union data inside the CreateSwapQuoteResponseWrapper as the provided CreateSwapQuoteResponse -func (t *CreateSwapQuoteResponseWrapper) FromCreateSwapQuoteResponse(v CreateSwapQuoteResponse) error { - b, err := json.Marshal(v) - t.union = b - return err -} +// SettleX402PaymentJSONBody defines parameters for SettleX402Payment. +type SettleX402PaymentJSONBody struct { + // PaymentPayload The x402 protocol payment payload that the client attaches to x402-paid API requests to the resource server in the X-PAYMENT header. + // For EVM networks, smart account signatures can be longer than 65 bytes. + PaymentPayload X402PaymentPayload `json:"paymentPayload"` -// MergeCreateSwapQuoteResponse performs a merge with any union data inside the CreateSwapQuoteResponseWrapper, using the provided CreateSwapQuoteResponse -func (t *CreateSwapQuoteResponseWrapper) MergeCreateSwapQuoteResponse(v CreateSwapQuoteResponse) error { - b, err := json.Marshal(v) - if err != nil { - return err - } + // PaymentRequirements The x402 protocol payment requirements that the resource server expects the client's payment payload to meet. + PaymentRequirements X402PaymentRequirements `json:"paymentRequirements"` - merged, err := runtime.JsonMerge(t.union, b) - t.union = merged - return err + // X402Version The version of the x402 protocol. + X402Version X402Version `json:"x402Version"` } -// AsSwapUnavailableResponse returns the union data inside the CreateSwapQuoteResponseWrapper as a SwapUnavailableResponse -func (t CreateSwapQuoteResponseWrapper) AsSwapUnavailableResponse() (SwapUnavailableResponse, error) { - var body SwapUnavailableResponse - err := json.Unmarshal(t.union, &body) - return body, err -} +// VerifyX402PaymentJSONBody defines parameters for VerifyX402Payment. +type VerifyX402PaymentJSONBody struct { + // PaymentPayload The x402 protocol payment payload that the client attaches to x402-paid API requests to the resource server in the X-PAYMENT header. + // For EVM networks, smart account signatures can be longer than 65 bytes. + PaymentPayload X402PaymentPayload `json:"paymentPayload"` -// FromSwapUnavailableResponse overwrites any union data inside the CreateSwapQuoteResponseWrapper as the provided SwapUnavailableResponse -func (t *CreateSwapQuoteResponseWrapper) FromSwapUnavailableResponse(v SwapUnavailableResponse) error { - b, err := json.Marshal(v) - t.union = b - return err + // PaymentRequirements The x402 protocol payment requirements that the resource server expects the client's payment payload to meet. + PaymentRequirements X402PaymentRequirements `json:"paymentRequirements"` + + // X402Version The version of the x402 protocol. + X402Version X402Version `json:"x402Version"` } -// MergeSwapUnavailableResponse performs a merge with any union data inside the CreateSwapQuoteResponseWrapper, using the provided SwapUnavailableResponse -func (t *CreateSwapQuoteResponseWrapper) MergeSwapUnavailableResponse(v SwapUnavailableResponse) error { - b, err := json.Marshal(v) - if err != nil { - return err - } +// RunSQLQueryJSONRequestBody defines body for RunSQLQuery for application/json ContentType. +type RunSQLQueryJSONRequestBody = OnchainDataQuery - merged, err := runtime.JsonMerge(t.union, b) - t.union = merged - return err -} +// CreateWebhookSubscriptionJSONRequestBody defines body for CreateWebhookSubscription for application/json ContentType. +type CreateWebhookSubscriptionJSONRequestBody = WebhookSubscriptionRequest -func (t CreateSwapQuoteResponseWrapper) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} +// UpdateWebhookSubscriptionJSONRequestBody defines body for UpdateWebhookSubscription for application/json ContentType. +type UpdateWebhookSubscriptionJSONRequestBody = WebhookSubscriptionUpdateRequest -func (t *CreateSwapQuoteResponseWrapper) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} +// RevokeDelegationForEndUserJSONRequestBody defines body for RevokeDelegationForEndUser for application/json ContentType. +type RevokeDelegationForEndUserJSONRequestBody RevokeDelegationForEndUserJSONBody -// AsEvmDataParameterCondition returns the union data inside the EvmDataCondition_Params_Item as a EvmDataParameterCondition -func (t EvmDataCondition_Params_Item) AsEvmDataParameterCondition() (EvmDataParameterCondition, error) { - var body EvmDataParameterCondition - err := json.Unmarshal(t.union, &body) - return body, err -} +// CreateEvmEip7702DelegationWithEndUserAccountJSONRequestBody defines body for CreateEvmEip7702DelegationWithEndUserAccount for application/json ContentType. +type CreateEvmEip7702DelegationWithEndUserAccountJSONRequestBody CreateEvmEip7702DelegationWithEndUserAccountJSONBody -// FromEvmDataParameterCondition overwrites any union data inside the EvmDataCondition_Params_Item as the provided EvmDataParameterCondition -func (t *EvmDataCondition_Params_Item) FromEvmDataParameterCondition(v EvmDataParameterCondition) error { - b, err := json.Marshal(v) - t.union = b - return err -} +// SendEvmTransactionWithEndUserAccountJSONRequestBody defines body for SendEvmTransactionWithEndUserAccount for application/json ContentType. +type SendEvmTransactionWithEndUserAccountJSONRequestBody SendEvmTransactionWithEndUserAccountJSONBody -// MergeEvmDataParameterCondition performs a merge with any union data inside the EvmDataCondition_Params_Item, using the provided EvmDataParameterCondition -func (t *EvmDataCondition_Params_Item) MergeEvmDataParameterCondition(v EvmDataParameterCondition) error { - b, err := json.Marshal(v) - if err != nil { - return err - } +// SignEvmHashWithEndUserAccountJSONRequestBody defines body for SignEvmHashWithEndUserAccount for application/json ContentType. +type SignEvmHashWithEndUserAccountJSONRequestBody SignEvmHashWithEndUserAccountJSONBody - merged, err := runtime.JsonMerge(t.union, b) - t.union = merged - return err -} +// SignEvmMessageWithEndUserAccountJSONRequestBody defines body for SignEvmMessageWithEndUserAccount for application/json ContentType. +type SignEvmMessageWithEndUserAccountJSONRequestBody SignEvmMessageWithEndUserAccountJSONBody -// AsEvmDataParameterConditionList returns the union data inside the EvmDataCondition_Params_Item as a EvmDataParameterConditionList -func (t EvmDataCondition_Params_Item) AsEvmDataParameterConditionList() (EvmDataParameterConditionList, error) { - var body EvmDataParameterConditionList - err := json.Unmarshal(t.union, &body) - return body, err -} +// SignEvmTransactionWithEndUserAccountJSONRequestBody defines body for SignEvmTransactionWithEndUserAccount for application/json ContentType. +type SignEvmTransactionWithEndUserAccountJSONRequestBody SignEvmTransactionWithEndUserAccountJSONBody -// FromEvmDataParameterConditionList overwrites any union data inside the EvmDataCondition_Params_Item as the provided EvmDataParameterConditionList -func (t *EvmDataCondition_Params_Item) FromEvmDataParameterConditionList(v EvmDataParameterConditionList) error { - b, err := json.Marshal(v) - t.union = b - return err -} +// SignEvmTypedDataWithEndUserAccountJSONRequestBody defines body for SignEvmTypedDataWithEndUserAccount for application/json ContentType. +type SignEvmTypedDataWithEndUserAccountJSONRequestBody SignEvmTypedDataWithEndUserAccountJSONBody -// MergeEvmDataParameterConditionList performs a merge with any union data inside the EvmDataCondition_Params_Item, using the provided EvmDataParameterConditionList -func (t *EvmDataCondition_Params_Item) MergeEvmDataParameterConditionList(v EvmDataParameterConditionList) error { - b, err := json.Marshal(v) - if err != nil { - return err - } +// SendUserOperationWithEndUserAccountJSONRequestBody defines body for SendUserOperationWithEndUserAccount for application/json ContentType. +type SendUserOperationWithEndUserAccountJSONRequestBody SendUserOperationWithEndUserAccountJSONBody - merged, err := runtime.JsonMerge(t.union, b) - t.union = merged - return err -} +// RevokeSpendPermissionWithEndUserAccountJSONRequestBody defines body for RevokeSpendPermissionWithEndUserAccount for application/json ContentType. +type RevokeSpendPermissionWithEndUserAccountJSONRequestBody = RevokeSpendPermissionRequest -func (t EvmDataCondition_Params_Item) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} +// SendEvmAssetWithEndUserAccountJSONRequestBody defines body for SendEvmAssetWithEndUserAccount for application/json ContentType. +type SendEvmAssetWithEndUserAccountJSONRequestBody SendEvmAssetWithEndUserAccountJSONBody -func (t *EvmDataCondition_Params_Item) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} +// SendSolanaTransactionWithEndUserAccountJSONRequestBody defines body for SendSolanaTransactionWithEndUserAccount for application/json ContentType. +type SendSolanaTransactionWithEndUserAccountJSONRequestBody SendSolanaTransactionWithEndUserAccountJSONBody -// AsKnownAbiType returns the union data inside the EvmDataCriterion_Abi as a KnownAbiType -func (t EvmDataCriterion_Abi) AsKnownAbiType() (KnownAbiType, error) { - var body KnownAbiType - err := json.Unmarshal(t.union, &body) - return body, err -} +// SignSolanaHashWithEndUserAccountJSONRequestBody defines body for SignSolanaHashWithEndUserAccount for application/json ContentType. +type SignSolanaHashWithEndUserAccountJSONRequestBody SignSolanaHashWithEndUserAccountJSONBody -// FromKnownAbiType overwrites any union data inside the EvmDataCriterion_Abi as the provided KnownAbiType -func (t *EvmDataCriterion_Abi) FromKnownAbiType(v KnownAbiType) error { - b, err := json.Marshal(v) - t.union = b - return err -} +// SignSolanaMessageWithEndUserAccountJSONRequestBody defines body for SignSolanaMessageWithEndUserAccount for application/json ContentType. +type SignSolanaMessageWithEndUserAccountJSONRequestBody SignSolanaMessageWithEndUserAccountJSONBody -// MergeKnownAbiType performs a merge with any union data inside the EvmDataCriterion_Abi, using the provided KnownAbiType -func (t *EvmDataCriterion_Abi) MergeKnownAbiType(v KnownAbiType) error { - b, err := json.Marshal(v) - if err != nil { - return err - } +// SignSolanaTransactionWithEndUserAccountJSONRequestBody defines body for SignSolanaTransactionWithEndUserAccount for application/json ContentType. +type SignSolanaTransactionWithEndUserAccountJSONRequestBody SignSolanaTransactionWithEndUserAccountJSONBody - merged, err := runtime.JsonMerge(t.union, b) - t.union = merged - return err -} +// SendSolanaAssetWithEndUserAccountJSONRequestBody defines body for SendSolanaAssetWithEndUserAccount for application/json ContentType. +type SendSolanaAssetWithEndUserAccountJSONRequestBody SendSolanaAssetWithEndUserAccountJSONBody -// AsAbi returns the union data inside the EvmDataCriterion_Abi as a Abi -func (t EvmDataCriterion_Abi) AsAbi() (Abi, error) { - var body Abi - err := json.Unmarshal(t.union, &body) - return body, err -} +// CreateEndUserJSONRequestBody defines body for CreateEndUser for application/json ContentType. +type CreateEndUserJSONRequestBody CreateEndUserJSONBody -// FromAbi overwrites any union data inside the EvmDataCriterion_Abi as the provided Abi -func (t *EvmDataCriterion_Abi) FromAbi(v Abi) error { - b, err := json.Marshal(v) - t.union = b - return err +// ValidateEndUserAccessTokenJSONRequestBody defines body for ValidateEndUserAccessToken for application/json ContentType. +type ValidateEndUserAccessTokenJSONRequestBody ValidateEndUserAccessTokenJSONBody + +// ImportEndUserJSONRequestBody defines body for ImportEndUser for application/json ContentType. +type ImportEndUserJSONRequestBody ImportEndUserJSONBody + +// AddEndUserEvmAccountJSONRequestBody defines body for AddEndUserEvmAccount for application/json ContentType. +type AddEndUserEvmAccountJSONRequestBody = AddEndUserEvmAccountJSONBody + +// AddEndUserEvmSmartAccountJSONRequestBody defines body for AddEndUserEvmSmartAccount for application/json ContentType. +type AddEndUserEvmSmartAccountJSONRequestBody AddEndUserEvmSmartAccountJSONBody + +// AddEndUserSolanaAccountJSONRequestBody defines body for AddEndUserSolanaAccount for application/json ContentType. +type AddEndUserSolanaAccountJSONRequestBody = AddEndUserSolanaAccountJSONBody + +// CreateEvmAccountJSONRequestBody defines body for CreateEvmAccount for application/json ContentType. +type CreateEvmAccountJSONRequestBody CreateEvmAccountJSONBody + +// ExportEvmAccountByNameJSONRequestBody defines body for ExportEvmAccountByName for application/json ContentType. +type ExportEvmAccountByNameJSONRequestBody ExportEvmAccountByNameJSONBody + +// ImportEvmAccountJSONRequestBody defines body for ImportEvmAccount for application/json ContentType. +type ImportEvmAccountJSONRequestBody ImportEvmAccountJSONBody + +// UpdateEvmAccountJSONRequestBody defines body for UpdateEvmAccount for application/json ContentType. +type UpdateEvmAccountJSONRequestBody UpdateEvmAccountJSONBody + +// CreateEvmEip7702DelegationJSONRequestBody defines body for CreateEvmEip7702Delegation for application/json ContentType. +type CreateEvmEip7702DelegationJSONRequestBody CreateEvmEip7702DelegationJSONBody + +// ExportEvmAccountJSONRequestBody defines body for ExportEvmAccount for application/json ContentType. +type ExportEvmAccountJSONRequestBody ExportEvmAccountJSONBody + +// SendEvmTransactionJSONRequestBody defines body for SendEvmTransaction for application/json ContentType. +type SendEvmTransactionJSONRequestBody SendEvmTransactionJSONBody + +// SignEvmHashJSONRequestBody defines body for SignEvmHash for application/json ContentType. +type SignEvmHashJSONRequestBody SignEvmHashJSONBody + +// SignEvmMessageJSONRequestBody defines body for SignEvmMessage for application/json ContentType. +type SignEvmMessageJSONRequestBody SignEvmMessageJSONBody + +// SignEvmTransactionJSONRequestBody defines body for SignEvmTransaction for application/json ContentType. +type SignEvmTransactionJSONRequestBody SignEvmTransactionJSONBody + +// SignEvmTypedDataJSONRequestBody defines body for SignEvmTypedData for application/json ContentType. +type SignEvmTypedDataJSONRequestBody = EIP712Message + +// RequestEvmFaucetJSONRequestBody defines body for RequestEvmFaucet for application/json ContentType. +type RequestEvmFaucetJSONRequestBody RequestEvmFaucetJSONBody + +// CreateEvmSmartAccountJSONRequestBody defines body for CreateEvmSmartAccount for application/json ContentType. +type CreateEvmSmartAccountJSONRequestBody CreateEvmSmartAccountJSONBody + +// UpdateEvmSmartAccountJSONRequestBody defines body for UpdateEvmSmartAccount for application/json ContentType. +type UpdateEvmSmartAccountJSONRequestBody UpdateEvmSmartAccountJSONBody + +// CreateSpendPermissionJSONRequestBody defines body for CreateSpendPermission for application/json ContentType. +type CreateSpendPermissionJSONRequestBody = CreateSpendPermissionRequest + +// RevokeSpendPermissionJSONRequestBody defines body for RevokeSpendPermission for application/json ContentType. +type RevokeSpendPermissionJSONRequestBody = EvmSpendPermissionsRevokeSpendPermissionRequest + +// PrepareUserOperationJSONRequestBody defines body for PrepareUserOperation for application/json ContentType. +type PrepareUserOperationJSONRequestBody PrepareUserOperationJSONBody + +// PrepareAndSendUserOperationJSONRequestBody defines body for PrepareAndSendUserOperation for application/json ContentType. +type PrepareAndSendUserOperationJSONRequestBody PrepareAndSendUserOperationJSONBody + +// SendUserOperationJSONRequestBody defines body for SendUserOperation for application/json ContentType. +type SendUserOperationJSONRequestBody SendUserOperationJSONBody + +// CreateEvmSwapQuoteJSONRequestBody defines body for CreateEvmSwapQuote for application/json ContentType. +type CreateEvmSwapQuoteJSONRequestBody CreateEvmSwapQuoteJSONBody + +// GetOnrampUserLimitsJSONRequestBody defines body for GetOnrampUserLimits for application/json ContentType. +type GetOnrampUserLimitsJSONRequestBody GetOnrampUserLimitsJSONBody + +// CreateOnrampOrderJSONRequestBody defines body for CreateOnrampOrder for application/json ContentType. +type CreateOnrampOrderJSONRequestBody CreateOnrampOrderJSONBody + +// CreateOnrampSessionJSONRequestBody defines body for CreateOnrampSession for application/json ContentType. +type CreateOnrampSessionJSONRequestBody CreateOnrampSessionJSONBody + +// CreatePolicyJSONRequestBody defines body for CreatePolicy for application/json ContentType. +type CreatePolicyJSONRequestBody CreatePolicyJSONBody + +// UpdatePolicyJSONRequestBody defines body for UpdatePolicy for application/json ContentType. +type UpdatePolicyJSONRequestBody UpdatePolicyJSONBody + +// CreateSolanaAccountJSONRequestBody defines body for CreateSolanaAccount for application/json ContentType. +type CreateSolanaAccountJSONRequestBody CreateSolanaAccountJSONBody + +// ExportSolanaAccountByNameJSONRequestBody defines body for ExportSolanaAccountByName for application/json ContentType. +type ExportSolanaAccountByNameJSONRequestBody ExportSolanaAccountByNameJSONBody + +// ImportSolanaAccountJSONRequestBody defines body for ImportSolanaAccount for application/json ContentType. +type ImportSolanaAccountJSONRequestBody ImportSolanaAccountJSONBody + +// SendSolanaTransactionJSONRequestBody defines body for SendSolanaTransaction for application/json ContentType. +type SendSolanaTransactionJSONRequestBody SendSolanaTransactionJSONBody + +// UpdateSolanaAccountJSONRequestBody defines body for UpdateSolanaAccount for application/json ContentType. +type UpdateSolanaAccountJSONRequestBody UpdateSolanaAccountJSONBody + +// ExportSolanaAccountJSONRequestBody defines body for ExportSolanaAccount for application/json ContentType. +type ExportSolanaAccountJSONRequestBody ExportSolanaAccountJSONBody + +// SignSolanaMessageJSONRequestBody defines body for SignSolanaMessage for application/json ContentType. +type SignSolanaMessageJSONRequestBody SignSolanaMessageJSONBody + +// SignSolanaTransactionJSONRequestBody defines body for SignSolanaTransaction for application/json ContentType. +type SignSolanaTransactionJSONRequestBody SignSolanaTransactionJSONBody + +// RequestSolanaFaucetJSONRequestBody defines body for RequestSolanaFaucet for application/json ContentType. +type RequestSolanaFaucetJSONRequestBody RequestSolanaFaucetJSONBody + +// SettleX402PaymentJSONRequestBody defines body for SettleX402Payment for application/json ContentType. +type SettleX402PaymentJSONRequestBody SettleX402PaymentJSONBody + +// VerifyX402PaymentJSONRequestBody defines body for VerifyX402Payment for application/json ContentType. +type VerifyX402PaymentJSONRequestBody VerifyX402PaymentJSONBody + +// Getter for additional properties for WebhookSubscriptionResponse_Metadata. Returns the specified +// element and whether it was found +func (a WebhookSubscriptionResponse_Metadata) Get(fieldName string) (value string, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return } -// MergeAbi performs a merge with any union data inside the EvmDataCriterion_Abi, using the provided Abi -func (t *EvmDataCriterion_Abi) MergeAbi(v Abi) error { - b, err := json.Marshal(v) +// Setter for additional properties for WebhookSubscriptionResponse_Metadata +func (a *WebhookSubscriptionResponse_Metadata) Set(fieldName string, value string) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]string) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for WebhookSubscriptionResponse_Metadata to handle AdditionalProperties +func (a *WebhookSubscriptionResponse_Metadata) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) if err != nil { return err } - merged, err := runtime.JsonMerge(t.union, b) - t.union = merged - return err -} + if raw, found := object["secret"]; found { + err = json.Unmarshal(raw, &a.Secret) + if err != nil { + return fmt.Errorf("error reading 'secret': %w", err) + } + delete(object, "secret") + } -func (t EvmDataCriterion_Abi) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err + if len(object) != 0 { + a.AdditionalProperties = make(map[string]string) + for fieldName, fieldBuf := range object { + var fieldVal string + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil } -func (t *EvmDataCriterion_Abi) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err +// Override default JSON handling for WebhookSubscriptionResponse_Metadata to handle AdditionalProperties +func (a WebhookSubscriptionResponse_Metadata) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + if a.Secret != nil { + object["secret"], err = json.Marshal(a.Secret) + if err != nil { + return nil, fmt.Errorf("error marshaling 'secret': %w", err) + } + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) } -// AsGetSwapPriceResponse returns the union data inside the GetSwapPriceResponseWrapper as a GetSwapPriceResponse -func (t GetSwapPriceResponseWrapper) AsGetSwapPriceResponse() (GetSwapPriceResponse, error) { - var body GetSwapPriceResponse +// AsAbiFunction returns the union data inside the Abi_Item as a AbiFunction +func (t Abi_Item) AsAbiFunction() (AbiFunction, error) { + var body AbiFunction err := json.Unmarshal(t.union, &body) return body, err } -// FromGetSwapPriceResponse overwrites any union data inside the GetSwapPriceResponseWrapper as the provided GetSwapPriceResponse -func (t *GetSwapPriceResponseWrapper) FromGetSwapPriceResponse(v GetSwapPriceResponse) error { +// FromAbiFunction overwrites any union data inside the Abi_Item as the provided AbiFunction +func (t *Abi_Item) FromAbiFunction(v AbiFunction) error { b, err := json.Marshal(v) t.union = b return err } -// MergeGetSwapPriceResponse performs a merge with any union data inside the GetSwapPriceResponseWrapper, using the provided GetSwapPriceResponse -func (t *GetSwapPriceResponseWrapper) MergeGetSwapPriceResponse(v GetSwapPriceResponse) error { +// MergeAbiFunction performs a merge with any union data inside the Abi_Item, using the provided AbiFunction +func (t *Abi_Item) MergeAbiFunction(v AbiFunction) error { b, err := json.Marshal(v) if err != nil { return err @@ -5238,22 +5445,22 @@ func (t *GetSwapPriceResponseWrapper) MergeGetSwapPriceResponse(v GetSwapPriceRe return err } -// AsSwapUnavailableResponse returns the union data inside the GetSwapPriceResponseWrapper as a SwapUnavailableResponse -func (t GetSwapPriceResponseWrapper) AsSwapUnavailableResponse() (SwapUnavailableResponse, error) { - var body SwapUnavailableResponse +// AsAbiInput returns the union data inside the Abi_Item as a AbiInput +func (t Abi_Item) AsAbiInput() (AbiInput, error) { + var body AbiInput err := json.Unmarshal(t.union, &body) return body, err } -// FromSwapUnavailableResponse overwrites any union data inside the GetSwapPriceResponseWrapper as the provided SwapUnavailableResponse -func (t *GetSwapPriceResponseWrapper) FromSwapUnavailableResponse(v SwapUnavailableResponse) error { +// FromAbiInput overwrites any union data inside the Abi_Item as the provided AbiInput +func (t *Abi_Item) FromAbiInput(v AbiInput) error { b, err := json.Marshal(v) t.union = b return err } -// MergeSwapUnavailableResponse performs a merge with any union data inside the GetSwapPriceResponseWrapper, using the provided SwapUnavailableResponse -func (t *GetSwapPriceResponseWrapper) MergeSwapUnavailableResponse(v SwapUnavailableResponse) error { +// MergeAbiInput performs a merge with any union data inside the Abi_Item, using the provided AbiInput +func (t *Abi_Item) MergeAbiInput(v AbiInput) error { b, err := json.Marshal(v) if err != nil { return err @@ -5264,32 +5471,32 @@ func (t *GetSwapPriceResponseWrapper) MergeSwapUnavailableResponse(v SwapUnavail return err } -func (t GetSwapPriceResponseWrapper) MarshalJSON() ([]byte, error) { +func (t Abi_Item) MarshalJSON() ([]byte, error) { b, err := t.union.MarshalJSON() return b, err } -func (t *GetSwapPriceResponseWrapper) UnmarshalJSON(b []byte) error { +func (t *Abi_Item) UnmarshalJSON(b []byte) error { err := t.union.UnmarshalJSON(b) return err } -// AsEthValueCriterion returns the union data inside the PrepareUserOperationCriteria_Item as a EthValueCriterion -func (t PrepareUserOperationCriteria_Item) AsEthValueCriterion() (EthValueCriterion, error) { - var body EthValueCriterion +// AsEmailAuthentication returns the union data inside the AuthenticationMethod as a EmailAuthentication +func (t AuthenticationMethod) AsEmailAuthentication() (EmailAuthentication, error) { + var body EmailAuthentication err := json.Unmarshal(t.union, &body) return body, err } -// FromEthValueCriterion overwrites any union data inside the PrepareUserOperationCriteria_Item as the provided EthValueCriterion -func (t *PrepareUserOperationCriteria_Item) FromEthValueCriterion(v EthValueCriterion) error { +// FromEmailAuthentication overwrites any union data inside the AuthenticationMethod as the provided EmailAuthentication +func (t *AuthenticationMethod) FromEmailAuthentication(v EmailAuthentication) error { b, err := json.Marshal(v) t.union = b return err } -// MergeEthValueCriterion performs a merge with any union data inside the PrepareUserOperationCriteria_Item, using the provided EthValueCriterion -func (t *PrepareUserOperationCriteria_Item) MergeEthValueCriterion(v EthValueCriterion) error { +// MergeEmailAuthentication performs a merge with any union data inside the AuthenticationMethod, using the provided EmailAuthentication +func (t *AuthenticationMethod) MergeEmailAuthentication(v EmailAuthentication) error { b, err := json.Marshal(v) if err != nil { return err @@ -5300,23 +5507,23 @@ func (t *PrepareUserOperationCriteria_Item) MergeEthValueCriterion(v EthValueCri return err } -// AsEvmAddressCriterion returns the union data inside the PrepareUserOperationCriteria_Item as a EvmAddressCriterion -func (t PrepareUserOperationCriteria_Item) AsEvmAddressCriterion() (EvmAddressCriterion, error) { - var body EvmAddressCriterion +// AsSmsAuthentication returns the union data inside the AuthenticationMethod as a SmsAuthentication +func (t AuthenticationMethod) AsSmsAuthentication() (SmsAuthentication, error) { + var body SmsAuthentication err := json.Unmarshal(t.union, &body) return body, err } -// FromEvmAddressCriterion overwrites any union data inside the PrepareUserOperationCriteria_Item as the provided EvmAddressCriterion -func (t *PrepareUserOperationCriteria_Item) FromEvmAddressCriterion(v EvmAddressCriterion) error { +// FromSmsAuthentication overwrites any union data inside the AuthenticationMethod as the provided SmsAuthentication +func (t *AuthenticationMethod) FromSmsAuthentication(v SmsAuthentication) error { b, err := json.Marshal(v) t.union = b return err } -// MergeEvmAddressCriterion performs a merge with any union data inside the PrepareUserOperationCriteria_Item, using the provided EvmAddressCriterion -func (t *PrepareUserOperationCriteria_Item) MergeEvmAddressCriterion(v EvmAddressCriterion) error { - b, err := json.Marshal(v) +// MergeSmsAuthentication performs a merge with any union data inside the AuthenticationMethod, using the provided SmsAuthentication +func (t *AuthenticationMethod) MergeSmsAuthentication(v SmsAuthentication) error { + b, err := json.Marshal(v) if err != nil { return err } @@ -5326,22 +5533,22 @@ func (t *PrepareUserOperationCriteria_Item) MergeEvmAddressCriterion(v EvmAddres return err } -// AsEvmNetworkCriterion returns the union data inside the PrepareUserOperationCriteria_Item as a EvmNetworkCriterion -func (t PrepareUserOperationCriteria_Item) AsEvmNetworkCriterion() (EvmNetworkCriterion, error) { - var body EvmNetworkCriterion +// AsDeveloperJWTAuthentication returns the union data inside the AuthenticationMethod as a DeveloperJWTAuthentication +func (t AuthenticationMethod) AsDeveloperJWTAuthentication() (DeveloperJWTAuthentication, error) { + var body DeveloperJWTAuthentication err := json.Unmarshal(t.union, &body) return body, err } -// FromEvmNetworkCriterion overwrites any union data inside the PrepareUserOperationCriteria_Item as the provided EvmNetworkCriterion -func (t *PrepareUserOperationCriteria_Item) FromEvmNetworkCriterion(v EvmNetworkCriterion) error { +// FromDeveloperJWTAuthentication overwrites any union data inside the AuthenticationMethod as the provided DeveloperJWTAuthentication +func (t *AuthenticationMethod) FromDeveloperJWTAuthentication(v DeveloperJWTAuthentication) error { b, err := json.Marshal(v) t.union = b return err } -// MergeEvmNetworkCriterion performs a merge with any union data inside the PrepareUserOperationCriteria_Item, using the provided EvmNetworkCriterion -func (t *PrepareUserOperationCriteria_Item) MergeEvmNetworkCriterion(v EvmNetworkCriterion) error { +// MergeDeveloperJWTAuthentication performs a merge with any union data inside the AuthenticationMethod, using the provided DeveloperJWTAuthentication +func (t *AuthenticationMethod) MergeDeveloperJWTAuthentication(v DeveloperJWTAuthentication) error { b, err := json.Marshal(v) if err != nil { return err @@ -5352,22 +5559,22 @@ func (t *PrepareUserOperationCriteria_Item) MergeEvmNetworkCriterion(v EvmNetwor return err } -// AsEvmDataCriterion returns the union data inside the PrepareUserOperationCriteria_Item as a EvmDataCriterion -func (t PrepareUserOperationCriteria_Item) AsEvmDataCriterion() (EvmDataCriterion, error) { - var body EvmDataCriterion +// AsOAuth2Authentication returns the union data inside the AuthenticationMethod as a OAuth2Authentication +func (t AuthenticationMethod) AsOAuth2Authentication() (OAuth2Authentication, error) { + var body OAuth2Authentication err := json.Unmarshal(t.union, &body) return body, err } -// FromEvmDataCriterion overwrites any union data inside the PrepareUserOperationCriteria_Item as the provided EvmDataCriterion -func (t *PrepareUserOperationCriteria_Item) FromEvmDataCriterion(v EvmDataCriterion) error { +// FromOAuth2Authentication overwrites any union data inside the AuthenticationMethod as the provided OAuth2Authentication +func (t *AuthenticationMethod) FromOAuth2Authentication(v OAuth2Authentication) error { b, err := json.Marshal(v) t.union = b return err } -// MergeEvmDataCriterion performs a merge with any union data inside the PrepareUserOperationCriteria_Item, using the provided EvmDataCriterion -func (t *PrepareUserOperationCriteria_Item) MergeEvmDataCriterion(v EvmDataCriterion) error { +// MergeOAuth2Authentication performs a merge with any union data inside the AuthenticationMethod, using the provided OAuth2Authentication +func (t *AuthenticationMethod) MergeOAuth2Authentication(v OAuth2Authentication) error { b, err := json.Marshal(v) if err != nil { return err @@ -5378,22 +5585,22 @@ func (t *PrepareUserOperationCriteria_Item) MergeEvmDataCriterion(v EvmDataCrite return err } -// AsNetUSDChangeCriterion returns the union data inside the PrepareUserOperationCriteria_Item as a NetUSDChangeCriterion -func (t PrepareUserOperationCriteria_Item) AsNetUSDChangeCriterion() (NetUSDChangeCriterion, error) { - var body NetUSDChangeCriterion +// AsTelegramAuthentication returns the union data inside the AuthenticationMethod as a TelegramAuthentication +func (t AuthenticationMethod) AsTelegramAuthentication() (TelegramAuthentication, error) { + var body TelegramAuthentication err := json.Unmarshal(t.union, &body) return body, err } -// FromNetUSDChangeCriterion overwrites any union data inside the PrepareUserOperationCriteria_Item as the provided NetUSDChangeCriterion -func (t *PrepareUserOperationCriteria_Item) FromNetUSDChangeCriterion(v NetUSDChangeCriterion) error { +// FromTelegramAuthentication overwrites any union data inside the AuthenticationMethod as the provided TelegramAuthentication +func (t *AuthenticationMethod) FromTelegramAuthentication(v TelegramAuthentication) error { b, err := json.Marshal(v) t.union = b return err } -// MergeNetUSDChangeCriterion performs a merge with any union data inside the PrepareUserOperationCriteria_Item, using the provided NetUSDChangeCriterion -func (t *PrepareUserOperationCriteria_Item) MergeNetUSDChangeCriterion(v NetUSDChangeCriterion) error { +// MergeTelegramAuthentication performs a merge with any union data inside the AuthenticationMethod, using the provided TelegramAuthentication +func (t *AuthenticationMethod) MergeTelegramAuthentication(v TelegramAuthentication) error { b, err := json.Marshal(v) if err != nil { return err @@ -5404,32 +5611,32 @@ func (t *PrepareUserOperationCriteria_Item) MergeNetUSDChangeCriterion(v NetUSDC return err } -func (t PrepareUserOperationCriteria_Item) MarshalJSON() ([]byte, error) { +func (t AuthenticationMethod) MarshalJSON() ([]byte, error) { b, err := t.union.MarshalJSON() return b, err } -func (t *PrepareUserOperationCriteria_Item) UnmarshalJSON(b []byte) error { +func (t *AuthenticationMethod) UnmarshalJSON(b []byte) error { err := t.union.UnmarshalJSON(b) return err } -// AsSignEvmTransactionRule returns the union data inside the Rule as a SignEvmTransactionRule -func (t Rule) AsSignEvmTransactionRule() (SignEvmTransactionRule, error) { - var body SignEvmTransactionRule +// AsCreateSwapQuoteResponse returns the union data inside the CreateSwapQuoteResponseWrapper as a CreateSwapQuoteResponse +func (t CreateSwapQuoteResponseWrapper) AsCreateSwapQuoteResponse() (CreateSwapQuoteResponse, error) { + var body CreateSwapQuoteResponse err := json.Unmarshal(t.union, &body) return body, err } -// FromSignEvmTransactionRule overwrites any union data inside the Rule as the provided SignEvmTransactionRule -func (t *Rule) FromSignEvmTransactionRule(v SignEvmTransactionRule) error { +// FromCreateSwapQuoteResponse overwrites any union data inside the CreateSwapQuoteResponseWrapper as the provided CreateSwapQuoteResponse +func (t *CreateSwapQuoteResponseWrapper) FromCreateSwapQuoteResponse(v CreateSwapQuoteResponse) error { b, err := json.Marshal(v) t.union = b return err } -// MergeSignEvmTransactionRule performs a merge with any union data inside the Rule, using the provided SignEvmTransactionRule -func (t *Rule) MergeSignEvmTransactionRule(v SignEvmTransactionRule) error { +// MergeCreateSwapQuoteResponse performs a merge with any union data inside the CreateSwapQuoteResponseWrapper, using the provided CreateSwapQuoteResponse +func (t *CreateSwapQuoteResponseWrapper) MergeCreateSwapQuoteResponse(v CreateSwapQuoteResponse) error { b, err := json.Marshal(v) if err != nil { return err @@ -5440,22 +5647,22 @@ func (t *Rule) MergeSignEvmTransactionRule(v SignEvmTransactionRule) error { return err } -// AsSendEvmTransactionRule returns the union data inside the Rule as a SendEvmTransactionRule -func (t Rule) AsSendEvmTransactionRule() (SendEvmTransactionRule, error) { - var body SendEvmTransactionRule +// AsSwapUnavailableResponse returns the union data inside the CreateSwapQuoteResponseWrapper as a SwapUnavailableResponse +func (t CreateSwapQuoteResponseWrapper) AsSwapUnavailableResponse() (SwapUnavailableResponse, error) { + var body SwapUnavailableResponse err := json.Unmarshal(t.union, &body) return body, err } -// FromSendEvmTransactionRule overwrites any union data inside the Rule as the provided SendEvmTransactionRule -func (t *Rule) FromSendEvmTransactionRule(v SendEvmTransactionRule) error { +// FromSwapUnavailableResponse overwrites any union data inside the CreateSwapQuoteResponseWrapper as the provided SwapUnavailableResponse +func (t *CreateSwapQuoteResponseWrapper) FromSwapUnavailableResponse(v SwapUnavailableResponse) error { b, err := json.Marshal(v) t.union = b return err } -// MergeSendEvmTransactionRule performs a merge with any union data inside the Rule, using the provided SendEvmTransactionRule -func (t *Rule) MergeSendEvmTransactionRule(v SendEvmTransactionRule) error { +// MergeSwapUnavailableResponse performs a merge with any union data inside the CreateSwapQuoteResponseWrapper, using the provided SwapUnavailableResponse +func (t *CreateSwapQuoteResponseWrapper) MergeSwapUnavailableResponse(v SwapUnavailableResponse) error { b, err := json.Marshal(v) if err != nil { return err @@ -5466,22 +5673,32 @@ func (t *Rule) MergeSendEvmTransactionRule(v SendEvmTransactionRule) error { return err } -// AsSignEvmMessageRule returns the union data inside the Rule as a SignEvmMessageRule -func (t Rule) AsSignEvmMessageRule() (SignEvmMessageRule, error) { - var body SignEvmMessageRule +func (t CreateSwapQuoteResponseWrapper) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *CreateSwapQuoteResponseWrapper) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsEvmDataParameterCondition returns the union data inside the EvmDataCondition_Params_Item as a EvmDataParameterCondition +func (t EvmDataCondition_Params_Item) AsEvmDataParameterCondition() (EvmDataParameterCondition, error) { + var body EvmDataParameterCondition err := json.Unmarshal(t.union, &body) return body, err } -// FromSignEvmMessageRule overwrites any union data inside the Rule as the provided SignEvmMessageRule -func (t *Rule) FromSignEvmMessageRule(v SignEvmMessageRule) error { +// FromEvmDataParameterCondition overwrites any union data inside the EvmDataCondition_Params_Item as the provided EvmDataParameterCondition +func (t *EvmDataCondition_Params_Item) FromEvmDataParameterCondition(v EvmDataParameterCondition) error { b, err := json.Marshal(v) t.union = b return err } -// MergeSignEvmMessageRule performs a merge with any union data inside the Rule, using the provided SignEvmMessageRule -func (t *Rule) MergeSignEvmMessageRule(v SignEvmMessageRule) error { +// MergeEvmDataParameterCondition performs a merge with any union data inside the EvmDataCondition_Params_Item, using the provided EvmDataParameterCondition +func (t *EvmDataCondition_Params_Item) MergeEvmDataParameterCondition(v EvmDataParameterCondition) error { b, err := json.Marshal(v) if err != nil { return err @@ -5492,22 +5709,22 @@ func (t *Rule) MergeSignEvmMessageRule(v SignEvmMessageRule) error { return err } -// AsSignEvmTypedDataRule returns the union data inside the Rule as a SignEvmTypedDataRule -func (t Rule) AsSignEvmTypedDataRule() (SignEvmTypedDataRule, error) { - var body SignEvmTypedDataRule +// AsEvmDataParameterConditionList returns the union data inside the EvmDataCondition_Params_Item as a EvmDataParameterConditionList +func (t EvmDataCondition_Params_Item) AsEvmDataParameterConditionList() (EvmDataParameterConditionList, error) { + var body EvmDataParameterConditionList err := json.Unmarshal(t.union, &body) return body, err } -// FromSignEvmTypedDataRule overwrites any union data inside the Rule as the provided SignEvmTypedDataRule -func (t *Rule) FromSignEvmTypedDataRule(v SignEvmTypedDataRule) error { +// FromEvmDataParameterConditionList overwrites any union data inside the EvmDataCondition_Params_Item as the provided EvmDataParameterConditionList +func (t *EvmDataCondition_Params_Item) FromEvmDataParameterConditionList(v EvmDataParameterConditionList) error { b, err := json.Marshal(v) t.union = b return err } -// MergeSignEvmTypedDataRule performs a merge with any union data inside the Rule, using the provided SignEvmTypedDataRule -func (t *Rule) MergeSignEvmTypedDataRule(v SignEvmTypedDataRule) error { +// MergeEvmDataParameterConditionList performs a merge with any union data inside the EvmDataCondition_Params_Item, using the provided EvmDataParameterConditionList +func (t *EvmDataCondition_Params_Item) MergeEvmDataParameterConditionList(v EvmDataParameterConditionList) error { b, err := json.Marshal(v) if err != nil { return err @@ -5518,22 +5735,32 @@ func (t *Rule) MergeSignEvmTypedDataRule(v SignEvmTypedDataRule) error { return err } -// AsSignSolTransactionRule returns the union data inside the Rule as a SignSolTransactionRule -func (t Rule) AsSignSolTransactionRule() (SignSolTransactionRule, error) { - var body SignSolTransactionRule +func (t EvmDataCondition_Params_Item) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *EvmDataCondition_Params_Item) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsKnownAbiType returns the union data inside the EvmDataCriterion_Abi as a KnownAbiType +func (t EvmDataCriterion_Abi) AsKnownAbiType() (KnownAbiType, error) { + var body KnownAbiType err := json.Unmarshal(t.union, &body) return body, err } -// FromSignSolTransactionRule overwrites any union data inside the Rule as the provided SignSolTransactionRule -func (t *Rule) FromSignSolTransactionRule(v SignSolTransactionRule) error { +// FromKnownAbiType overwrites any union data inside the EvmDataCriterion_Abi as the provided KnownAbiType +func (t *EvmDataCriterion_Abi) FromKnownAbiType(v KnownAbiType) error { b, err := json.Marshal(v) t.union = b return err } -// MergeSignSolTransactionRule performs a merge with any union data inside the Rule, using the provided SignSolTransactionRule -func (t *Rule) MergeSignSolTransactionRule(v SignSolTransactionRule) error { +// MergeKnownAbiType performs a merge with any union data inside the EvmDataCriterion_Abi, using the provided KnownAbiType +func (t *EvmDataCriterion_Abi) MergeKnownAbiType(v KnownAbiType) error { b, err := json.Marshal(v) if err != nil { return err @@ -5544,22 +5771,22 @@ func (t *Rule) MergeSignSolTransactionRule(v SignSolTransactionRule) error { return err } -// AsSendSolTransactionRule returns the union data inside the Rule as a SendSolTransactionRule -func (t Rule) AsSendSolTransactionRule() (SendSolTransactionRule, error) { - var body SendSolTransactionRule +// AsAbi returns the union data inside the EvmDataCriterion_Abi as a Abi +func (t EvmDataCriterion_Abi) AsAbi() (Abi, error) { + var body Abi err := json.Unmarshal(t.union, &body) return body, err } -// FromSendSolTransactionRule overwrites any union data inside the Rule as the provided SendSolTransactionRule -func (t *Rule) FromSendSolTransactionRule(v SendSolTransactionRule) error { +// FromAbi overwrites any union data inside the EvmDataCriterion_Abi as the provided Abi +func (t *EvmDataCriterion_Abi) FromAbi(v Abi) error { b, err := json.Marshal(v) t.union = b return err } -// MergeSendSolTransactionRule performs a merge with any union data inside the Rule, using the provided SendSolTransactionRule -func (t *Rule) MergeSendSolTransactionRule(v SendSolTransactionRule) error { +// MergeAbi performs a merge with any union data inside the EvmDataCriterion_Abi, using the provided Abi +func (t *EvmDataCriterion_Abi) MergeAbi(v Abi) error { b, err := json.Marshal(v) if err != nil { return err @@ -5570,22 +5797,32 @@ func (t *Rule) MergeSendSolTransactionRule(v SendSolTransactionRule) error { return err } -// AsSignSolMessageRule returns the union data inside the Rule as a SignSolMessageRule -func (t Rule) AsSignSolMessageRule() (SignSolMessageRule, error) { - var body SignSolMessageRule +func (t EvmDataCriterion_Abi) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *EvmDataCriterion_Abi) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsGetSwapPriceResponse returns the union data inside the GetSwapPriceResponseWrapper as a GetSwapPriceResponse +func (t GetSwapPriceResponseWrapper) AsGetSwapPriceResponse() (GetSwapPriceResponse, error) { + var body GetSwapPriceResponse err := json.Unmarshal(t.union, &body) return body, err } -// FromSignSolMessageRule overwrites any union data inside the Rule as the provided SignSolMessageRule -func (t *Rule) FromSignSolMessageRule(v SignSolMessageRule) error { +// FromGetSwapPriceResponse overwrites any union data inside the GetSwapPriceResponseWrapper as the provided GetSwapPriceResponse +func (t *GetSwapPriceResponseWrapper) FromGetSwapPriceResponse(v GetSwapPriceResponse) error { b, err := json.Marshal(v) t.union = b return err } -// MergeSignSolMessageRule performs a merge with any union data inside the Rule, using the provided SignSolMessageRule -func (t *Rule) MergeSignSolMessageRule(v SignSolMessageRule) error { +// MergeGetSwapPriceResponse performs a merge with any union data inside the GetSwapPriceResponseWrapper, using the provided GetSwapPriceResponse +func (t *GetSwapPriceResponseWrapper) MergeGetSwapPriceResponse(v GetSwapPriceResponse) error { b, err := json.Marshal(v) if err != nil { return err @@ -5596,22 +5833,22 @@ func (t *Rule) MergeSignSolMessageRule(v SignSolMessageRule) error { return err } -// AsSignEvmHashRule returns the union data inside the Rule as a SignEvmHashRule -func (t Rule) AsSignEvmHashRule() (SignEvmHashRule, error) { - var body SignEvmHashRule +// AsSwapUnavailableResponse returns the union data inside the GetSwapPriceResponseWrapper as a SwapUnavailableResponse +func (t GetSwapPriceResponseWrapper) AsSwapUnavailableResponse() (SwapUnavailableResponse, error) { + var body SwapUnavailableResponse err := json.Unmarshal(t.union, &body) return body, err } -// FromSignEvmHashRule overwrites any union data inside the Rule as the provided SignEvmHashRule -func (t *Rule) FromSignEvmHashRule(v SignEvmHashRule) error { +// FromSwapUnavailableResponse overwrites any union data inside the GetSwapPriceResponseWrapper as the provided SwapUnavailableResponse +func (t *GetSwapPriceResponseWrapper) FromSwapUnavailableResponse(v SwapUnavailableResponse) error { b, err := json.Marshal(v) t.union = b return err } -// MergeSignEvmHashRule performs a merge with any union data inside the Rule, using the provided SignEvmHashRule -func (t *Rule) MergeSignEvmHashRule(v SignEvmHashRule) error { +// MergeSwapUnavailableResponse performs a merge with any union data inside the GetSwapPriceResponseWrapper, using the provided SwapUnavailableResponse +func (t *GetSwapPriceResponseWrapper) MergeSwapUnavailableResponse(v SwapUnavailableResponse) error { b, err := json.Marshal(v) if err != nil { return err @@ -5622,22 +5859,32 @@ func (t *Rule) MergeSignEvmHashRule(v SignEvmHashRule) error { return err } -// AsPrepareUserOperationRule returns the union data inside the Rule as a PrepareUserOperationRule -func (t Rule) AsPrepareUserOperationRule() (PrepareUserOperationRule, error) { - var body PrepareUserOperationRule +func (t GetSwapPriceResponseWrapper) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *GetSwapPriceResponseWrapper) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsEthValueCriterion returns the union data inside the PrepareUserOperationCriteria_Item as a EthValueCriterion +func (t PrepareUserOperationCriteria_Item) AsEthValueCriterion() (EthValueCriterion, error) { + var body EthValueCriterion err := json.Unmarshal(t.union, &body) return body, err } -// FromPrepareUserOperationRule overwrites any union data inside the Rule as the provided PrepareUserOperationRule -func (t *Rule) FromPrepareUserOperationRule(v PrepareUserOperationRule) error { +// FromEthValueCriterion overwrites any union data inside the PrepareUserOperationCriteria_Item as the provided EthValueCriterion +func (t *PrepareUserOperationCriteria_Item) FromEthValueCriterion(v EthValueCriterion) error { b, err := json.Marshal(v) t.union = b return err } -// MergePrepareUserOperationRule performs a merge with any union data inside the Rule, using the provided PrepareUserOperationRule -func (t *Rule) MergePrepareUserOperationRule(v PrepareUserOperationRule) error { +// MergeEthValueCriterion performs a merge with any union data inside the PrepareUserOperationCriteria_Item, using the provided EthValueCriterion +func (t *PrepareUserOperationCriteria_Item) MergeEthValueCriterion(v EthValueCriterion) error { b, err := json.Marshal(v) if err != nil { return err @@ -5648,22 +5895,22 @@ func (t *Rule) MergePrepareUserOperationRule(v PrepareUserOperationRule) error { return err } -// AsSendUserOperationRule returns the union data inside the Rule as a SendUserOperationRule -func (t Rule) AsSendUserOperationRule() (SendUserOperationRule, error) { - var body SendUserOperationRule +// AsEvmAddressCriterion returns the union data inside the PrepareUserOperationCriteria_Item as a EvmAddressCriterion +func (t PrepareUserOperationCriteria_Item) AsEvmAddressCriterion() (EvmAddressCriterion, error) { + var body EvmAddressCriterion err := json.Unmarshal(t.union, &body) return body, err } -// FromSendUserOperationRule overwrites any union data inside the Rule as the provided SendUserOperationRule -func (t *Rule) FromSendUserOperationRule(v SendUserOperationRule) error { +// FromEvmAddressCriterion overwrites any union data inside the PrepareUserOperationCriteria_Item as the provided EvmAddressCriterion +func (t *PrepareUserOperationCriteria_Item) FromEvmAddressCriterion(v EvmAddressCriterion) error { b, err := json.Marshal(v) t.union = b return err } -// MergeSendUserOperationRule performs a merge with any union data inside the Rule, using the provided SendUserOperationRule -func (t *Rule) MergeSendUserOperationRule(v SendUserOperationRule) error { +// MergeEvmAddressCriterion performs a merge with any union data inside the PrepareUserOperationCriteria_Item, using the provided EvmAddressCriterion +func (t *PrepareUserOperationCriteria_Item) MergeEvmAddressCriterion(v EvmAddressCriterion) error { b, err := json.Marshal(v) if err != nil { return err @@ -5674,22 +5921,22 @@ func (t *Rule) MergeSendUserOperationRule(v SendUserOperationRule) error { return err } -// AsSignEndUserEvmTransactionRule returns the union data inside the Rule as a SignEndUserEvmTransactionRule -func (t Rule) AsSignEndUserEvmTransactionRule() (SignEndUserEvmTransactionRule, error) { - var body SignEndUserEvmTransactionRule +// AsEvmNetworkCriterion returns the union data inside the PrepareUserOperationCriteria_Item as a EvmNetworkCriterion +func (t PrepareUserOperationCriteria_Item) AsEvmNetworkCriterion() (EvmNetworkCriterion, error) { + var body EvmNetworkCriterion err := json.Unmarshal(t.union, &body) return body, err } -// FromSignEndUserEvmTransactionRule overwrites any union data inside the Rule as the provided SignEndUserEvmTransactionRule -func (t *Rule) FromSignEndUserEvmTransactionRule(v SignEndUserEvmTransactionRule) error { +// FromEvmNetworkCriterion overwrites any union data inside the PrepareUserOperationCriteria_Item as the provided EvmNetworkCriterion +func (t *PrepareUserOperationCriteria_Item) FromEvmNetworkCriterion(v EvmNetworkCriterion) error { b, err := json.Marshal(v) t.union = b return err } -// MergeSignEndUserEvmTransactionRule performs a merge with any union data inside the Rule, using the provided SignEndUserEvmTransactionRule -func (t *Rule) MergeSignEndUserEvmTransactionRule(v SignEndUserEvmTransactionRule) error { +// MergeEvmNetworkCriterion performs a merge with any union data inside the PrepareUserOperationCriteria_Item, using the provided EvmNetworkCriterion +func (t *PrepareUserOperationCriteria_Item) MergeEvmNetworkCriterion(v EvmNetworkCriterion) error { b, err := json.Marshal(v) if err != nil { return err @@ -5700,23 +5947,23 @@ func (t *Rule) MergeSignEndUserEvmTransactionRule(v SignEndUserEvmTransactionRul return err } -// AsSendEndUserEvmTransactionRule returns the union data inside the Rule as a SendEndUserEvmTransactionRule -func (t Rule) AsSendEndUserEvmTransactionRule() (SendEndUserEvmTransactionRule, error) { - var body SendEndUserEvmTransactionRule +// AsEvmDataCriterion returns the union data inside the PrepareUserOperationCriteria_Item as a EvmDataCriterion +func (t PrepareUserOperationCriteria_Item) AsEvmDataCriterion() (EvmDataCriterion, error) { + var body EvmDataCriterion err := json.Unmarshal(t.union, &body) return body, err } -// FromSendEndUserEvmTransactionRule overwrites any union data inside the Rule as the provided SendEndUserEvmTransactionRule -func (t *Rule) FromSendEndUserEvmTransactionRule(v SendEndUserEvmTransactionRule) error { +// FromEvmDataCriterion overwrites any union data inside the PrepareUserOperationCriteria_Item as the provided EvmDataCriterion +func (t *PrepareUserOperationCriteria_Item) FromEvmDataCriterion(v EvmDataCriterion) error { b, err := json.Marshal(v) t.union = b return err } -// MergeSendEndUserEvmTransactionRule performs a merge with any union data inside the Rule, using the provided SendEndUserEvmTransactionRule -func (t *Rule) MergeSendEndUserEvmTransactionRule(v SendEndUserEvmTransactionRule) error { - b, err := json.Marshal(v) +// MergeEvmDataCriterion performs a merge with any union data inside the PrepareUserOperationCriteria_Item, using the provided EvmDataCriterion +func (t *PrepareUserOperationCriteria_Item) MergeEvmDataCriterion(v EvmDataCriterion) error { + b, err := json.Marshal(v) if err != nil { return err } @@ -5726,22 +5973,22 @@ func (t *Rule) MergeSendEndUserEvmTransactionRule(v SendEndUserEvmTransactionRul return err } -// AsSignEndUserEvmMessageRule returns the union data inside the Rule as a SignEndUserEvmMessageRule -func (t Rule) AsSignEndUserEvmMessageRule() (SignEndUserEvmMessageRule, error) { - var body SignEndUserEvmMessageRule +// AsNetUSDChangeCriterion returns the union data inside the PrepareUserOperationCriteria_Item as a NetUSDChangeCriterion +func (t PrepareUserOperationCriteria_Item) AsNetUSDChangeCriterion() (NetUSDChangeCriterion, error) { + var body NetUSDChangeCriterion err := json.Unmarshal(t.union, &body) return body, err } -// FromSignEndUserEvmMessageRule overwrites any union data inside the Rule as the provided SignEndUserEvmMessageRule -func (t *Rule) FromSignEndUserEvmMessageRule(v SignEndUserEvmMessageRule) error { +// FromNetUSDChangeCriterion overwrites any union data inside the PrepareUserOperationCriteria_Item as the provided NetUSDChangeCriterion +func (t *PrepareUserOperationCriteria_Item) FromNetUSDChangeCriterion(v NetUSDChangeCriterion) error { b, err := json.Marshal(v) t.union = b return err } -// MergeSignEndUserEvmMessageRule performs a merge with any union data inside the Rule, using the provided SignEndUserEvmMessageRule -func (t *Rule) MergeSignEndUserEvmMessageRule(v SignEndUserEvmMessageRule) error { +// MergeNetUSDChangeCriterion performs a merge with any union data inside the PrepareUserOperationCriteria_Item, using the provided NetUSDChangeCriterion +func (t *PrepareUserOperationCriteria_Item) MergeNetUSDChangeCriterion(v NetUSDChangeCriterion) error { b, err := json.Marshal(v) if err != nil { return err @@ -5752,22 +5999,32 @@ func (t *Rule) MergeSignEndUserEvmMessageRule(v SignEndUserEvmMessageRule) error return err } -// AsSignEndUserEvmTypedDataRule returns the union data inside the Rule as a SignEndUserEvmTypedDataRule -func (t Rule) AsSignEndUserEvmTypedDataRule() (SignEndUserEvmTypedDataRule, error) { - var body SignEndUserEvmTypedDataRule +func (t PrepareUserOperationCriteria_Item) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *PrepareUserOperationCriteria_Item) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsSignEvmTransactionRule returns the union data inside the Rule as a SignEvmTransactionRule +func (t Rule) AsSignEvmTransactionRule() (SignEvmTransactionRule, error) { + var body SignEvmTransactionRule err := json.Unmarshal(t.union, &body) return body, err } -// FromSignEndUserEvmTypedDataRule overwrites any union data inside the Rule as the provided SignEndUserEvmTypedDataRule -func (t *Rule) FromSignEndUserEvmTypedDataRule(v SignEndUserEvmTypedDataRule) error { +// FromSignEvmTransactionRule overwrites any union data inside the Rule as the provided SignEvmTransactionRule +func (t *Rule) FromSignEvmTransactionRule(v SignEvmTransactionRule) error { b, err := json.Marshal(v) t.union = b return err } -// MergeSignEndUserEvmTypedDataRule performs a merge with any union data inside the Rule, using the provided SignEndUserEvmTypedDataRule -func (t *Rule) MergeSignEndUserEvmTypedDataRule(v SignEndUserEvmTypedDataRule) error { +// MergeSignEvmTransactionRule performs a merge with any union data inside the Rule, using the provided SignEvmTransactionRule +func (t *Rule) MergeSignEvmTransactionRule(v SignEvmTransactionRule) error { b, err := json.Marshal(v) if err != nil { return err @@ -5778,22 +6035,22 @@ func (t *Rule) MergeSignEndUserEvmTypedDataRule(v SignEndUserEvmTypedDataRule) e return err } -// AsSignEndUserSolTransactionRule returns the union data inside the Rule as a SignEndUserSolTransactionRule -func (t Rule) AsSignEndUserSolTransactionRule() (SignEndUserSolTransactionRule, error) { - var body SignEndUserSolTransactionRule +// AsSendEvmTransactionRule returns the union data inside the Rule as a SendEvmTransactionRule +func (t Rule) AsSendEvmTransactionRule() (SendEvmTransactionRule, error) { + var body SendEvmTransactionRule err := json.Unmarshal(t.union, &body) return body, err } -// FromSignEndUserSolTransactionRule overwrites any union data inside the Rule as the provided SignEndUserSolTransactionRule -func (t *Rule) FromSignEndUserSolTransactionRule(v SignEndUserSolTransactionRule) error { +// FromSendEvmTransactionRule overwrites any union data inside the Rule as the provided SendEvmTransactionRule +func (t *Rule) FromSendEvmTransactionRule(v SendEvmTransactionRule) error { b, err := json.Marshal(v) t.union = b return err } -// MergeSignEndUserSolTransactionRule performs a merge with any union data inside the Rule, using the provided SignEndUserSolTransactionRule -func (t *Rule) MergeSignEndUserSolTransactionRule(v SignEndUserSolTransactionRule) error { +// MergeSendEvmTransactionRule performs a merge with any union data inside the Rule, using the provided SendEvmTransactionRule +func (t *Rule) MergeSendEvmTransactionRule(v SendEvmTransactionRule) error { b, err := json.Marshal(v) if err != nil { return err @@ -5804,22 +6061,22 @@ func (t *Rule) MergeSignEndUserSolTransactionRule(v SignEndUserSolTransactionRul return err } -// AsSendEndUserSolTransactionRule returns the union data inside the Rule as a SendEndUserSolTransactionRule -func (t Rule) AsSendEndUserSolTransactionRule() (SendEndUserSolTransactionRule, error) { - var body SendEndUserSolTransactionRule +// AsSignEvmMessageRule returns the union data inside the Rule as a SignEvmMessageRule +func (t Rule) AsSignEvmMessageRule() (SignEvmMessageRule, error) { + var body SignEvmMessageRule err := json.Unmarshal(t.union, &body) return body, err } -// FromSendEndUserSolTransactionRule overwrites any union data inside the Rule as the provided SendEndUserSolTransactionRule -func (t *Rule) FromSendEndUserSolTransactionRule(v SendEndUserSolTransactionRule) error { +// FromSignEvmMessageRule overwrites any union data inside the Rule as the provided SignEvmMessageRule +func (t *Rule) FromSignEvmMessageRule(v SignEvmMessageRule) error { b, err := json.Marshal(v) t.union = b return err } -// MergeSendEndUserSolTransactionRule performs a merge with any union data inside the Rule, using the provided SendEndUserSolTransactionRule -func (t *Rule) MergeSendEndUserSolTransactionRule(v SendEndUserSolTransactionRule) error { +// MergeSignEvmMessageRule performs a merge with any union data inside the Rule, using the provided SignEvmMessageRule +func (t *Rule) MergeSignEvmMessageRule(v SignEvmMessageRule) error { b, err := json.Marshal(v) if err != nil { return err @@ -5830,22 +6087,22 @@ func (t *Rule) MergeSendEndUserSolTransactionRule(v SendEndUserSolTransactionRul return err } -// AsSignEndUserSolMessageRule returns the union data inside the Rule as a SignEndUserSolMessageRule -func (t Rule) AsSignEndUserSolMessageRule() (SignEndUserSolMessageRule, error) { - var body SignEndUserSolMessageRule +// AsSignEvmTypedDataRule returns the union data inside the Rule as a SignEvmTypedDataRule +func (t Rule) AsSignEvmTypedDataRule() (SignEvmTypedDataRule, error) { + var body SignEvmTypedDataRule err := json.Unmarshal(t.union, &body) return body, err } -// FromSignEndUserSolMessageRule overwrites any union data inside the Rule as the provided SignEndUserSolMessageRule -func (t *Rule) FromSignEndUserSolMessageRule(v SignEndUserSolMessageRule) error { +// FromSignEvmTypedDataRule overwrites any union data inside the Rule as the provided SignEvmTypedDataRule +func (t *Rule) FromSignEvmTypedDataRule(v SignEvmTypedDataRule) error { b, err := json.Marshal(v) t.union = b return err } -// MergeSignEndUserSolMessageRule performs a merge with any union data inside the Rule, using the provided SignEndUserSolMessageRule -func (t *Rule) MergeSignEndUserSolMessageRule(v SignEndUserSolMessageRule) error { +// MergeSignEvmTypedDataRule performs a merge with any union data inside the Rule, using the provided SignEvmTypedDataRule +func (t *Rule) MergeSignEvmTypedDataRule(v SignEvmTypedDataRule) error { b, err := json.Marshal(v) if err != nil { return err @@ -5856,32 +6113,22 @@ func (t *Rule) MergeSignEndUserSolMessageRule(v SignEndUserSolMessageRule) error return err } -func (t Rule) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *Rule) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsEthValueCriterion returns the union data inside the SendEndUserEvmTransactionCriteria_Item as a EthValueCriterion -func (t SendEndUserEvmTransactionCriteria_Item) AsEthValueCriterion() (EthValueCriterion, error) { - var body EthValueCriterion +// AsSignSolTransactionRule returns the union data inside the Rule as a SignSolTransactionRule +func (t Rule) AsSignSolTransactionRule() (SignSolTransactionRule, error) { + var body SignSolTransactionRule err := json.Unmarshal(t.union, &body) return body, err } -// FromEthValueCriterion overwrites any union data inside the SendEndUserEvmTransactionCriteria_Item as the provided EthValueCriterion -func (t *SendEndUserEvmTransactionCriteria_Item) FromEthValueCriterion(v EthValueCriterion) error { +// FromSignSolTransactionRule overwrites any union data inside the Rule as the provided SignSolTransactionRule +func (t *Rule) FromSignSolTransactionRule(v SignSolTransactionRule) error { b, err := json.Marshal(v) t.union = b return err } -// MergeEthValueCriterion performs a merge with any union data inside the SendEndUserEvmTransactionCriteria_Item, using the provided EthValueCriterion -func (t *SendEndUserEvmTransactionCriteria_Item) MergeEthValueCriterion(v EthValueCriterion) error { +// MergeSignSolTransactionRule performs a merge with any union data inside the Rule, using the provided SignSolTransactionRule +func (t *Rule) MergeSignSolTransactionRule(v SignSolTransactionRule) error { b, err := json.Marshal(v) if err != nil { return err @@ -5892,22 +6139,22 @@ func (t *SendEndUserEvmTransactionCriteria_Item) MergeEthValueCriterion(v EthVal return err } -// AsEvmAddressCriterion returns the union data inside the SendEndUserEvmTransactionCriteria_Item as a EvmAddressCriterion -func (t SendEndUserEvmTransactionCriteria_Item) AsEvmAddressCriterion() (EvmAddressCriterion, error) { - var body EvmAddressCriterion +// AsSendSolTransactionRule returns the union data inside the Rule as a SendSolTransactionRule +func (t Rule) AsSendSolTransactionRule() (SendSolTransactionRule, error) { + var body SendSolTransactionRule err := json.Unmarshal(t.union, &body) return body, err } -// FromEvmAddressCriterion overwrites any union data inside the SendEndUserEvmTransactionCriteria_Item as the provided EvmAddressCriterion -func (t *SendEndUserEvmTransactionCriteria_Item) FromEvmAddressCriterion(v EvmAddressCriterion) error { +// FromSendSolTransactionRule overwrites any union data inside the Rule as the provided SendSolTransactionRule +func (t *Rule) FromSendSolTransactionRule(v SendSolTransactionRule) error { b, err := json.Marshal(v) t.union = b return err } -// MergeEvmAddressCriterion performs a merge with any union data inside the SendEndUserEvmTransactionCriteria_Item, using the provided EvmAddressCriterion -func (t *SendEndUserEvmTransactionCriteria_Item) MergeEvmAddressCriterion(v EvmAddressCriterion) error { +// MergeSendSolTransactionRule performs a merge with any union data inside the Rule, using the provided SendSolTransactionRule +func (t *Rule) MergeSendSolTransactionRule(v SendSolTransactionRule) error { b, err := json.Marshal(v) if err != nil { return err @@ -5918,22 +6165,22 @@ func (t *SendEndUserEvmTransactionCriteria_Item) MergeEvmAddressCriterion(v EvmA return err } -// AsEvmNetworkCriterion returns the union data inside the SendEndUserEvmTransactionCriteria_Item as a EvmNetworkCriterion -func (t SendEndUserEvmTransactionCriteria_Item) AsEvmNetworkCriterion() (EvmNetworkCriterion, error) { - var body EvmNetworkCriterion +// AsSignSolMessageRule returns the union data inside the Rule as a SignSolMessageRule +func (t Rule) AsSignSolMessageRule() (SignSolMessageRule, error) { + var body SignSolMessageRule err := json.Unmarshal(t.union, &body) return body, err } -// FromEvmNetworkCriterion overwrites any union data inside the SendEndUserEvmTransactionCriteria_Item as the provided EvmNetworkCriterion -func (t *SendEndUserEvmTransactionCriteria_Item) FromEvmNetworkCriterion(v EvmNetworkCriterion) error { +// FromSignSolMessageRule overwrites any union data inside the Rule as the provided SignSolMessageRule +func (t *Rule) FromSignSolMessageRule(v SignSolMessageRule) error { b, err := json.Marshal(v) t.union = b return err } -// MergeEvmNetworkCriterion performs a merge with any union data inside the SendEndUserEvmTransactionCriteria_Item, using the provided EvmNetworkCriterion -func (t *SendEndUserEvmTransactionCriteria_Item) MergeEvmNetworkCriterion(v EvmNetworkCriterion) error { +// MergeSignSolMessageRule performs a merge with any union data inside the Rule, using the provided SignSolMessageRule +func (t *Rule) MergeSignSolMessageRule(v SignSolMessageRule) error { b, err := json.Marshal(v) if err != nil { return err @@ -5944,22 +6191,22 @@ func (t *SendEndUserEvmTransactionCriteria_Item) MergeEvmNetworkCriterion(v EvmN return err } -// AsEvmDataCriterion returns the union data inside the SendEndUserEvmTransactionCriteria_Item as a EvmDataCriterion -func (t SendEndUserEvmTransactionCriteria_Item) AsEvmDataCriterion() (EvmDataCriterion, error) { - var body EvmDataCriterion +// AsSignEvmHashRule returns the union data inside the Rule as a SignEvmHashRule +func (t Rule) AsSignEvmHashRule() (SignEvmHashRule, error) { + var body SignEvmHashRule err := json.Unmarshal(t.union, &body) return body, err } -// FromEvmDataCriterion overwrites any union data inside the SendEndUserEvmTransactionCriteria_Item as the provided EvmDataCriterion -func (t *SendEndUserEvmTransactionCriteria_Item) FromEvmDataCriterion(v EvmDataCriterion) error { +// FromSignEvmHashRule overwrites any union data inside the Rule as the provided SignEvmHashRule +func (t *Rule) FromSignEvmHashRule(v SignEvmHashRule) error { b, err := json.Marshal(v) t.union = b return err } -// MergeEvmDataCriterion performs a merge with any union data inside the SendEndUserEvmTransactionCriteria_Item, using the provided EvmDataCriterion -func (t *SendEndUserEvmTransactionCriteria_Item) MergeEvmDataCriterion(v EvmDataCriterion) error { +// MergeSignEvmHashRule performs a merge with any union data inside the Rule, using the provided SignEvmHashRule +func (t *Rule) MergeSignEvmHashRule(v SignEvmHashRule) error { b, err := json.Marshal(v) if err != nil { return err @@ -5970,22 +6217,22 @@ func (t *SendEndUserEvmTransactionCriteria_Item) MergeEvmDataCriterion(v EvmData return err } -// AsNetUSDChangeCriterion returns the union data inside the SendEndUserEvmTransactionCriteria_Item as a NetUSDChangeCriterion -func (t SendEndUserEvmTransactionCriteria_Item) AsNetUSDChangeCriterion() (NetUSDChangeCriterion, error) { - var body NetUSDChangeCriterion +// AsPrepareUserOperationRule returns the union data inside the Rule as a PrepareUserOperationRule +func (t Rule) AsPrepareUserOperationRule() (PrepareUserOperationRule, error) { + var body PrepareUserOperationRule err := json.Unmarshal(t.union, &body) return body, err } -// FromNetUSDChangeCriterion overwrites any union data inside the SendEndUserEvmTransactionCriteria_Item as the provided NetUSDChangeCriterion -func (t *SendEndUserEvmTransactionCriteria_Item) FromNetUSDChangeCriterion(v NetUSDChangeCriterion) error { +// FromPrepareUserOperationRule overwrites any union data inside the Rule as the provided PrepareUserOperationRule +func (t *Rule) FromPrepareUserOperationRule(v PrepareUserOperationRule) error { b, err := json.Marshal(v) t.union = b return err } -// MergeNetUSDChangeCriterion performs a merge with any union data inside the SendEndUserEvmTransactionCriteria_Item, using the provided NetUSDChangeCriterion -func (t *SendEndUserEvmTransactionCriteria_Item) MergeNetUSDChangeCriterion(v NetUSDChangeCriterion) error { +// MergePrepareUserOperationRule performs a merge with any union data inside the Rule, using the provided PrepareUserOperationRule +func (t *Rule) MergePrepareUserOperationRule(v PrepareUserOperationRule) error { b, err := json.Marshal(v) if err != nil { return err @@ -5996,32 +6243,22 @@ func (t *SendEndUserEvmTransactionCriteria_Item) MergeNetUSDChangeCriterion(v Ne return err } -func (t SendEndUserEvmTransactionCriteria_Item) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *SendEndUserEvmTransactionCriteria_Item) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsSolAddressCriterion returns the union data inside the SendEndUserSolTransactionCriteria_Item as a SolAddressCriterion -func (t SendEndUserSolTransactionCriteria_Item) AsSolAddressCriterion() (SolAddressCriterion, error) { - var body SolAddressCriterion +// AsSendUserOperationRule returns the union data inside the Rule as a SendUserOperationRule +func (t Rule) AsSendUserOperationRule() (SendUserOperationRule, error) { + var body SendUserOperationRule err := json.Unmarshal(t.union, &body) return body, err } -// FromSolAddressCriterion overwrites any union data inside the SendEndUserSolTransactionCriteria_Item as the provided SolAddressCriterion -func (t *SendEndUserSolTransactionCriteria_Item) FromSolAddressCriterion(v SolAddressCriterion) error { +// FromSendUserOperationRule overwrites any union data inside the Rule as the provided SendUserOperationRule +func (t *Rule) FromSendUserOperationRule(v SendUserOperationRule) error { b, err := json.Marshal(v) t.union = b return err } -// MergeSolAddressCriterion performs a merge with any union data inside the SendEndUserSolTransactionCriteria_Item, using the provided SolAddressCriterion -func (t *SendEndUserSolTransactionCriteria_Item) MergeSolAddressCriterion(v SolAddressCriterion) error { +// MergeSendUserOperationRule performs a merge with any union data inside the Rule, using the provided SendUserOperationRule +func (t *Rule) MergeSendUserOperationRule(v SendUserOperationRule) error { b, err := json.Marshal(v) if err != nil { return err @@ -6032,22 +6269,22 @@ func (t *SendEndUserSolTransactionCriteria_Item) MergeSolAddressCriterion(v SolA return err } -// AsSolValueCriterion returns the union data inside the SendEndUserSolTransactionCriteria_Item as a SolValueCriterion -func (t SendEndUserSolTransactionCriteria_Item) AsSolValueCriterion() (SolValueCriterion, error) { - var body SolValueCriterion +// AsSignEndUserEvmTransactionRule returns the union data inside the Rule as a SignEndUserEvmTransactionRule +func (t Rule) AsSignEndUserEvmTransactionRule() (SignEndUserEvmTransactionRule, error) { + var body SignEndUserEvmTransactionRule err := json.Unmarshal(t.union, &body) return body, err } -// FromSolValueCriterion overwrites any union data inside the SendEndUserSolTransactionCriteria_Item as the provided SolValueCriterion -func (t *SendEndUserSolTransactionCriteria_Item) FromSolValueCriterion(v SolValueCriterion) error { +// FromSignEndUserEvmTransactionRule overwrites any union data inside the Rule as the provided SignEndUserEvmTransactionRule +func (t *Rule) FromSignEndUserEvmTransactionRule(v SignEndUserEvmTransactionRule) error { b, err := json.Marshal(v) t.union = b return err } -// MergeSolValueCriterion performs a merge with any union data inside the SendEndUserSolTransactionCriteria_Item, using the provided SolValueCriterion -func (t *SendEndUserSolTransactionCriteria_Item) MergeSolValueCriterion(v SolValueCriterion) error { +// MergeSignEndUserEvmTransactionRule performs a merge with any union data inside the Rule, using the provided SignEndUserEvmTransactionRule +func (t *Rule) MergeSignEndUserEvmTransactionRule(v SignEndUserEvmTransactionRule) error { b, err := json.Marshal(v) if err != nil { return err @@ -6058,22 +6295,22 @@ func (t *SendEndUserSolTransactionCriteria_Item) MergeSolValueCriterion(v SolVal return err } -// AsSplAddressCriterion returns the union data inside the SendEndUserSolTransactionCriteria_Item as a SplAddressCriterion -func (t SendEndUserSolTransactionCriteria_Item) AsSplAddressCriterion() (SplAddressCriterion, error) { - var body SplAddressCriterion +// AsSendEndUserEvmTransactionRule returns the union data inside the Rule as a SendEndUserEvmTransactionRule +func (t Rule) AsSendEndUserEvmTransactionRule() (SendEndUserEvmTransactionRule, error) { + var body SendEndUserEvmTransactionRule err := json.Unmarshal(t.union, &body) return body, err } -// FromSplAddressCriterion overwrites any union data inside the SendEndUserSolTransactionCriteria_Item as the provided SplAddressCriterion -func (t *SendEndUserSolTransactionCriteria_Item) FromSplAddressCriterion(v SplAddressCriterion) error { +// FromSendEndUserEvmTransactionRule overwrites any union data inside the Rule as the provided SendEndUserEvmTransactionRule +func (t *Rule) FromSendEndUserEvmTransactionRule(v SendEndUserEvmTransactionRule) error { b, err := json.Marshal(v) t.union = b return err } -// MergeSplAddressCriterion performs a merge with any union data inside the SendEndUserSolTransactionCriteria_Item, using the provided SplAddressCriterion -func (t *SendEndUserSolTransactionCriteria_Item) MergeSplAddressCriterion(v SplAddressCriterion) error { +// MergeSendEndUserEvmTransactionRule performs a merge with any union data inside the Rule, using the provided SendEndUserEvmTransactionRule +func (t *Rule) MergeSendEndUserEvmTransactionRule(v SendEndUserEvmTransactionRule) error { b, err := json.Marshal(v) if err != nil { return err @@ -6084,22 +6321,22 @@ func (t *SendEndUserSolTransactionCriteria_Item) MergeSplAddressCriterion(v SplA return err } -// AsSplValueCriterion returns the union data inside the SendEndUserSolTransactionCriteria_Item as a SplValueCriterion -func (t SendEndUserSolTransactionCriteria_Item) AsSplValueCriterion() (SplValueCriterion, error) { - var body SplValueCriterion +// AsSignEndUserEvmMessageRule returns the union data inside the Rule as a SignEndUserEvmMessageRule +func (t Rule) AsSignEndUserEvmMessageRule() (SignEndUserEvmMessageRule, error) { + var body SignEndUserEvmMessageRule err := json.Unmarshal(t.union, &body) return body, err } -// FromSplValueCriterion overwrites any union data inside the SendEndUserSolTransactionCriteria_Item as the provided SplValueCriterion -func (t *SendEndUserSolTransactionCriteria_Item) FromSplValueCriterion(v SplValueCriterion) error { +// FromSignEndUserEvmMessageRule overwrites any union data inside the Rule as the provided SignEndUserEvmMessageRule +func (t *Rule) FromSignEndUserEvmMessageRule(v SignEndUserEvmMessageRule) error { b, err := json.Marshal(v) t.union = b return err } -// MergeSplValueCriterion performs a merge with any union data inside the SendEndUserSolTransactionCriteria_Item, using the provided SplValueCriterion -func (t *SendEndUserSolTransactionCriteria_Item) MergeSplValueCriterion(v SplValueCriterion) error { +// MergeSignEndUserEvmMessageRule performs a merge with any union data inside the Rule, using the provided SignEndUserEvmMessageRule +func (t *Rule) MergeSignEndUserEvmMessageRule(v SignEndUserEvmMessageRule) error { b, err := json.Marshal(v) if err != nil { return err @@ -6110,22 +6347,22 @@ func (t *SendEndUserSolTransactionCriteria_Item) MergeSplValueCriterion(v SplVal return err } -// AsMintAddressCriterion returns the union data inside the SendEndUserSolTransactionCriteria_Item as a MintAddressCriterion -func (t SendEndUserSolTransactionCriteria_Item) AsMintAddressCriterion() (MintAddressCriterion, error) { - var body MintAddressCriterion +// AsSignEndUserEvmTypedDataRule returns the union data inside the Rule as a SignEndUserEvmTypedDataRule +func (t Rule) AsSignEndUserEvmTypedDataRule() (SignEndUserEvmTypedDataRule, error) { + var body SignEndUserEvmTypedDataRule err := json.Unmarshal(t.union, &body) return body, err } -// FromMintAddressCriterion overwrites any union data inside the SendEndUserSolTransactionCriteria_Item as the provided MintAddressCriterion -func (t *SendEndUserSolTransactionCriteria_Item) FromMintAddressCriterion(v MintAddressCriterion) error { +// FromSignEndUserEvmTypedDataRule overwrites any union data inside the Rule as the provided SignEndUserEvmTypedDataRule +func (t *Rule) FromSignEndUserEvmTypedDataRule(v SignEndUserEvmTypedDataRule) error { b, err := json.Marshal(v) t.union = b return err } -// MergeMintAddressCriterion performs a merge with any union data inside the SendEndUserSolTransactionCriteria_Item, using the provided MintAddressCriterion -func (t *SendEndUserSolTransactionCriteria_Item) MergeMintAddressCriterion(v MintAddressCriterion) error { +// MergeSignEndUserEvmTypedDataRule performs a merge with any union data inside the Rule, using the provided SignEndUserEvmTypedDataRule +func (t *Rule) MergeSignEndUserEvmTypedDataRule(v SignEndUserEvmTypedDataRule) error { b, err := json.Marshal(v) if err != nil { return err @@ -6136,23 +6373,23 @@ func (t *SendEndUserSolTransactionCriteria_Item) MergeMintAddressCriterion(v Min return err } -// AsSolDataCriterion returns the union data inside the SendEndUserSolTransactionCriteria_Item as a SolDataCriterion -func (t SendEndUserSolTransactionCriteria_Item) AsSolDataCriterion() (SolDataCriterion, error) { - var body SolDataCriterion +// AsSignEndUserSolTransactionRule returns the union data inside the Rule as a SignEndUserSolTransactionRule +func (t Rule) AsSignEndUserSolTransactionRule() (SignEndUserSolTransactionRule, error) { + var body SignEndUserSolTransactionRule err := json.Unmarshal(t.union, &body) return body, err } -// FromSolDataCriterion overwrites any union data inside the SendEndUserSolTransactionCriteria_Item as the provided SolDataCriterion -func (t *SendEndUserSolTransactionCriteria_Item) FromSolDataCriterion(v SolDataCriterion) error { +// FromSignEndUserSolTransactionRule overwrites any union data inside the Rule as the provided SignEndUserSolTransactionRule +func (t *Rule) FromSignEndUserSolTransactionRule(v SignEndUserSolTransactionRule) error { b, err := json.Marshal(v) t.union = b return err } -// MergeSolDataCriterion performs a merge with any union data inside the SendEndUserSolTransactionCriteria_Item, using the provided SolDataCriterion -func (t *SendEndUserSolTransactionCriteria_Item) MergeSolDataCriterion(v SolDataCriterion) error { - b, err := json.Marshal(v) +// MergeSignEndUserSolTransactionRule performs a merge with any union data inside the Rule, using the provided SignEndUserSolTransactionRule +func (t *Rule) MergeSignEndUserSolTransactionRule(v SignEndUserSolTransactionRule) error { + b, err := json.Marshal(v) if err != nil { return err } @@ -6162,22 +6399,22 @@ func (t *SendEndUserSolTransactionCriteria_Item) MergeSolDataCriterion(v SolData return err } -// AsProgramIdCriterion returns the union data inside the SendEndUserSolTransactionCriteria_Item as a ProgramIdCriterion -func (t SendEndUserSolTransactionCriteria_Item) AsProgramIdCriterion() (ProgramIdCriterion, error) { - var body ProgramIdCriterion +// AsSendEndUserSolTransactionRule returns the union data inside the Rule as a SendEndUserSolTransactionRule +func (t Rule) AsSendEndUserSolTransactionRule() (SendEndUserSolTransactionRule, error) { + var body SendEndUserSolTransactionRule err := json.Unmarshal(t.union, &body) return body, err } -// FromProgramIdCriterion overwrites any union data inside the SendEndUserSolTransactionCriteria_Item as the provided ProgramIdCriterion -func (t *SendEndUserSolTransactionCriteria_Item) FromProgramIdCriterion(v ProgramIdCriterion) error { +// FromSendEndUserSolTransactionRule overwrites any union data inside the Rule as the provided SendEndUserSolTransactionRule +func (t *Rule) FromSendEndUserSolTransactionRule(v SendEndUserSolTransactionRule) error { b, err := json.Marshal(v) t.union = b return err } -// MergeProgramIdCriterion performs a merge with any union data inside the SendEndUserSolTransactionCriteria_Item, using the provided ProgramIdCriterion -func (t *SendEndUserSolTransactionCriteria_Item) MergeProgramIdCriterion(v ProgramIdCriterion) error { +// MergeSendEndUserSolTransactionRule performs a merge with any union data inside the Rule, using the provided SendEndUserSolTransactionRule +func (t *Rule) MergeSendEndUserSolTransactionRule(v SendEndUserSolTransactionRule) error { b, err := json.Marshal(v) if err != nil { return err @@ -6188,22 +6425,22 @@ func (t *SendEndUserSolTransactionCriteria_Item) MergeProgramIdCriterion(v Progr return err } -// AsSolNetworkCriterion returns the union data inside the SendEndUserSolTransactionCriteria_Item as a SolNetworkCriterion -func (t SendEndUserSolTransactionCriteria_Item) AsSolNetworkCriterion() (SolNetworkCriterion, error) { - var body SolNetworkCriterion +// AsSignEndUserSolMessageRule returns the union data inside the Rule as a SignEndUserSolMessageRule +func (t Rule) AsSignEndUserSolMessageRule() (SignEndUserSolMessageRule, error) { + var body SignEndUserSolMessageRule err := json.Unmarshal(t.union, &body) return body, err } -// FromSolNetworkCriterion overwrites any union data inside the SendEndUserSolTransactionCriteria_Item as the provided SolNetworkCriterion -func (t *SendEndUserSolTransactionCriteria_Item) FromSolNetworkCriterion(v SolNetworkCriterion) error { +// FromSignEndUserSolMessageRule overwrites any union data inside the Rule as the provided SignEndUserSolMessageRule +func (t *Rule) FromSignEndUserSolMessageRule(v SignEndUserSolMessageRule) error { b, err := json.Marshal(v) t.union = b return err } -// MergeSolNetworkCriterion performs a merge with any union data inside the SendEndUserSolTransactionCriteria_Item, using the provided SolNetworkCriterion -func (t *SendEndUserSolTransactionCriteria_Item) MergeSolNetworkCriterion(v SolNetworkCriterion) error { +// MergeSignEndUserSolMessageRule performs a merge with any union data inside the Rule, using the provided SignEndUserSolMessageRule +func (t *Rule) MergeSignEndUserSolMessageRule(v SignEndUserSolMessageRule) error { b, err := json.Marshal(v) if err != nil { return err @@ -6214,32 +6451,32 @@ func (t *SendEndUserSolTransactionCriteria_Item) MergeSolNetworkCriterion(v SolN return err } -func (t SendEndUserSolTransactionCriteria_Item) MarshalJSON() ([]byte, error) { +func (t Rule) MarshalJSON() ([]byte, error) { b, err := t.union.MarshalJSON() return b, err } -func (t *SendEndUserSolTransactionCriteria_Item) UnmarshalJSON(b []byte) error { +func (t *Rule) UnmarshalJSON(b []byte) error { err := t.union.UnmarshalJSON(b) return err } -// AsEthValueCriterion returns the union data inside the SendEvmTransactionCriteria_Item as a EthValueCriterion -func (t SendEvmTransactionCriteria_Item) AsEthValueCriterion() (EthValueCriterion, error) { +// AsEthValueCriterion returns the union data inside the SendEndUserEvmTransactionCriteria_Item as a EthValueCriterion +func (t SendEndUserEvmTransactionCriteria_Item) AsEthValueCriterion() (EthValueCriterion, error) { var body EthValueCriterion err := json.Unmarshal(t.union, &body) return body, err } -// FromEthValueCriterion overwrites any union data inside the SendEvmTransactionCriteria_Item as the provided EthValueCriterion -func (t *SendEvmTransactionCriteria_Item) FromEthValueCriterion(v EthValueCriterion) error { +// FromEthValueCriterion overwrites any union data inside the SendEndUserEvmTransactionCriteria_Item as the provided EthValueCriterion +func (t *SendEndUserEvmTransactionCriteria_Item) FromEthValueCriterion(v EthValueCriterion) error { b, err := json.Marshal(v) t.union = b return err } -// MergeEthValueCriterion performs a merge with any union data inside the SendEvmTransactionCriteria_Item, using the provided EthValueCriterion -func (t *SendEvmTransactionCriteria_Item) MergeEthValueCriterion(v EthValueCriterion) error { +// MergeEthValueCriterion performs a merge with any union data inside the SendEndUserEvmTransactionCriteria_Item, using the provided EthValueCriterion +func (t *SendEndUserEvmTransactionCriteria_Item) MergeEthValueCriterion(v EthValueCriterion) error { b, err := json.Marshal(v) if err != nil { return err @@ -6250,22 +6487,22 @@ func (t *SendEvmTransactionCriteria_Item) MergeEthValueCriterion(v EthValueCrite return err } -// AsEvmAddressCriterion returns the union data inside the SendEvmTransactionCriteria_Item as a EvmAddressCriterion -func (t SendEvmTransactionCriteria_Item) AsEvmAddressCriterion() (EvmAddressCriterion, error) { +// AsEvmAddressCriterion returns the union data inside the SendEndUserEvmTransactionCriteria_Item as a EvmAddressCriterion +func (t SendEndUserEvmTransactionCriteria_Item) AsEvmAddressCriterion() (EvmAddressCriterion, error) { var body EvmAddressCriterion err := json.Unmarshal(t.union, &body) return body, err } -// FromEvmAddressCriterion overwrites any union data inside the SendEvmTransactionCriteria_Item as the provided EvmAddressCriterion -func (t *SendEvmTransactionCriteria_Item) FromEvmAddressCriterion(v EvmAddressCriterion) error { +// FromEvmAddressCriterion overwrites any union data inside the SendEndUserEvmTransactionCriteria_Item as the provided EvmAddressCriterion +func (t *SendEndUserEvmTransactionCriteria_Item) FromEvmAddressCriterion(v EvmAddressCriterion) error { b, err := json.Marshal(v) t.union = b return err } -// MergeEvmAddressCriterion performs a merge with any union data inside the SendEvmTransactionCriteria_Item, using the provided EvmAddressCriterion -func (t *SendEvmTransactionCriteria_Item) MergeEvmAddressCriterion(v EvmAddressCriterion) error { +// MergeEvmAddressCriterion performs a merge with any union data inside the SendEndUserEvmTransactionCriteria_Item, using the provided EvmAddressCriterion +func (t *SendEndUserEvmTransactionCriteria_Item) MergeEvmAddressCriterion(v EvmAddressCriterion) error { b, err := json.Marshal(v) if err != nil { return err @@ -6276,22 +6513,22 @@ func (t *SendEvmTransactionCriteria_Item) MergeEvmAddressCriterion(v EvmAddressC return err } -// AsEvmNetworkCriterion returns the union data inside the SendEvmTransactionCriteria_Item as a EvmNetworkCriterion -func (t SendEvmTransactionCriteria_Item) AsEvmNetworkCriterion() (EvmNetworkCriterion, error) { +// AsEvmNetworkCriterion returns the union data inside the SendEndUserEvmTransactionCriteria_Item as a EvmNetworkCriterion +func (t SendEndUserEvmTransactionCriteria_Item) AsEvmNetworkCriterion() (EvmNetworkCriterion, error) { var body EvmNetworkCriterion err := json.Unmarshal(t.union, &body) return body, err } -// FromEvmNetworkCriterion overwrites any union data inside the SendEvmTransactionCriteria_Item as the provided EvmNetworkCriterion -func (t *SendEvmTransactionCriteria_Item) FromEvmNetworkCriterion(v EvmNetworkCriterion) error { +// FromEvmNetworkCriterion overwrites any union data inside the SendEndUserEvmTransactionCriteria_Item as the provided EvmNetworkCriterion +func (t *SendEndUserEvmTransactionCriteria_Item) FromEvmNetworkCriterion(v EvmNetworkCriterion) error { b, err := json.Marshal(v) t.union = b return err } -// MergeEvmNetworkCriterion performs a merge with any union data inside the SendEvmTransactionCriteria_Item, using the provided EvmNetworkCriterion -func (t *SendEvmTransactionCriteria_Item) MergeEvmNetworkCriterion(v EvmNetworkCriterion) error { +// MergeEvmNetworkCriterion performs a merge with any union data inside the SendEndUserEvmTransactionCriteria_Item, using the provided EvmNetworkCriterion +func (t *SendEndUserEvmTransactionCriteria_Item) MergeEvmNetworkCriterion(v EvmNetworkCriterion) error { b, err := json.Marshal(v) if err != nil { return err @@ -6302,22 +6539,22 @@ func (t *SendEvmTransactionCriteria_Item) MergeEvmNetworkCriterion(v EvmNetworkC return err } -// AsEvmDataCriterion returns the union data inside the SendEvmTransactionCriteria_Item as a EvmDataCriterion -func (t SendEvmTransactionCriteria_Item) AsEvmDataCriterion() (EvmDataCriterion, error) { +// AsEvmDataCriterion returns the union data inside the SendEndUserEvmTransactionCriteria_Item as a EvmDataCriterion +func (t SendEndUserEvmTransactionCriteria_Item) AsEvmDataCriterion() (EvmDataCriterion, error) { var body EvmDataCriterion err := json.Unmarshal(t.union, &body) return body, err } -// FromEvmDataCriterion overwrites any union data inside the SendEvmTransactionCriteria_Item as the provided EvmDataCriterion -func (t *SendEvmTransactionCriteria_Item) FromEvmDataCriterion(v EvmDataCriterion) error { +// FromEvmDataCriterion overwrites any union data inside the SendEndUserEvmTransactionCriteria_Item as the provided EvmDataCriterion +func (t *SendEndUserEvmTransactionCriteria_Item) FromEvmDataCriterion(v EvmDataCriterion) error { b, err := json.Marshal(v) t.union = b return err } -// MergeEvmDataCriterion performs a merge with any union data inside the SendEvmTransactionCriteria_Item, using the provided EvmDataCriterion -func (t *SendEvmTransactionCriteria_Item) MergeEvmDataCriterion(v EvmDataCriterion) error { +// MergeEvmDataCriterion performs a merge with any union data inside the SendEndUserEvmTransactionCriteria_Item, using the provided EvmDataCriterion +func (t *SendEndUserEvmTransactionCriteria_Item) MergeEvmDataCriterion(v EvmDataCriterion) error { b, err := json.Marshal(v) if err != nil { return err @@ -6328,22 +6565,22 @@ func (t *SendEvmTransactionCriteria_Item) MergeEvmDataCriterion(v EvmDataCriteri return err } -// AsNetUSDChangeCriterion returns the union data inside the SendEvmTransactionCriteria_Item as a NetUSDChangeCriterion -func (t SendEvmTransactionCriteria_Item) AsNetUSDChangeCriterion() (NetUSDChangeCriterion, error) { +// AsNetUSDChangeCriterion returns the union data inside the SendEndUserEvmTransactionCriteria_Item as a NetUSDChangeCriterion +func (t SendEndUserEvmTransactionCriteria_Item) AsNetUSDChangeCriterion() (NetUSDChangeCriterion, error) { var body NetUSDChangeCriterion err := json.Unmarshal(t.union, &body) return body, err } -// FromNetUSDChangeCriterion overwrites any union data inside the SendEvmTransactionCriteria_Item as the provided NetUSDChangeCriterion -func (t *SendEvmTransactionCriteria_Item) FromNetUSDChangeCriterion(v NetUSDChangeCriterion) error { +// FromNetUSDChangeCriterion overwrites any union data inside the SendEndUserEvmTransactionCriteria_Item as the provided NetUSDChangeCriterion +func (t *SendEndUserEvmTransactionCriteria_Item) FromNetUSDChangeCriterion(v NetUSDChangeCriterion) error { b, err := json.Marshal(v) t.union = b return err } -// MergeNetUSDChangeCriterion performs a merge with any union data inside the SendEvmTransactionCriteria_Item, using the provided NetUSDChangeCriterion -func (t *SendEvmTransactionCriteria_Item) MergeNetUSDChangeCriterion(v NetUSDChangeCriterion) error { +// MergeNetUSDChangeCriterion performs a merge with any union data inside the SendEndUserEvmTransactionCriteria_Item, using the provided NetUSDChangeCriterion +func (t *SendEndUserEvmTransactionCriteria_Item) MergeNetUSDChangeCriterion(v NetUSDChangeCriterion) error { b, err := json.Marshal(v) if err != nil { return err @@ -6354,32 +6591,32 @@ func (t *SendEvmTransactionCriteria_Item) MergeNetUSDChangeCriterion(v NetUSDCha return err } -func (t SendEvmTransactionCriteria_Item) MarshalJSON() ([]byte, error) { +func (t SendEndUserEvmTransactionCriteria_Item) MarshalJSON() ([]byte, error) { b, err := t.union.MarshalJSON() return b, err } -func (t *SendEvmTransactionCriteria_Item) UnmarshalJSON(b []byte) error { +func (t *SendEndUserEvmTransactionCriteria_Item) UnmarshalJSON(b []byte) error { err := t.union.UnmarshalJSON(b) return err } -// AsSolAddressCriterion returns the union data inside the SendSolTransactionCriteria_Item as a SolAddressCriterion -func (t SendSolTransactionCriteria_Item) AsSolAddressCriterion() (SolAddressCriterion, error) { +// AsSolAddressCriterion returns the union data inside the SendEndUserSolTransactionCriteria_Item as a SolAddressCriterion +func (t SendEndUserSolTransactionCriteria_Item) AsSolAddressCriterion() (SolAddressCriterion, error) { var body SolAddressCriterion err := json.Unmarshal(t.union, &body) return body, err } -// FromSolAddressCriterion overwrites any union data inside the SendSolTransactionCriteria_Item as the provided SolAddressCriterion -func (t *SendSolTransactionCriteria_Item) FromSolAddressCriterion(v SolAddressCriterion) error { +// FromSolAddressCriterion overwrites any union data inside the SendEndUserSolTransactionCriteria_Item as the provided SolAddressCriterion +func (t *SendEndUserSolTransactionCriteria_Item) FromSolAddressCriterion(v SolAddressCriterion) error { b, err := json.Marshal(v) t.union = b return err } -// MergeSolAddressCriterion performs a merge with any union data inside the SendSolTransactionCriteria_Item, using the provided SolAddressCriterion -func (t *SendSolTransactionCriteria_Item) MergeSolAddressCriterion(v SolAddressCriterion) error { +// MergeSolAddressCriterion performs a merge with any union data inside the SendEndUserSolTransactionCriteria_Item, using the provided SolAddressCriterion +func (t *SendEndUserSolTransactionCriteria_Item) MergeSolAddressCriterion(v SolAddressCriterion) error { b, err := json.Marshal(v) if err != nil { return err @@ -6390,22 +6627,22 @@ func (t *SendSolTransactionCriteria_Item) MergeSolAddressCriterion(v SolAddressC return err } -// AsSolValueCriterion returns the union data inside the SendSolTransactionCriteria_Item as a SolValueCriterion -func (t SendSolTransactionCriteria_Item) AsSolValueCriterion() (SolValueCriterion, error) { +// AsSolValueCriterion returns the union data inside the SendEndUserSolTransactionCriteria_Item as a SolValueCriterion +func (t SendEndUserSolTransactionCriteria_Item) AsSolValueCriterion() (SolValueCriterion, error) { var body SolValueCriterion err := json.Unmarshal(t.union, &body) return body, err } -// FromSolValueCriterion overwrites any union data inside the SendSolTransactionCriteria_Item as the provided SolValueCriterion -func (t *SendSolTransactionCriteria_Item) FromSolValueCriterion(v SolValueCriterion) error { +// FromSolValueCriterion overwrites any union data inside the SendEndUserSolTransactionCriteria_Item as the provided SolValueCriterion +func (t *SendEndUserSolTransactionCriteria_Item) FromSolValueCriterion(v SolValueCriterion) error { b, err := json.Marshal(v) t.union = b return err } -// MergeSolValueCriterion performs a merge with any union data inside the SendSolTransactionCriteria_Item, using the provided SolValueCriterion -func (t *SendSolTransactionCriteria_Item) MergeSolValueCriterion(v SolValueCriterion) error { +// MergeSolValueCriterion performs a merge with any union data inside the SendEndUserSolTransactionCriteria_Item, using the provided SolValueCriterion +func (t *SendEndUserSolTransactionCriteria_Item) MergeSolValueCriterion(v SolValueCriterion) error { b, err := json.Marshal(v) if err != nil { return err @@ -6416,22 +6653,22 @@ func (t *SendSolTransactionCriteria_Item) MergeSolValueCriterion(v SolValueCrite return err } -// AsSplAddressCriterion returns the union data inside the SendSolTransactionCriteria_Item as a SplAddressCriterion -func (t SendSolTransactionCriteria_Item) AsSplAddressCriterion() (SplAddressCriterion, error) { +// AsSplAddressCriterion returns the union data inside the SendEndUserSolTransactionCriteria_Item as a SplAddressCriterion +func (t SendEndUserSolTransactionCriteria_Item) AsSplAddressCriterion() (SplAddressCriterion, error) { var body SplAddressCriterion err := json.Unmarshal(t.union, &body) return body, err } -// FromSplAddressCriterion overwrites any union data inside the SendSolTransactionCriteria_Item as the provided SplAddressCriterion -func (t *SendSolTransactionCriteria_Item) FromSplAddressCriterion(v SplAddressCriterion) error { +// FromSplAddressCriterion overwrites any union data inside the SendEndUserSolTransactionCriteria_Item as the provided SplAddressCriterion +func (t *SendEndUserSolTransactionCriteria_Item) FromSplAddressCriterion(v SplAddressCriterion) error { b, err := json.Marshal(v) t.union = b return err } -// MergeSplAddressCriterion performs a merge with any union data inside the SendSolTransactionCriteria_Item, using the provided SplAddressCriterion -func (t *SendSolTransactionCriteria_Item) MergeSplAddressCriterion(v SplAddressCriterion) error { +// MergeSplAddressCriterion performs a merge with any union data inside the SendEndUserSolTransactionCriteria_Item, using the provided SplAddressCriterion +func (t *SendEndUserSolTransactionCriteria_Item) MergeSplAddressCriterion(v SplAddressCriterion) error { b, err := json.Marshal(v) if err != nil { return err @@ -6442,22 +6679,22 @@ func (t *SendSolTransactionCriteria_Item) MergeSplAddressCriterion(v SplAddressC return err } -// AsSplValueCriterion returns the union data inside the SendSolTransactionCriteria_Item as a SplValueCriterion -func (t SendSolTransactionCriteria_Item) AsSplValueCriterion() (SplValueCriterion, error) { +// AsSplValueCriterion returns the union data inside the SendEndUserSolTransactionCriteria_Item as a SplValueCriterion +func (t SendEndUserSolTransactionCriteria_Item) AsSplValueCriterion() (SplValueCriterion, error) { var body SplValueCriterion err := json.Unmarshal(t.union, &body) return body, err } -// FromSplValueCriterion overwrites any union data inside the SendSolTransactionCriteria_Item as the provided SplValueCriterion -func (t *SendSolTransactionCriteria_Item) FromSplValueCriterion(v SplValueCriterion) error { +// FromSplValueCriterion overwrites any union data inside the SendEndUserSolTransactionCriteria_Item as the provided SplValueCriterion +func (t *SendEndUserSolTransactionCriteria_Item) FromSplValueCriterion(v SplValueCriterion) error { b, err := json.Marshal(v) t.union = b return err } -// MergeSplValueCriterion performs a merge with any union data inside the SendSolTransactionCriteria_Item, using the provided SplValueCriterion -func (t *SendSolTransactionCriteria_Item) MergeSplValueCriterion(v SplValueCriterion) error { +// MergeSplValueCriterion performs a merge with any union data inside the SendEndUserSolTransactionCriteria_Item, using the provided SplValueCriterion +func (t *SendEndUserSolTransactionCriteria_Item) MergeSplValueCriterion(v SplValueCriterion) error { b, err := json.Marshal(v) if err != nil { return err @@ -6468,22 +6705,22 @@ func (t *SendSolTransactionCriteria_Item) MergeSplValueCriterion(v SplValueCrite return err } -// AsMintAddressCriterion returns the union data inside the SendSolTransactionCriteria_Item as a MintAddressCriterion -func (t SendSolTransactionCriteria_Item) AsMintAddressCriterion() (MintAddressCriterion, error) { +// AsMintAddressCriterion returns the union data inside the SendEndUserSolTransactionCriteria_Item as a MintAddressCriterion +func (t SendEndUserSolTransactionCriteria_Item) AsMintAddressCriterion() (MintAddressCriterion, error) { var body MintAddressCriterion err := json.Unmarshal(t.union, &body) return body, err } -// FromMintAddressCriterion overwrites any union data inside the SendSolTransactionCriteria_Item as the provided MintAddressCriterion -func (t *SendSolTransactionCriteria_Item) FromMintAddressCriterion(v MintAddressCriterion) error { +// FromMintAddressCriterion overwrites any union data inside the SendEndUserSolTransactionCriteria_Item as the provided MintAddressCriterion +func (t *SendEndUserSolTransactionCriteria_Item) FromMintAddressCriterion(v MintAddressCriterion) error { b, err := json.Marshal(v) t.union = b return err } -// MergeMintAddressCriterion performs a merge with any union data inside the SendSolTransactionCriteria_Item, using the provided MintAddressCriterion -func (t *SendSolTransactionCriteria_Item) MergeMintAddressCriterion(v MintAddressCriterion) error { +// MergeMintAddressCriterion performs a merge with any union data inside the SendEndUserSolTransactionCriteria_Item, using the provided MintAddressCriterion +func (t *SendEndUserSolTransactionCriteria_Item) MergeMintAddressCriterion(v MintAddressCriterion) error { b, err := json.Marshal(v) if err != nil { return err @@ -6494,22 +6731,22 @@ func (t *SendSolTransactionCriteria_Item) MergeMintAddressCriterion(v MintAddres return err } -// AsSolDataCriterion returns the union data inside the SendSolTransactionCriteria_Item as a SolDataCriterion -func (t SendSolTransactionCriteria_Item) AsSolDataCriterion() (SolDataCriterion, error) { +// AsSolDataCriterion returns the union data inside the SendEndUserSolTransactionCriteria_Item as a SolDataCriterion +func (t SendEndUserSolTransactionCriteria_Item) AsSolDataCriterion() (SolDataCriterion, error) { var body SolDataCriterion err := json.Unmarshal(t.union, &body) return body, err } -// FromSolDataCriterion overwrites any union data inside the SendSolTransactionCriteria_Item as the provided SolDataCriterion -func (t *SendSolTransactionCriteria_Item) FromSolDataCriterion(v SolDataCriterion) error { +// FromSolDataCriterion overwrites any union data inside the SendEndUserSolTransactionCriteria_Item as the provided SolDataCriterion +func (t *SendEndUserSolTransactionCriteria_Item) FromSolDataCriterion(v SolDataCriterion) error { b, err := json.Marshal(v) t.union = b return err } -// MergeSolDataCriterion performs a merge with any union data inside the SendSolTransactionCriteria_Item, using the provided SolDataCriterion -func (t *SendSolTransactionCriteria_Item) MergeSolDataCriterion(v SolDataCriterion) error { +// MergeSolDataCriterion performs a merge with any union data inside the SendEndUserSolTransactionCriteria_Item, using the provided SolDataCriterion +func (t *SendEndUserSolTransactionCriteria_Item) MergeSolDataCriterion(v SolDataCriterion) error { b, err := json.Marshal(v) if err != nil { return err @@ -6520,22 +6757,22 @@ func (t *SendSolTransactionCriteria_Item) MergeSolDataCriterion(v SolDataCriteri return err } -// AsProgramIdCriterion returns the union data inside the SendSolTransactionCriteria_Item as a ProgramIdCriterion -func (t SendSolTransactionCriteria_Item) AsProgramIdCriterion() (ProgramIdCriterion, error) { +// AsProgramIdCriterion returns the union data inside the SendEndUserSolTransactionCriteria_Item as a ProgramIdCriterion +func (t SendEndUserSolTransactionCriteria_Item) AsProgramIdCriterion() (ProgramIdCriterion, error) { var body ProgramIdCriterion err := json.Unmarshal(t.union, &body) return body, err } -// FromProgramIdCriterion overwrites any union data inside the SendSolTransactionCriteria_Item as the provided ProgramIdCriterion -func (t *SendSolTransactionCriteria_Item) FromProgramIdCriterion(v ProgramIdCriterion) error { +// FromProgramIdCriterion overwrites any union data inside the SendEndUserSolTransactionCriteria_Item as the provided ProgramIdCriterion +func (t *SendEndUserSolTransactionCriteria_Item) FromProgramIdCriterion(v ProgramIdCriterion) error { b, err := json.Marshal(v) t.union = b return err } -// MergeProgramIdCriterion performs a merge with any union data inside the SendSolTransactionCriteria_Item, using the provided ProgramIdCriterion -func (t *SendSolTransactionCriteria_Item) MergeProgramIdCriterion(v ProgramIdCriterion) error { +// MergeProgramIdCriterion performs a merge with any union data inside the SendEndUserSolTransactionCriteria_Item, using the provided ProgramIdCriterion +func (t *SendEndUserSolTransactionCriteria_Item) MergeProgramIdCriterion(v ProgramIdCriterion) error { b, err := json.Marshal(v) if err != nil { return err @@ -6546,22 +6783,22 @@ func (t *SendSolTransactionCriteria_Item) MergeProgramIdCriterion(v ProgramIdCri return err } -// AsSolNetworkCriterion returns the union data inside the SendSolTransactionCriteria_Item as a SolNetworkCriterion -func (t SendSolTransactionCriteria_Item) AsSolNetworkCriterion() (SolNetworkCriterion, error) { +// AsSolNetworkCriterion returns the union data inside the SendEndUserSolTransactionCriteria_Item as a SolNetworkCriterion +func (t SendEndUserSolTransactionCriteria_Item) AsSolNetworkCriterion() (SolNetworkCriterion, error) { var body SolNetworkCriterion err := json.Unmarshal(t.union, &body) return body, err } -// FromSolNetworkCriterion overwrites any union data inside the SendSolTransactionCriteria_Item as the provided SolNetworkCriterion -func (t *SendSolTransactionCriteria_Item) FromSolNetworkCriterion(v SolNetworkCriterion) error { +// FromSolNetworkCriterion overwrites any union data inside the SendEndUserSolTransactionCriteria_Item as the provided SolNetworkCriterion +func (t *SendEndUserSolTransactionCriteria_Item) FromSolNetworkCriterion(v SolNetworkCriterion) error { b, err := json.Marshal(v) t.union = b return err } -// MergeSolNetworkCriterion performs a merge with any union data inside the SendSolTransactionCriteria_Item, using the provided SolNetworkCriterion -func (t *SendSolTransactionCriteria_Item) MergeSolNetworkCriterion(v SolNetworkCriterion) error { +// MergeSolNetworkCriterion performs a merge with any union data inside the SendEndUserSolTransactionCriteria_Item, using the provided SolNetworkCriterion +func (t *SendEndUserSolTransactionCriteria_Item) MergeSolNetworkCriterion(v SolNetworkCriterion) error { b, err := json.Marshal(v) if err != nil { return err @@ -6572,32 +6809,32 @@ func (t *SendSolTransactionCriteria_Item) MergeSolNetworkCriterion(v SolNetworkC return err } -func (t SendSolTransactionCriteria_Item) MarshalJSON() ([]byte, error) { +func (t SendEndUserSolTransactionCriteria_Item) MarshalJSON() ([]byte, error) { b, err := t.union.MarshalJSON() return b, err } -func (t *SendSolTransactionCriteria_Item) UnmarshalJSON(b []byte) error { +func (t *SendEndUserSolTransactionCriteria_Item) UnmarshalJSON(b []byte) error { err := t.union.UnmarshalJSON(b) return err } -// AsEthValueCriterion returns the union data inside the SendUserOperationCriteria_Item as a EthValueCriterion -func (t SendUserOperationCriteria_Item) AsEthValueCriterion() (EthValueCriterion, error) { +// AsEthValueCriterion returns the union data inside the SendEvmTransactionCriteria_Item as a EthValueCriterion +func (t SendEvmTransactionCriteria_Item) AsEthValueCriterion() (EthValueCriterion, error) { var body EthValueCriterion err := json.Unmarshal(t.union, &body) return body, err } -// FromEthValueCriterion overwrites any union data inside the SendUserOperationCriteria_Item as the provided EthValueCriterion -func (t *SendUserOperationCriteria_Item) FromEthValueCriterion(v EthValueCriterion) error { +// FromEthValueCriterion overwrites any union data inside the SendEvmTransactionCriteria_Item as the provided EthValueCriterion +func (t *SendEvmTransactionCriteria_Item) FromEthValueCriterion(v EthValueCriterion) error { b, err := json.Marshal(v) t.union = b return err } -// MergeEthValueCriterion performs a merge with any union data inside the SendUserOperationCriteria_Item, using the provided EthValueCriterion -func (t *SendUserOperationCriteria_Item) MergeEthValueCriterion(v EthValueCriterion) error { +// MergeEthValueCriterion performs a merge with any union data inside the SendEvmTransactionCriteria_Item, using the provided EthValueCriterion +func (t *SendEvmTransactionCriteria_Item) MergeEthValueCriterion(v EthValueCriterion) error { b, err := json.Marshal(v) if err != nil { return err @@ -6608,22 +6845,22 @@ func (t *SendUserOperationCriteria_Item) MergeEthValueCriterion(v EthValueCriter return err } -// AsEvmAddressCriterion returns the union data inside the SendUserOperationCriteria_Item as a EvmAddressCriterion -func (t SendUserOperationCriteria_Item) AsEvmAddressCriterion() (EvmAddressCriterion, error) { +// AsEvmAddressCriterion returns the union data inside the SendEvmTransactionCriteria_Item as a EvmAddressCriterion +func (t SendEvmTransactionCriteria_Item) AsEvmAddressCriterion() (EvmAddressCriterion, error) { var body EvmAddressCriterion err := json.Unmarshal(t.union, &body) return body, err } -// FromEvmAddressCriterion overwrites any union data inside the SendUserOperationCriteria_Item as the provided EvmAddressCriterion -func (t *SendUserOperationCriteria_Item) FromEvmAddressCriterion(v EvmAddressCriterion) error { +// FromEvmAddressCriterion overwrites any union data inside the SendEvmTransactionCriteria_Item as the provided EvmAddressCriterion +func (t *SendEvmTransactionCriteria_Item) FromEvmAddressCriterion(v EvmAddressCriterion) error { b, err := json.Marshal(v) t.union = b return err } -// MergeEvmAddressCriterion performs a merge with any union data inside the SendUserOperationCriteria_Item, using the provided EvmAddressCriterion -func (t *SendUserOperationCriteria_Item) MergeEvmAddressCriterion(v EvmAddressCriterion) error { +// MergeEvmAddressCriterion performs a merge with any union data inside the SendEvmTransactionCriteria_Item, using the provided EvmAddressCriterion +func (t *SendEvmTransactionCriteria_Item) MergeEvmAddressCriterion(v EvmAddressCriterion) error { b, err := json.Marshal(v) if err != nil { return err @@ -6634,22 +6871,22 @@ func (t *SendUserOperationCriteria_Item) MergeEvmAddressCriterion(v EvmAddressCr return err } -// AsEvmDataCriterion returns the union data inside the SendUserOperationCriteria_Item as a EvmDataCriterion -func (t SendUserOperationCriteria_Item) AsEvmDataCriterion() (EvmDataCriterion, error) { - var body EvmDataCriterion +// AsEvmNetworkCriterion returns the union data inside the SendEvmTransactionCriteria_Item as a EvmNetworkCriterion +func (t SendEvmTransactionCriteria_Item) AsEvmNetworkCriterion() (EvmNetworkCriterion, error) { + var body EvmNetworkCriterion err := json.Unmarshal(t.union, &body) return body, err } -// FromEvmDataCriterion overwrites any union data inside the SendUserOperationCriteria_Item as the provided EvmDataCriterion -func (t *SendUserOperationCriteria_Item) FromEvmDataCriterion(v EvmDataCriterion) error { +// FromEvmNetworkCriterion overwrites any union data inside the SendEvmTransactionCriteria_Item as the provided EvmNetworkCriterion +func (t *SendEvmTransactionCriteria_Item) FromEvmNetworkCriterion(v EvmNetworkCriterion) error { b, err := json.Marshal(v) t.union = b return err } -// MergeEvmDataCriterion performs a merge with any union data inside the SendUserOperationCriteria_Item, using the provided EvmDataCriterion -func (t *SendUserOperationCriteria_Item) MergeEvmDataCriterion(v EvmDataCriterion) error { +// MergeEvmNetworkCriterion performs a merge with any union data inside the SendEvmTransactionCriteria_Item, using the provided EvmNetworkCriterion +func (t *SendEvmTransactionCriteria_Item) MergeEvmNetworkCriterion(v EvmNetworkCriterion) error { b, err := json.Marshal(v) if err != nil { return err @@ -6660,22 +6897,22 @@ func (t *SendUserOperationCriteria_Item) MergeEvmDataCriterion(v EvmDataCriterio return err } -// AsNetUSDChangeCriterion returns the union data inside the SendUserOperationCriteria_Item as a NetUSDChangeCriterion -func (t SendUserOperationCriteria_Item) AsNetUSDChangeCriterion() (NetUSDChangeCriterion, error) { - var body NetUSDChangeCriterion +// AsEvmDataCriterion returns the union data inside the SendEvmTransactionCriteria_Item as a EvmDataCriterion +func (t SendEvmTransactionCriteria_Item) AsEvmDataCriterion() (EvmDataCriterion, error) { + var body EvmDataCriterion err := json.Unmarshal(t.union, &body) return body, err } -// FromNetUSDChangeCriterion overwrites any union data inside the SendUserOperationCriteria_Item as the provided NetUSDChangeCriterion -func (t *SendUserOperationCriteria_Item) FromNetUSDChangeCriterion(v NetUSDChangeCriterion) error { +// FromEvmDataCriterion overwrites any union data inside the SendEvmTransactionCriteria_Item as the provided EvmDataCriterion +func (t *SendEvmTransactionCriteria_Item) FromEvmDataCriterion(v EvmDataCriterion) error { b, err := json.Marshal(v) t.union = b return err } -// MergeNetUSDChangeCriterion performs a merge with any union data inside the SendUserOperationCriteria_Item, using the provided NetUSDChangeCriterion -func (t *SendUserOperationCriteria_Item) MergeNetUSDChangeCriterion(v NetUSDChangeCriterion) error { +// MergeEvmDataCriterion performs a merge with any union data inside the SendEvmTransactionCriteria_Item, using the provided EvmDataCriterion +func (t *SendEvmTransactionCriteria_Item) MergeEvmDataCriterion(v EvmDataCriterion) error { b, err := json.Marshal(v) if err != nil { return err @@ -6686,32 +6923,22 @@ func (t *SendUserOperationCriteria_Item) MergeNetUSDChangeCriterion(v NetUSDChan return err } -func (t SendUserOperationCriteria_Item) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *SendUserOperationCriteria_Item) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsEvmMessageCriterion returns the union data inside the SignEndUserEvmMessageCriteria_Item as a EvmMessageCriterion -func (t SignEndUserEvmMessageCriteria_Item) AsEvmMessageCriterion() (EvmMessageCriterion, error) { - var body EvmMessageCriterion +// AsNetUSDChangeCriterion returns the union data inside the SendEvmTransactionCriteria_Item as a NetUSDChangeCriterion +func (t SendEvmTransactionCriteria_Item) AsNetUSDChangeCriterion() (NetUSDChangeCriterion, error) { + var body NetUSDChangeCriterion err := json.Unmarshal(t.union, &body) return body, err } -// FromEvmMessageCriterion overwrites any union data inside the SignEndUserEvmMessageCriteria_Item as the provided EvmMessageCriterion -func (t *SignEndUserEvmMessageCriteria_Item) FromEvmMessageCriterion(v EvmMessageCriterion) error { +// FromNetUSDChangeCriterion overwrites any union data inside the SendEvmTransactionCriteria_Item as the provided NetUSDChangeCriterion +func (t *SendEvmTransactionCriteria_Item) FromNetUSDChangeCriterion(v NetUSDChangeCriterion) error { b, err := json.Marshal(v) t.union = b return err } -// MergeEvmMessageCriterion performs a merge with any union data inside the SignEndUserEvmMessageCriteria_Item, using the provided EvmMessageCriterion -func (t *SignEndUserEvmMessageCriteria_Item) MergeEvmMessageCriterion(v EvmMessageCriterion) error { +// MergeNetUSDChangeCriterion performs a merge with any union data inside the SendEvmTransactionCriteria_Item, using the provided NetUSDChangeCriterion +func (t *SendEvmTransactionCriteria_Item) MergeNetUSDChangeCriterion(v NetUSDChangeCriterion) error { b, err := json.Marshal(v) if err != nil { return err @@ -6722,32 +6949,32 @@ func (t *SignEndUserEvmMessageCriteria_Item) MergeEvmMessageCriterion(v EvmMessa return err } -func (t SignEndUserEvmMessageCriteria_Item) MarshalJSON() ([]byte, error) { +func (t SendEvmTransactionCriteria_Item) MarshalJSON() ([]byte, error) { b, err := t.union.MarshalJSON() return b, err } -func (t *SignEndUserEvmMessageCriteria_Item) UnmarshalJSON(b []byte) error { +func (t *SendEvmTransactionCriteria_Item) UnmarshalJSON(b []byte) error { err := t.union.UnmarshalJSON(b) return err } -// AsEthValueCriterion returns the union data inside the SignEndUserEvmTransactionCriteria_Item as a EthValueCriterion -func (t SignEndUserEvmTransactionCriteria_Item) AsEthValueCriterion() (EthValueCriterion, error) { - var body EthValueCriterion +// AsSolAddressCriterion returns the union data inside the SendSolTransactionCriteria_Item as a SolAddressCriterion +func (t SendSolTransactionCriteria_Item) AsSolAddressCriterion() (SolAddressCriterion, error) { + var body SolAddressCriterion err := json.Unmarshal(t.union, &body) return body, err } -// FromEthValueCriterion overwrites any union data inside the SignEndUserEvmTransactionCriteria_Item as the provided EthValueCriterion -func (t *SignEndUserEvmTransactionCriteria_Item) FromEthValueCriterion(v EthValueCriterion) error { +// FromSolAddressCriterion overwrites any union data inside the SendSolTransactionCriteria_Item as the provided SolAddressCriterion +func (t *SendSolTransactionCriteria_Item) FromSolAddressCriterion(v SolAddressCriterion) error { b, err := json.Marshal(v) t.union = b return err } -// MergeEthValueCriterion performs a merge with any union data inside the SignEndUserEvmTransactionCriteria_Item, using the provided EthValueCriterion -func (t *SignEndUserEvmTransactionCriteria_Item) MergeEthValueCriterion(v EthValueCriterion) error { +// MergeSolAddressCriterion performs a merge with any union data inside the SendSolTransactionCriteria_Item, using the provided SolAddressCriterion +func (t *SendSolTransactionCriteria_Item) MergeSolAddressCriterion(v SolAddressCriterion) error { b, err := json.Marshal(v) if err != nil { return err @@ -6758,22 +6985,22 @@ func (t *SignEndUserEvmTransactionCriteria_Item) MergeEthValueCriterion(v EthVal return err } -// AsEvmAddressCriterion returns the union data inside the SignEndUserEvmTransactionCriteria_Item as a EvmAddressCriterion -func (t SignEndUserEvmTransactionCriteria_Item) AsEvmAddressCriterion() (EvmAddressCriterion, error) { - var body EvmAddressCriterion +// AsSolValueCriterion returns the union data inside the SendSolTransactionCriteria_Item as a SolValueCriterion +func (t SendSolTransactionCriteria_Item) AsSolValueCriterion() (SolValueCriterion, error) { + var body SolValueCriterion err := json.Unmarshal(t.union, &body) return body, err } -// FromEvmAddressCriterion overwrites any union data inside the SignEndUserEvmTransactionCriteria_Item as the provided EvmAddressCriterion -func (t *SignEndUserEvmTransactionCriteria_Item) FromEvmAddressCriterion(v EvmAddressCriterion) error { +// FromSolValueCriterion overwrites any union data inside the SendSolTransactionCriteria_Item as the provided SolValueCriterion +func (t *SendSolTransactionCriteria_Item) FromSolValueCriterion(v SolValueCriterion) error { b, err := json.Marshal(v) t.union = b return err } -// MergeEvmAddressCriterion performs a merge with any union data inside the SignEndUserEvmTransactionCriteria_Item, using the provided EvmAddressCriterion -func (t *SignEndUserEvmTransactionCriteria_Item) MergeEvmAddressCriterion(v EvmAddressCriterion) error { +// MergeSolValueCriterion performs a merge with any union data inside the SendSolTransactionCriteria_Item, using the provided SolValueCriterion +func (t *SendSolTransactionCriteria_Item) MergeSolValueCriterion(v SolValueCriterion) error { b, err := json.Marshal(v) if err != nil { return err @@ -6784,22 +7011,22 @@ func (t *SignEndUserEvmTransactionCriteria_Item) MergeEvmAddressCriterion(v EvmA return err } -// AsEvmDataCriterion returns the union data inside the SignEndUserEvmTransactionCriteria_Item as a EvmDataCriterion -func (t SignEndUserEvmTransactionCriteria_Item) AsEvmDataCriterion() (EvmDataCriterion, error) { - var body EvmDataCriterion +// AsSplAddressCriterion returns the union data inside the SendSolTransactionCriteria_Item as a SplAddressCriterion +func (t SendSolTransactionCriteria_Item) AsSplAddressCriterion() (SplAddressCriterion, error) { + var body SplAddressCriterion err := json.Unmarshal(t.union, &body) return body, err } -// FromEvmDataCriterion overwrites any union data inside the SignEndUserEvmTransactionCriteria_Item as the provided EvmDataCriterion -func (t *SignEndUserEvmTransactionCriteria_Item) FromEvmDataCriterion(v EvmDataCriterion) error { +// FromSplAddressCriterion overwrites any union data inside the SendSolTransactionCriteria_Item as the provided SplAddressCriterion +func (t *SendSolTransactionCriteria_Item) FromSplAddressCriterion(v SplAddressCriterion) error { b, err := json.Marshal(v) t.union = b return err } -// MergeEvmDataCriterion performs a merge with any union data inside the SignEndUserEvmTransactionCriteria_Item, using the provided EvmDataCriterion -func (t *SignEndUserEvmTransactionCriteria_Item) MergeEvmDataCriterion(v EvmDataCriterion) error { +// MergeSplAddressCriterion performs a merge with any union data inside the SendSolTransactionCriteria_Item, using the provided SplAddressCriterion +func (t *SendSolTransactionCriteria_Item) MergeSplAddressCriterion(v SplAddressCriterion) error { b, err := json.Marshal(v) if err != nil { return err @@ -6810,22 +7037,22 @@ func (t *SignEndUserEvmTransactionCriteria_Item) MergeEvmDataCriterion(v EvmData return err } -// AsNetUSDChangeCriterion returns the union data inside the SignEndUserEvmTransactionCriteria_Item as a NetUSDChangeCriterion -func (t SignEndUserEvmTransactionCriteria_Item) AsNetUSDChangeCriterion() (NetUSDChangeCriterion, error) { - var body NetUSDChangeCriterion +// AsSplValueCriterion returns the union data inside the SendSolTransactionCriteria_Item as a SplValueCriterion +func (t SendSolTransactionCriteria_Item) AsSplValueCriterion() (SplValueCriterion, error) { + var body SplValueCriterion err := json.Unmarshal(t.union, &body) return body, err } -// FromNetUSDChangeCriterion overwrites any union data inside the SignEndUserEvmTransactionCriteria_Item as the provided NetUSDChangeCriterion -func (t *SignEndUserEvmTransactionCriteria_Item) FromNetUSDChangeCriterion(v NetUSDChangeCriterion) error { +// FromSplValueCriterion overwrites any union data inside the SendSolTransactionCriteria_Item as the provided SplValueCriterion +func (t *SendSolTransactionCriteria_Item) FromSplValueCriterion(v SplValueCriterion) error { b, err := json.Marshal(v) t.union = b return err } -// MergeNetUSDChangeCriterion performs a merge with any union data inside the SignEndUserEvmTransactionCriteria_Item, using the provided NetUSDChangeCriterion -func (t *SignEndUserEvmTransactionCriteria_Item) MergeNetUSDChangeCriterion(v NetUSDChangeCriterion) error { +// MergeSplValueCriterion performs a merge with any union data inside the SendSolTransactionCriteria_Item, using the provided SplValueCriterion +func (t *SendSolTransactionCriteria_Item) MergeSplValueCriterion(v SplValueCriterion) error { b, err := json.Marshal(v) if err != nil { return err @@ -6836,32 +7063,22 @@ func (t *SignEndUserEvmTransactionCriteria_Item) MergeNetUSDChangeCriterion(v Ne return err } -func (t SignEndUserEvmTransactionCriteria_Item) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *SignEndUserEvmTransactionCriteria_Item) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsSignEvmTypedDataFieldCriterion returns the union data inside the SignEndUserEvmTypedDataCriteria_Item as a SignEvmTypedDataFieldCriterion -func (t SignEndUserEvmTypedDataCriteria_Item) AsSignEvmTypedDataFieldCriterion() (SignEvmTypedDataFieldCriterion, error) { - var body SignEvmTypedDataFieldCriterion +// AsMintAddressCriterion returns the union data inside the SendSolTransactionCriteria_Item as a MintAddressCriterion +func (t SendSolTransactionCriteria_Item) AsMintAddressCriterion() (MintAddressCriterion, error) { + var body MintAddressCriterion err := json.Unmarshal(t.union, &body) return body, err } -// FromSignEvmTypedDataFieldCriterion overwrites any union data inside the SignEndUserEvmTypedDataCriteria_Item as the provided SignEvmTypedDataFieldCriterion -func (t *SignEndUserEvmTypedDataCriteria_Item) FromSignEvmTypedDataFieldCriterion(v SignEvmTypedDataFieldCriterion) error { +// FromMintAddressCriterion overwrites any union data inside the SendSolTransactionCriteria_Item as the provided MintAddressCriterion +func (t *SendSolTransactionCriteria_Item) FromMintAddressCriterion(v MintAddressCriterion) error { b, err := json.Marshal(v) t.union = b return err } -// MergeSignEvmTypedDataFieldCriterion performs a merge with any union data inside the SignEndUserEvmTypedDataCriteria_Item, using the provided SignEvmTypedDataFieldCriterion -func (t *SignEndUserEvmTypedDataCriteria_Item) MergeSignEvmTypedDataFieldCriterion(v SignEvmTypedDataFieldCriterion) error { +// MergeMintAddressCriterion performs a merge with any union data inside the SendSolTransactionCriteria_Item, using the provided MintAddressCriterion +func (t *SendSolTransactionCriteria_Item) MergeMintAddressCriterion(v MintAddressCriterion) error { b, err := json.Marshal(v) if err != nil { return err @@ -6872,22 +7089,22 @@ func (t *SignEndUserEvmTypedDataCriteria_Item) MergeSignEvmTypedDataFieldCriteri return err } -// AsSignEvmTypedDataVerifyingContractCriterion returns the union data inside the SignEndUserEvmTypedDataCriteria_Item as a SignEvmTypedDataVerifyingContractCriterion -func (t SignEndUserEvmTypedDataCriteria_Item) AsSignEvmTypedDataVerifyingContractCriterion() (SignEvmTypedDataVerifyingContractCriterion, error) { - var body SignEvmTypedDataVerifyingContractCriterion +// AsSolDataCriterion returns the union data inside the SendSolTransactionCriteria_Item as a SolDataCriterion +func (t SendSolTransactionCriteria_Item) AsSolDataCriterion() (SolDataCriterion, error) { + var body SolDataCriterion err := json.Unmarshal(t.union, &body) return body, err } -// FromSignEvmTypedDataVerifyingContractCriterion overwrites any union data inside the SignEndUserEvmTypedDataCriteria_Item as the provided SignEvmTypedDataVerifyingContractCriterion -func (t *SignEndUserEvmTypedDataCriteria_Item) FromSignEvmTypedDataVerifyingContractCriterion(v SignEvmTypedDataVerifyingContractCriterion) error { +// FromSolDataCriterion overwrites any union data inside the SendSolTransactionCriteria_Item as the provided SolDataCriterion +func (t *SendSolTransactionCriteria_Item) FromSolDataCriterion(v SolDataCriterion) error { b, err := json.Marshal(v) t.union = b return err } -// MergeSignEvmTypedDataVerifyingContractCriterion performs a merge with any union data inside the SignEndUserEvmTypedDataCriteria_Item, using the provided SignEvmTypedDataVerifyingContractCriterion -func (t *SignEndUserEvmTypedDataCriteria_Item) MergeSignEvmTypedDataVerifyingContractCriterion(v SignEvmTypedDataVerifyingContractCriterion) error { +// MergeSolDataCriterion performs a merge with any union data inside the SendSolTransactionCriteria_Item, using the provided SolDataCriterion +func (t *SendSolTransactionCriteria_Item) MergeSolDataCriterion(v SolDataCriterion) error { b, err := json.Marshal(v) if err != nil { return err @@ -6898,32 +7115,22 @@ func (t *SignEndUserEvmTypedDataCriteria_Item) MergeSignEvmTypedDataVerifyingCon return err } -func (t SignEndUserEvmTypedDataCriteria_Item) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *SignEndUserEvmTypedDataCriteria_Item) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsSolMessageCriterion returns the union data inside the SignEndUserSolMessageCriteria_Item as a SolMessageCriterion -func (t SignEndUserSolMessageCriteria_Item) AsSolMessageCriterion() (SolMessageCriterion, error) { - var body SolMessageCriterion +// AsProgramIdCriterion returns the union data inside the SendSolTransactionCriteria_Item as a ProgramIdCriterion +func (t SendSolTransactionCriteria_Item) AsProgramIdCriterion() (ProgramIdCriterion, error) { + var body ProgramIdCriterion err := json.Unmarshal(t.union, &body) return body, err } -// FromSolMessageCriterion overwrites any union data inside the SignEndUserSolMessageCriteria_Item as the provided SolMessageCriterion -func (t *SignEndUserSolMessageCriteria_Item) FromSolMessageCriterion(v SolMessageCriterion) error { +// FromProgramIdCriterion overwrites any union data inside the SendSolTransactionCriteria_Item as the provided ProgramIdCriterion +func (t *SendSolTransactionCriteria_Item) FromProgramIdCriterion(v ProgramIdCriterion) error { b, err := json.Marshal(v) t.union = b return err } -// MergeSolMessageCriterion performs a merge with any union data inside the SignEndUserSolMessageCriteria_Item, using the provided SolMessageCriterion -func (t *SignEndUserSolMessageCriteria_Item) MergeSolMessageCriterion(v SolMessageCriterion) error { +// MergeProgramIdCriterion performs a merge with any union data inside the SendSolTransactionCriteria_Item, using the provided ProgramIdCriterion +func (t *SendSolTransactionCriteria_Item) MergeProgramIdCriterion(v ProgramIdCriterion) error { b, err := json.Marshal(v) if err != nil { return err @@ -6934,32 +7141,22 @@ func (t *SignEndUserSolMessageCriteria_Item) MergeSolMessageCriterion(v SolMessa return err } -func (t SignEndUserSolMessageCriteria_Item) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *SignEndUserSolMessageCriteria_Item) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsSolAddressCriterion returns the union data inside the SignEndUserSolTransactionCriteria_Item as a SolAddressCriterion -func (t SignEndUserSolTransactionCriteria_Item) AsSolAddressCriterion() (SolAddressCriterion, error) { - var body SolAddressCriterion +// AsSolNetworkCriterion returns the union data inside the SendSolTransactionCriteria_Item as a SolNetworkCriterion +func (t SendSolTransactionCriteria_Item) AsSolNetworkCriterion() (SolNetworkCriterion, error) { + var body SolNetworkCriterion err := json.Unmarshal(t.union, &body) return body, err } -// FromSolAddressCriterion overwrites any union data inside the SignEndUserSolTransactionCriteria_Item as the provided SolAddressCriterion -func (t *SignEndUserSolTransactionCriteria_Item) FromSolAddressCriterion(v SolAddressCriterion) error { +// FromSolNetworkCriterion overwrites any union data inside the SendSolTransactionCriteria_Item as the provided SolNetworkCriterion +func (t *SendSolTransactionCriteria_Item) FromSolNetworkCriterion(v SolNetworkCriterion) error { b, err := json.Marshal(v) t.union = b return err } -// MergeSolAddressCriterion performs a merge with any union data inside the SignEndUserSolTransactionCriteria_Item, using the provided SolAddressCriterion -func (t *SignEndUserSolTransactionCriteria_Item) MergeSolAddressCriterion(v SolAddressCriterion) error { +// MergeSolNetworkCriterion performs a merge with any union data inside the SendSolTransactionCriteria_Item, using the provided SolNetworkCriterion +func (t *SendSolTransactionCriteria_Item) MergeSolNetworkCriterion(v SolNetworkCriterion) error { b, err := json.Marshal(v) if err != nil { return err @@ -6970,22 +7167,32 @@ func (t *SignEndUserSolTransactionCriteria_Item) MergeSolAddressCriterion(v SolA return err } -// AsSolValueCriterion returns the union data inside the SignEndUserSolTransactionCriteria_Item as a SolValueCriterion -func (t SignEndUserSolTransactionCriteria_Item) AsSolValueCriterion() (SolValueCriterion, error) { - var body SolValueCriterion +func (t SendSolTransactionCriteria_Item) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *SendSolTransactionCriteria_Item) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsEthValueCriterion returns the union data inside the SendUserOperationCriteria_Item as a EthValueCriterion +func (t SendUserOperationCriteria_Item) AsEthValueCriterion() (EthValueCriterion, error) { + var body EthValueCriterion err := json.Unmarshal(t.union, &body) return body, err } -// FromSolValueCriterion overwrites any union data inside the SignEndUserSolTransactionCriteria_Item as the provided SolValueCriterion -func (t *SignEndUserSolTransactionCriteria_Item) FromSolValueCriterion(v SolValueCriterion) error { +// FromEthValueCriterion overwrites any union data inside the SendUserOperationCriteria_Item as the provided EthValueCriterion +func (t *SendUserOperationCriteria_Item) FromEthValueCriterion(v EthValueCriterion) error { b, err := json.Marshal(v) t.union = b return err } -// MergeSolValueCriterion performs a merge with any union data inside the SignEndUserSolTransactionCriteria_Item, using the provided SolValueCriterion -func (t *SignEndUserSolTransactionCriteria_Item) MergeSolValueCriterion(v SolValueCriterion) error { +// MergeEthValueCriterion performs a merge with any union data inside the SendUserOperationCriteria_Item, using the provided EthValueCriterion +func (t *SendUserOperationCriteria_Item) MergeEthValueCriterion(v EthValueCriterion) error { b, err := json.Marshal(v) if err != nil { return err @@ -6996,22 +7203,22 @@ func (t *SignEndUserSolTransactionCriteria_Item) MergeSolValueCriterion(v SolVal return err } -// AsSplAddressCriterion returns the union data inside the SignEndUserSolTransactionCriteria_Item as a SplAddressCriterion -func (t SignEndUserSolTransactionCriteria_Item) AsSplAddressCriterion() (SplAddressCriterion, error) { - var body SplAddressCriterion +// AsEvmAddressCriterion returns the union data inside the SendUserOperationCriteria_Item as a EvmAddressCriterion +func (t SendUserOperationCriteria_Item) AsEvmAddressCriterion() (EvmAddressCriterion, error) { + var body EvmAddressCriterion err := json.Unmarshal(t.union, &body) return body, err } -// FromSplAddressCriterion overwrites any union data inside the SignEndUserSolTransactionCriteria_Item as the provided SplAddressCriterion -func (t *SignEndUserSolTransactionCriteria_Item) FromSplAddressCriterion(v SplAddressCriterion) error { +// FromEvmAddressCriterion overwrites any union data inside the SendUserOperationCriteria_Item as the provided EvmAddressCriterion +func (t *SendUserOperationCriteria_Item) FromEvmAddressCriterion(v EvmAddressCriterion) error { b, err := json.Marshal(v) t.union = b return err } -// MergeSplAddressCriterion performs a merge with any union data inside the SignEndUserSolTransactionCriteria_Item, using the provided SplAddressCriterion -func (t *SignEndUserSolTransactionCriteria_Item) MergeSplAddressCriterion(v SplAddressCriterion) error { +// MergeEvmAddressCriterion performs a merge with any union data inside the SendUserOperationCriteria_Item, using the provided EvmAddressCriterion +func (t *SendUserOperationCriteria_Item) MergeEvmAddressCriterion(v EvmAddressCriterion) error { b, err := json.Marshal(v) if err != nil { return err @@ -7022,22 +7229,22 @@ func (t *SignEndUserSolTransactionCriteria_Item) MergeSplAddressCriterion(v SplA return err } -// AsSplValueCriterion returns the union data inside the SignEndUserSolTransactionCriteria_Item as a SplValueCriterion -func (t SignEndUserSolTransactionCriteria_Item) AsSplValueCriterion() (SplValueCriterion, error) { - var body SplValueCriterion +// AsEvmDataCriterion returns the union data inside the SendUserOperationCriteria_Item as a EvmDataCriterion +func (t SendUserOperationCriteria_Item) AsEvmDataCriterion() (EvmDataCriterion, error) { + var body EvmDataCriterion err := json.Unmarshal(t.union, &body) return body, err } -// FromSplValueCriterion overwrites any union data inside the SignEndUserSolTransactionCriteria_Item as the provided SplValueCriterion -func (t *SignEndUserSolTransactionCriteria_Item) FromSplValueCriterion(v SplValueCriterion) error { +// FromEvmDataCriterion overwrites any union data inside the SendUserOperationCriteria_Item as the provided EvmDataCriterion +func (t *SendUserOperationCriteria_Item) FromEvmDataCriterion(v EvmDataCriterion) error { b, err := json.Marshal(v) t.union = b return err } -// MergeSplValueCriterion performs a merge with any union data inside the SignEndUserSolTransactionCriteria_Item, using the provided SplValueCriterion -func (t *SignEndUserSolTransactionCriteria_Item) MergeSplValueCriterion(v SplValueCriterion) error { +// MergeEvmDataCriterion performs a merge with any union data inside the SendUserOperationCriteria_Item, using the provided EvmDataCriterion +func (t *SendUserOperationCriteria_Item) MergeEvmDataCriterion(v EvmDataCriterion) error { b, err := json.Marshal(v) if err != nil { return err @@ -7048,22 +7255,22 @@ func (t *SignEndUserSolTransactionCriteria_Item) MergeSplValueCriterion(v SplVal return err } -// AsMintAddressCriterion returns the union data inside the SignEndUserSolTransactionCriteria_Item as a MintAddressCriterion -func (t SignEndUserSolTransactionCriteria_Item) AsMintAddressCriterion() (MintAddressCriterion, error) { - var body MintAddressCriterion +// AsNetUSDChangeCriterion returns the union data inside the SendUserOperationCriteria_Item as a NetUSDChangeCriterion +func (t SendUserOperationCriteria_Item) AsNetUSDChangeCriterion() (NetUSDChangeCriterion, error) { + var body NetUSDChangeCriterion err := json.Unmarshal(t.union, &body) return body, err } -// FromMintAddressCriterion overwrites any union data inside the SignEndUserSolTransactionCriteria_Item as the provided MintAddressCriterion -func (t *SignEndUserSolTransactionCriteria_Item) FromMintAddressCriterion(v MintAddressCriterion) error { +// FromNetUSDChangeCriterion overwrites any union data inside the SendUserOperationCriteria_Item as the provided NetUSDChangeCriterion +func (t *SendUserOperationCriteria_Item) FromNetUSDChangeCriterion(v NetUSDChangeCriterion) error { b, err := json.Marshal(v) t.union = b return err } -// MergeMintAddressCriterion performs a merge with any union data inside the SignEndUserSolTransactionCriteria_Item, using the provided MintAddressCriterion -func (t *SignEndUserSolTransactionCriteria_Item) MergeMintAddressCriterion(v MintAddressCriterion) error { +// MergeNetUSDChangeCriterion performs a merge with any union data inside the SendUserOperationCriteria_Item, using the provided NetUSDChangeCriterion +func (t *SendUserOperationCriteria_Item) MergeNetUSDChangeCriterion(v NetUSDChangeCriterion) error { b, err := json.Marshal(v) if err != nil { return err @@ -7074,22 +7281,32 @@ func (t *SignEndUserSolTransactionCriteria_Item) MergeMintAddressCriterion(v Min return err } -// AsSolDataCriterion returns the union data inside the SignEndUserSolTransactionCriteria_Item as a SolDataCriterion -func (t SignEndUserSolTransactionCriteria_Item) AsSolDataCriterion() (SolDataCriterion, error) { - var body SolDataCriterion +func (t SendUserOperationCriteria_Item) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *SendUserOperationCriteria_Item) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsEvmMessageCriterion returns the union data inside the SignEndUserEvmMessageCriteria_Item as a EvmMessageCriterion +func (t SignEndUserEvmMessageCriteria_Item) AsEvmMessageCriterion() (EvmMessageCriterion, error) { + var body EvmMessageCriterion err := json.Unmarshal(t.union, &body) return body, err } -// FromSolDataCriterion overwrites any union data inside the SignEndUserSolTransactionCriteria_Item as the provided SolDataCriterion -func (t *SignEndUserSolTransactionCriteria_Item) FromSolDataCriterion(v SolDataCriterion) error { +// FromEvmMessageCriterion overwrites any union data inside the SignEndUserEvmMessageCriteria_Item as the provided EvmMessageCriterion +func (t *SignEndUserEvmMessageCriteria_Item) FromEvmMessageCriterion(v EvmMessageCriterion) error { b, err := json.Marshal(v) t.union = b return err } -// MergeSolDataCriterion performs a merge with any union data inside the SignEndUserSolTransactionCriteria_Item, using the provided SolDataCriterion -func (t *SignEndUserSolTransactionCriteria_Item) MergeSolDataCriterion(v SolDataCriterion) error { +// MergeEvmMessageCriterion performs a merge with any union data inside the SignEndUserEvmMessageCriteria_Item, using the provided EvmMessageCriterion +func (t *SignEndUserEvmMessageCriteria_Item) MergeEvmMessageCriterion(v EvmMessageCriterion) error { b, err := json.Marshal(v) if err != nil { return err @@ -7100,94 +7317,32 @@ func (t *SignEndUserSolTransactionCriteria_Item) MergeSolDataCriterion(v SolData return err } -// AsProgramIdCriterion returns the union data inside the SignEndUserSolTransactionCriteria_Item as a ProgramIdCriterion -func (t SignEndUserSolTransactionCriteria_Item) AsProgramIdCriterion() (ProgramIdCriterion, error) { - var body ProgramIdCriterion - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromProgramIdCriterion overwrites any union data inside the SignEndUserSolTransactionCriteria_Item as the provided ProgramIdCriterion -func (t *SignEndUserSolTransactionCriteria_Item) FromProgramIdCriterion(v ProgramIdCriterion) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeProgramIdCriterion performs a merge with any union data inside the SignEndUserSolTransactionCriteria_Item, using the provided ProgramIdCriterion -func (t *SignEndUserSolTransactionCriteria_Item) MergeProgramIdCriterion(v ProgramIdCriterion) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JsonMerge(t.union, b) - t.union = merged - return err -} - -func (t SignEndUserSolTransactionCriteria_Item) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *SignEndUserSolTransactionCriteria_Item) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsEvmMessageCriterion returns the union data inside the SignEvmMessageCriteria_Item as a EvmMessageCriterion -func (t SignEvmMessageCriteria_Item) AsEvmMessageCriterion() (EvmMessageCriterion, error) { - var body EvmMessageCriterion - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromEvmMessageCriterion overwrites any union data inside the SignEvmMessageCriteria_Item as the provided EvmMessageCriterion -func (t *SignEvmMessageCriteria_Item) FromEvmMessageCriterion(v EvmMessageCriterion) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeEvmMessageCriterion performs a merge with any union data inside the SignEvmMessageCriteria_Item, using the provided EvmMessageCriterion -func (t *SignEvmMessageCriteria_Item) MergeEvmMessageCriterion(v EvmMessageCriterion) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JsonMerge(t.union, b) - t.union = merged - return err -} - -func (t SignEvmMessageCriteria_Item) MarshalJSON() ([]byte, error) { +func (t SignEndUserEvmMessageCriteria_Item) MarshalJSON() ([]byte, error) { b, err := t.union.MarshalJSON() return b, err } -func (t *SignEvmMessageCriteria_Item) UnmarshalJSON(b []byte) error { +func (t *SignEndUserEvmMessageCriteria_Item) UnmarshalJSON(b []byte) error { err := t.union.UnmarshalJSON(b) return err } -// AsEthValueCriterion returns the union data inside the SignEvmTransactionCriteria_Item as a EthValueCriterion -func (t SignEvmTransactionCriteria_Item) AsEthValueCriterion() (EthValueCriterion, error) { +// AsEthValueCriterion returns the union data inside the SignEndUserEvmTransactionCriteria_Item as a EthValueCriterion +func (t SignEndUserEvmTransactionCriteria_Item) AsEthValueCriterion() (EthValueCriterion, error) { var body EthValueCriterion err := json.Unmarshal(t.union, &body) return body, err } -// FromEthValueCriterion overwrites any union data inside the SignEvmTransactionCriteria_Item as the provided EthValueCriterion -func (t *SignEvmTransactionCriteria_Item) FromEthValueCriterion(v EthValueCriterion) error { +// FromEthValueCriterion overwrites any union data inside the SignEndUserEvmTransactionCriteria_Item as the provided EthValueCriterion +func (t *SignEndUserEvmTransactionCriteria_Item) FromEthValueCriterion(v EthValueCriterion) error { b, err := json.Marshal(v) t.union = b return err } -// MergeEthValueCriterion performs a merge with any union data inside the SignEvmTransactionCriteria_Item, using the provided EthValueCriterion -func (t *SignEvmTransactionCriteria_Item) MergeEthValueCriterion(v EthValueCriterion) error { +// MergeEthValueCriterion performs a merge with any union data inside the SignEndUserEvmTransactionCriteria_Item, using the provided EthValueCriterion +func (t *SignEndUserEvmTransactionCriteria_Item) MergeEthValueCriterion(v EthValueCriterion) error { b, err := json.Marshal(v) if err != nil { return err @@ -7198,22 +7353,22 @@ func (t *SignEvmTransactionCriteria_Item) MergeEthValueCriterion(v EthValueCrite return err } -// AsEvmAddressCriterion returns the union data inside the SignEvmTransactionCriteria_Item as a EvmAddressCriterion -func (t SignEvmTransactionCriteria_Item) AsEvmAddressCriterion() (EvmAddressCriterion, error) { +// AsEvmAddressCriterion returns the union data inside the SignEndUserEvmTransactionCriteria_Item as a EvmAddressCriterion +func (t SignEndUserEvmTransactionCriteria_Item) AsEvmAddressCriterion() (EvmAddressCriterion, error) { var body EvmAddressCriterion err := json.Unmarshal(t.union, &body) return body, err } -// FromEvmAddressCriterion overwrites any union data inside the SignEvmTransactionCriteria_Item as the provided EvmAddressCriterion -func (t *SignEvmTransactionCriteria_Item) FromEvmAddressCriterion(v EvmAddressCriterion) error { +// FromEvmAddressCriterion overwrites any union data inside the SignEndUserEvmTransactionCriteria_Item as the provided EvmAddressCriterion +func (t *SignEndUserEvmTransactionCriteria_Item) FromEvmAddressCriterion(v EvmAddressCriterion) error { b, err := json.Marshal(v) t.union = b return err } -// MergeEvmAddressCriterion performs a merge with any union data inside the SignEvmTransactionCriteria_Item, using the provided EvmAddressCriterion -func (t *SignEvmTransactionCriteria_Item) MergeEvmAddressCriterion(v EvmAddressCriterion) error { +// MergeEvmAddressCriterion performs a merge with any union data inside the SignEndUserEvmTransactionCriteria_Item, using the provided EvmAddressCriterion +func (t *SignEndUserEvmTransactionCriteria_Item) MergeEvmAddressCriterion(v EvmAddressCriterion) error { b, err := json.Marshal(v) if err != nil { return err @@ -7224,22 +7379,22 @@ func (t *SignEvmTransactionCriteria_Item) MergeEvmAddressCriterion(v EvmAddressC return err } -// AsEvmDataCriterion returns the union data inside the SignEvmTransactionCriteria_Item as a EvmDataCriterion -func (t SignEvmTransactionCriteria_Item) AsEvmDataCriterion() (EvmDataCriterion, error) { +// AsEvmDataCriterion returns the union data inside the SignEndUserEvmTransactionCriteria_Item as a EvmDataCriterion +func (t SignEndUserEvmTransactionCriteria_Item) AsEvmDataCriterion() (EvmDataCriterion, error) { var body EvmDataCriterion err := json.Unmarshal(t.union, &body) return body, err } -// FromEvmDataCriterion overwrites any union data inside the SignEvmTransactionCriteria_Item as the provided EvmDataCriterion -func (t *SignEvmTransactionCriteria_Item) FromEvmDataCriterion(v EvmDataCriterion) error { +// FromEvmDataCriterion overwrites any union data inside the SignEndUserEvmTransactionCriteria_Item as the provided EvmDataCriterion +func (t *SignEndUserEvmTransactionCriteria_Item) FromEvmDataCriterion(v EvmDataCriterion) error { b, err := json.Marshal(v) t.union = b return err } -// MergeEvmDataCriterion performs a merge with any union data inside the SignEvmTransactionCriteria_Item, using the provided EvmDataCriterion -func (t *SignEvmTransactionCriteria_Item) MergeEvmDataCriterion(v EvmDataCriterion) error { +// MergeEvmDataCriterion performs a merge with any union data inside the SignEndUserEvmTransactionCriteria_Item, using the provided EvmDataCriterion +func (t *SignEndUserEvmTransactionCriteria_Item) MergeEvmDataCriterion(v EvmDataCriterion) error { b, err := json.Marshal(v) if err != nil { return err @@ -7250,22 +7405,22 @@ func (t *SignEvmTransactionCriteria_Item) MergeEvmDataCriterion(v EvmDataCriteri return err } -// AsNetUSDChangeCriterion returns the union data inside the SignEvmTransactionCriteria_Item as a NetUSDChangeCriterion -func (t SignEvmTransactionCriteria_Item) AsNetUSDChangeCriterion() (NetUSDChangeCriterion, error) { +// AsNetUSDChangeCriterion returns the union data inside the SignEndUserEvmTransactionCriteria_Item as a NetUSDChangeCriterion +func (t SignEndUserEvmTransactionCriteria_Item) AsNetUSDChangeCriterion() (NetUSDChangeCriterion, error) { var body NetUSDChangeCriterion err := json.Unmarshal(t.union, &body) return body, err } -// FromNetUSDChangeCriterion overwrites any union data inside the SignEvmTransactionCriteria_Item as the provided NetUSDChangeCriterion -func (t *SignEvmTransactionCriteria_Item) FromNetUSDChangeCriterion(v NetUSDChangeCriterion) error { +// FromNetUSDChangeCriterion overwrites any union data inside the SignEndUserEvmTransactionCriteria_Item as the provided NetUSDChangeCriterion +func (t *SignEndUserEvmTransactionCriteria_Item) FromNetUSDChangeCriterion(v NetUSDChangeCriterion) error { b, err := json.Marshal(v) t.union = b return err } -// MergeNetUSDChangeCriterion performs a merge with any union data inside the SignEvmTransactionCriteria_Item, using the provided NetUSDChangeCriterion -func (t *SignEvmTransactionCriteria_Item) MergeNetUSDChangeCriterion(v NetUSDChangeCriterion) error { +// MergeNetUSDChangeCriterion performs a merge with any union data inside the SignEndUserEvmTransactionCriteria_Item, using the provided NetUSDChangeCriterion +func (t *SignEndUserEvmTransactionCriteria_Item) MergeNetUSDChangeCriterion(v NetUSDChangeCriterion) error { b, err := json.Marshal(v) if err != nil { return err @@ -7276,32 +7431,32 @@ func (t *SignEvmTransactionCriteria_Item) MergeNetUSDChangeCriterion(v NetUSDCha return err } -func (t SignEvmTransactionCriteria_Item) MarshalJSON() ([]byte, error) { +func (t SignEndUserEvmTransactionCriteria_Item) MarshalJSON() ([]byte, error) { b, err := t.union.MarshalJSON() return b, err } -func (t *SignEvmTransactionCriteria_Item) UnmarshalJSON(b []byte) error { +func (t *SignEndUserEvmTransactionCriteria_Item) UnmarshalJSON(b []byte) error { err := t.union.UnmarshalJSON(b) return err } -// AsSignEvmTypedDataFieldCriterion returns the union data inside the SignEvmTypedDataCriteria_Item as a SignEvmTypedDataFieldCriterion -func (t SignEvmTypedDataCriteria_Item) AsSignEvmTypedDataFieldCriterion() (SignEvmTypedDataFieldCriterion, error) { +// AsSignEvmTypedDataFieldCriterion returns the union data inside the SignEndUserEvmTypedDataCriteria_Item as a SignEvmTypedDataFieldCriterion +func (t SignEndUserEvmTypedDataCriteria_Item) AsSignEvmTypedDataFieldCriterion() (SignEvmTypedDataFieldCriterion, error) { var body SignEvmTypedDataFieldCriterion err := json.Unmarshal(t.union, &body) return body, err } -// FromSignEvmTypedDataFieldCriterion overwrites any union data inside the SignEvmTypedDataCriteria_Item as the provided SignEvmTypedDataFieldCriterion -func (t *SignEvmTypedDataCriteria_Item) FromSignEvmTypedDataFieldCriterion(v SignEvmTypedDataFieldCriterion) error { +// FromSignEvmTypedDataFieldCriterion overwrites any union data inside the SignEndUserEvmTypedDataCriteria_Item as the provided SignEvmTypedDataFieldCriterion +func (t *SignEndUserEvmTypedDataCriteria_Item) FromSignEvmTypedDataFieldCriterion(v SignEvmTypedDataFieldCriterion) error { b, err := json.Marshal(v) t.union = b return err } -// MergeSignEvmTypedDataFieldCriterion performs a merge with any union data inside the SignEvmTypedDataCriteria_Item, using the provided SignEvmTypedDataFieldCriterion -func (t *SignEvmTypedDataCriteria_Item) MergeSignEvmTypedDataFieldCriterion(v SignEvmTypedDataFieldCriterion) error { +// MergeSignEvmTypedDataFieldCriterion performs a merge with any union data inside the SignEndUserEvmTypedDataCriteria_Item, using the provided SignEvmTypedDataFieldCriterion +func (t *SignEndUserEvmTypedDataCriteria_Item) MergeSignEvmTypedDataFieldCriterion(v SignEvmTypedDataFieldCriterion) error { b, err := json.Marshal(v) if err != nil { return err @@ -7312,22 +7467,22 @@ func (t *SignEvmTypedDataCriteria_Item) MergeSignEvmTypedDataFieldCriterion(v Si return err } -// AsSignEvmTypedDataVerifyingContractCriterion returns the union data inside the SignEvmTypedDataCriteria_Item as a SignEvmTypedDataVerifyingContractCriterion -func (t SignEvmTypedDataCriteria_Item) AsSignEvmTypedDataVerifyingContractCriterion() (SignEvmTypedDataVerifyingContractCriterion, error) { +// AsSignEvmTypedDataVerifyingContractCriterion returns the union data inside the SignEndUserEvmTypedDataCriteria_Item as a SignEvmTypedDataVerifyingContractCriterion +func (t SignEndUserEvmTypedDataCriteria_Item) AsSignEvmTypedDataVerifyingContractCriterion() (SignEvmTypedDataVerifyingContractCriterion, error) { var body SignEvmTypedDataVerifyingContractCriterion err := json.Unmarshal(t.union, &body) return body, err } -// FromSignEvmTypedDataVerifyingContractCriterion overwrites any union data inside the SignEvmTypedDataCriteria_Item as the provided SignEvmTypedDataVerifyingContractCriterion -func (t *SignEvmTypedDataCriteria_Item) FromSignEvmTypedDataVerifyingContractCriterion(v SignEvmTypedDataVerifyingContractCriterion) error { +// FromSignEvmTypedDataVerifyingContractCriterion overwrites any union data inside the SignEndUserEvmTypedDataCriteria_Item as the provided SignEvmTypedDataVerifyingContractCriterion +func (t *SignEndUserEvmTypedDataCriteria_Item) FromSignEvmTypedDataVerifyingContractCriterion(v SignEvmTypedDataVerifyingContractCriterion) error { b, err := json.Marshal(v) t.union = b return err } -// MergeSignEvmTypedDataVerifyingContractCriterion performs a merge with any union data inside the SignEvmTypedDataCriteria_Item, using the provided SignEvmTypedDataVerifyingContractCriterion -func (t *SignEvmTypedDataCriteria_Item) MergeSignEvmTypedDataVerifyingContractCriterion(v SignEvmTypedDataVerifyingContractCriterion) error { +// MergeSignEvmTypedDataVerifyingContractCriterion performs a merge with any union data inside the SignEndUserEvmTypedDataCriteria_Item, using the provided SignEvmTypedDataVerifyingContractCriterion +func (t *SignEndUserEvmTypedDataCriteria_Item) MergeSignEvmTypedDataVerifyingContractCriterion(v SignEvmTypedDataVerifyingContractCriterion) error { b, err := json.Marshal(v) if err != nil { return err @@ -7338,32 +7493,32 @@ func (t *SignEvmTypedDataCriteria_Item) MergeSignEvmTypedDataVerifyingContractCr return err } -func (t SignEvmTypedDataCriteria_Item) MarshalJSON() ([]byte, error) { +func (t SignEndUserEvmTypedDataCriteria_Item) MarshalJSON() ([]byte, error) { b, err := t.union.MarshalJSON() return b, err } -func (t *SignEvmTypedDataCriteria_Item) UnmarshalJSON(b []byte) error { +func (t *SignEndUserEvmTypedDataCriteria_Item) UnmarshalJSON(b []byte) error { err := t.union.UnmarshalJSON(b) return err } -// AsEvmTypedAddressCondition returns the union data inside the SignEvmTypedDataFieldCriterion_Conditions_Item as a EvmTypedAddressCondition -func (t SignEvmTypedDataFieldCriterion_Conditions_Item) AsEvmTypedAddressCondition() (EvmTypedAddressCondition, error) { - var body EvmTypedAddressCondition +// AsSolMessageCriterion returns the union data inside the SignEndUserSolMessageCriteria_Item as a SolMessageCriterion +func (t SignEndUserSolMessageCriteria_Item) AsSolMessageCriterion() (SolMessageCriterion, error) { + var body SolMessageCriterion err := json.Unmarshal(t.union, &body) return body, err } -// FromEvmTypedAddressCondition overwrites any union data inside the SignEvmTypedDataFieldCriterion_Conditions_Item as the provided EvmTypedAddressCondition -func (t *SignEvmTypedDataFieldCriterion_Conditions_Item) FromEvmTypedAddressCondition(v EvmTypedAddressCondition) error { +// FromSolMessageCriterion overwrites any union data inside the SignEndUserSolMessageCriteria_Item as the provided SolMessageCriterion +func (t *SignEndUserSolMessageCriteria_Item) FromSolMessageCriterion(v SolMessageCriterion) error { b, err := json.Marshal(v) t.union = b return err } -// MergeEvmTypedAddressCondition performs a merge with any union data inside the SignEvmTypedDataFieldCriterion_Conditions_Item, using the provided EvmTypedAddressCondition -func (t *SignEvmTypedDataFieldCriterion_Conditions_Item) MergeEvmTypedAddressCondition(v EvmTypedAddressCondition) error { +// MergeSolMessageCriterion performs a merge with any union data inside the SignEndUserSolMessageCriteria_Item, using the provided SolMessageCriterion +func (t *SignEndUserSolMessageCriteria_Item) MergeSolMessageCriterion(v SolMessageCriterion) error { b, err := json.Marshal(v) if err != nil { return err @@ -7374,22 +7529,32 @@ func (t *SignEvmTypedDataFieldCriterion_Conditions_Item) MergeEvmTypedAddressCon return err } -// AsEvmTypedNumericalCondition returns the union data inside the SignEvmTypedDataFieldCriterion_Conditions_Item as a EvmTypedNumericalCondition -func (t SignEvmTypedDataFieldCriterion_Conditions_Item) AsEvmTypedNumericalCondition() (EvmTypedNumericalCondition, error) { - var body EvmTypedNumericalCondition +func (t SignEndUserSolMessageCriteria_Item) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *SignEndUserSolMessageCriteria_Item) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsSolAddressCriterion returns the union data inside the SignEndUserSolTransactionCriteria_Item as a SolAddressCriterion +func (t SignEndUserSolTransactionCriteria_Item) AsSolAddressCriterion() (SolAddressCriterion, error) { + var body SolAddressCriterion err := json.Unmarshal(t.union, &body) return body, err } -// FromEvmTypedNumericalCondition overwrites any union data inside the SignEvmTypedDataFieldCriterion_Conditions_Item as the provided EvmTypedNumericalCondition -func (t *SignEvmTypedDataFieldCriterion_Conditions_Item) FromEvmTypedNumericalCondition(v EvmTypedNumericalCondition) error { +// FromSolAddressCriterion overwrites any union data inside the SignEndUserSolTransactionCriteria_Item as the provided SolAddressCriterion +func (t *SignEndUserSolTransactionCriteria_Item) FromSolAddressCriterion(v SolAddressCriterion) error { b, err := json.Marshal(v) t.union = b return err } -// MergeEvmTypedNumericalCondition performs a merge with any union data inside the SignEvmTypedDataFieldCriterion_Conditions_Item, using the provided EvmTypedNumericalCondition -func (t *SignEvmTypedDataFieldCriterion_Conditions_Item) MergeEvmTypedNumericalCondition(v EvmTypedNumericalCondition) error { +// MergeSolAddressCriterion performs a merge with any union data inside the SignEndUserSolTransactionCriteria_Item, using the provided SolAddressCriterion +func (t *SignEndUserSolTransactionCriteria_Item) MergeSolAddressCriterion(v SolAddressCriterion) error { b, err := json.Marshal(v) if err != nil { return err @@ -7400,22 +7565,22 @@ func (t *SignEvmTypedDataFieldCriterion_Conditions_Item) MergeEvmTypedNumericalC return err } -// AsEvmTypedStringCondition returns the union data inside the SignEvmTypedDataFieldCriterion_Conditions_Item as a EvmTypedStringCondition -func (t SignEvmTypedDataFieldCriterion_Conditions_Item) AsEvmTypedStringCondition() (EvmTypedStringCondition, error) { - var body EvmTypedStringCondition +// AsSolValueCriterion returns the union data inside the SignEndUserSolTransactionCriteria_Item as a SolValueCriterion +func (t SignEndUserSolTransactionCriteria_Item) AsSolValueCriterion() (SolValueCriterion, error) { + var body SolValueCriterion err := json.Unmarshal(t.union, &body) return body, err } -// FromEvmTypedStringCondition overwrites any union data inside the SignEvmTypedDataFieldCriterion_Conditions_Item as the provided EvmTypedStringCondition -func (t *SignEvmTypedDataFieldCriterion_Conditions_Item) FromEvmTypedStringCondition(v EvmTypedStringCondition) error { +// FromSolValueCriterion overwrites any union data inside the SignEndUserSolTransactionCriteria_Item as the provided SolValueCriterion +func (t *SignEndUserSolTransactionCriteria_Item) FromSolValueCriterion(v SolValueCriterion) error { b, err := json.Marshal(v) t.union = b return err } -// MergeEvmTypedStringCondition performs a merge with any union data inside the SignEvmTypedDataFieldCriterion_Conditions_Item, using the provided EvmTypedStringCondition -func (t *SignEvmTypedDataFieldCriterion_Conditions_Item) MergeEvmTypedStringCondition(v EvmTypedStringCondition) error { +// MergeSolValueCriterion performs a merge with any union data inside the SignEndUserSolTransactionCriteria_Item, using the provided SolValueCriterion +func (t *SignEndUserSolTransactionCriteria_Item) MergeSolValueCriterion(v SolValueCriterion) error { b, err := json.Marshal(v) if err != nil { return err @@ -7426,32 +7591,22 @@ func (t *SignEvmTypedDataFieldCriterion_Conditions_Item) MergeEvmTypedStringCond return err } -func (t SignEvmTypedDataFieldCriterion_Conditions_Item) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *SignEvmTypedDataFieldCriterion_Conditions_Item) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsSolMessageCriterion returns the union data inside the SignSolMessageCriteria_Item as a SolMessageCriterion -func (t SignSolMessageCriteria_Item) AsSolMessageCriterion() (SolMessageCriterion, error) { - var body SolMessageCriterion +// AsSplAddressCriterion returns the union data inside the SignEndUserSolTransactionCriteria_Item as a SplAddressCriterion +func (t SignEndUserSolTransactionCriteria_Item) AsSplAddressCriterion() (SplAddressCriterion, error) { + var body SplAddressCriterion err := json.Unmarshal(t.union, &body) return body, err } -// FromSolMessageCriterion overwrites any union data inside the SignSolMessageCriteria_Item as the provided SolMessageCriterion -func (t *SignSolMessageCriteria_Item) FromSolMessageCriterion(v SolMessageCriterion) error { +// FromSplAddressCriterion overwrites any union data inside the SignEndUserSolTransactionCriteria_Item as the provided SplAddressCriterion +func (t *SignEndUserSolTransactionCriteria_Item) FromSplAddressCriterion(v SplAddressCriterion) error { b, err := json.Marshal(v) t.union = b return err } -// MergeSolMessageCriterion performs a merge with any union data inside the SignSolMessageCriteria_Item, using the provided SolMessageCriterion -func (t *SignSolMessageCriteria_Item) MergeSolMessageCriterion(v SolMessageCriterion) error { +// MergeSplAddressCriterion performs a merge with any union data inside the SignEndUserSolTransactionCriteria_Item, using the provided SplAddressCriterion +func (t *SignEndUserSolTransactionCriteria_Item) MergeSplAddressCriterion(v SplAddressCriterion) error { b, err := json.Marshal(v) if err != nil { return err @@ -7462,32 +7617,22 @@ func (t *SignSolMessageCriteria_Item) MergeSolMessageCriterion(v SolMessageCrite return err } -func (t SignSolMessageCriteria_Item) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *SignSolMessageCriteria_Item) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsSolAddressCriterion returns the union data inside the SignSolTransactionCriteria_Item as a SolAddressCriterion -func (t SignSolTransactionCriteria_Item) AsSolAddressCriterion() (SolAddressCriterion, error) { - var body SolAddressCriterion +// AsSplValueCriterion returns the union data inside the SignEndUserSolTransactionCriteria_Item as a SplValueCriterion +func (t SignEndUserSolTransactionCriteria_Item) AsSplValueCriterion() (SplValueCriterion, error) { + var body SplValueCriterion err := json.Unmarshal(t.union, &body) return body, err } -// FromSolAddressCriterion overwrites any union data inside the SignSolTransactionCriteria_Item as the provided SolAddressCriterion -func (t *SignSolTransactionCriteria_Item) FromSolAddressCriterion(v SolAddressCriterion) error { +// FromSplValueCriterion overwrites any union data inside the SignEndUserSolTransactionCriteria_Item as the provided SplValueCriterion +func (t *SignEndUserSolTransactionCriteria_Item) FromSplValueCriterion(v SplValueCriterion) error { b, err := json.Marshal(v) t.union = b return err } -// MergeSolAddressCriterion performs a merge with any union data inside the SignSolTransactionCriteria_Item, using the provided SolAddressCriterion -func (t *SignSolTransactionCriteria_Item) MergeSolAddressCriterion(v SolAddressCriterion) error { +// MergeSplValueCriterion performs a merge with any union data inside the SignEndUserSolTransactionCriteria_Item, using the provided SplValueCriterion +func (t *SignEndUserSolTransactionCriteria_Item) MergeSplValueCriterion(v SplValueCriterion) error { b, err := json.Marshal(v) if err != nil { return err @@ -7498,22 +7643,22 @@ func (t *SignSolTransactionCriteria_Item) MergeSolAddressCriterion(v SolAddressC return err } -// AsSolValueCriterion returns the union data inside the SignSolTransactionCriteria_Item as a SolValueCriterion -func (t SignSolTransactionCriteria_Item) AsSolValueCriterion() (SolValueCriterion, error) { - var body SolValueCriterion +// AsMintAddressCriterion returns the union data inside the SignEndUserSolTransactionCriteria_Item as a MintAddressCriterion +func (t SignEndUserSolTransactionCriteria_Item) AsMintAddressCriterion() (MintAddressCriterion, error) { + var body MintAddressCriterion err := json.Unmarshal(t.union, &body) return body, err } -// FromSolValueCriterion overwrites any union data inside the SignSolTransactionCriteria_Item as the provided SolValueCriterion -func (t *SignSolTransactionCriteria_Item) FromSolValueCriterion(v SolValueCriterion) error { +// FromMintAddressCriterion overwrites any union data inside the SignEndUserSolTransactionCriteria_Item as the provided MintAddressCriterion +func (t *SignEndUserSolTransactionCriteria_Item) FromMintAddressCriterion(v MintAddressCriterion) error { b, err := json.Marshal(v) t.union = b return err } -// MergeSolValueCriterion performs a merge with any union data inside the SignSolTransactionCriteria_Item, using the provided SolValueCriterion -func (t *SignSolTransactionCriteria_Item) MergeSolValueCriterion(v SolValueCriterion) error { +// MergeMintAddressCriterion performs a merge with any union data inside the SignEndUserSolTransactionCriteria_Item, using the provided MintAddressCriterion +func (t *SignEndUserSolTransactionCriteria_Item) MergeMintAddressCriterion(v MintAddressCriterion) error { b, err := json.Marshal(v) if err != nil { return err @@ -7524,22 +7669,22 @@ func (t *SignSolTransactionCriteria_Item) MergeSolValueCriterion(v SolValueCrite return err } -// AsSplAddressCriterion returns the union data inside the SignSolTransactionCriteria_Item as a SplAddressCriterion -func (t SignSolTransactionCriteria_Item) AsSplAddressCriterion() (SplAddressCriterion, error) { - var body SplAddressCriterion +// AsSolDataCriterion returns the union data inside the SignEndUserSolTransactionCriteria_Item as a SolDataCriterion +func (t SignEndUserSolTransactionCriteria_Item) AsSolDataCriterion() (SolDataCriterion, error) { + var body SolDataCriterion err := json.Unmarshal(t.union, &body) return body, err } -// FromSplAddressCriterion overwrites any union data inside the SignSolTransactionCriteria_Item as the provided SplAddressCriterion -func (t *SignSolTransactionCriteria_Item) FromSplAddressCriterion(v SplAddressCriterion) error { +// FromSolDataCriterion overwrites any union data inside the SignEndUserSolTransactionCriteria_Item as the provided SolDataCriterion +func (t *SignEndUserSolTransactionCriteria_Item) FromSolDataCriterion(v SolDataCriterion) error { b, err := json.Marshal(v) t.union = b return err } -// MergeSplAddressCriterion performs a merge with any union data inside the SignSolTransactionCriteria_Item, using the provided SplAddressCriterion -func (t *SignSolTransactionCriteria_Item) MergeSplAddressCriterion(v SplAddressCriterion) error { +// MergeSolDataCriterion performs a merge with any union data inside the SignEndUserSolTransactionCriteria_Item, using the provided SolDataCriterion +func (t *SignEndUserSolTransactionCriteria_Item) MergeSolDataCriterion(v SolDataCriterion) error { b, err := json.Marshal(v) if err != nil { return err @@ -7550,22 +7695,22 @@ func (t *SignSolTransactionCriteria_Item) MergeSplAddressCriterion(v SplAddressC return err } -// AsSplValueCriterion returns the union data inside the SignSolTransactionCriteria_Item as a SplValueCriterion -func (t SignSolTransactionCriteria_Item) AsSplValueCriterion() (SplValueCriterion, error) { - var body SplValueCriterion +// AsProgramIdCriterion returns the union data inside the SignEndUserSolTransactionCriteria_Item as a ProgramIdCriterion +func (t SignEndUserSolTransactionCriteria_Item) AsProgramIdCriterion() (ProgramIdCriterion, error) { + var body ProgramIdCriterion err := json.Unmarshal(t.union, &body) return body, err } -// FromSplValueCriterion overwrites any union data inside the SignSolTransactionCriteria_Item as the provided SplValueCriterion -func (t *SignSolTransactionCriteria_Item) FromSplValueCriterion(v SplValueCriterion) error { +// FromProgramIdCriterion overwrites any union data inside the SignEndUserSolTransactionCriteria_Item as the provided ProgramIdCriterion +func (t *SignEndUserSolTransactionCriteria_Item) FromProgramIdCriterion(v ProgramIdCriterion) error { b, err := json.Marshal(v) t.union = b return err } -// MergeSplValueCriterion performs a merge with any union data inside the SignSolTransactionCriteria_Item, using the provided SplValueCriterion -func (t *SignSolTransactionCriteria_Item) MergeSplValueCriterion(v SplValueCriterion) error { +// MergeProgramIdCriterion performs a merge with any union data inside the SignEndUserSolTransactionCriteria_Item, using the provided ProgramIdCriterion +func (t *SignEndUserSolTransactionCriteria_Item) MergeProgramIdCriterion(v ProgramIdCriterion) error { b, err := json.Marshal(v) if err != nil { return err @@ -7576,22 +7721,32 @@ func (t *SignSolTransactionCriteria_Item) MergeSplValueCriterion(v SplValueCrite return err } -// AsMintAddressCriterion returns the union data inside the SignSolTransactionCriteria_Item as a MintAddressCriterion -func (t SignSolTransactionCriteria_Item) AsMintAddressCriterion() (MintAddressCriterion, error) { - var body MintAddressCriterion +func (t SignEndUserSolTransactionCriteria_Item) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *SignEndUserSolTransactionCriteria_Item) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsEvmMessageCriterion returns the union data inside the SignEvmMessageCriteria_Item as a EvmMessageCriterion +func (t SignEvmMessageCriteria_Item) AsEvmMessageCriterion() (EvmMessageCriterion, error) { + var body EvmMessageCriterion err := json.Unmarshal(t.union, &body) return body, err } -// FromMintAddressCriterion overwrites any union data inside the SignSolTransactionCriteria_Item as the provided MintAddressCriterion -func (t *SignSolTransactionCriteria_Item) FromMintAddressCriterion(v MintAddressCriterion) error { +// FromEvmMessageCriterion overwrites any union data inside the SignEvmMessageCriteria_Item as the provided EvmMessageCriterion +func (t *SignEvmMessageCriteria_Item) FromEvmMessageCriterion(v EvmMessageCriterion) error { b, err := json.Marshal(v) t.union = b return err } -// MergeMintAddressCriterion performs a merge with any union data inside the SignSolTransactionCriteria_Item, using the provided MintAddressCriterion -func (t *SignSolTransactionCriteria_Item) MergeMintAddressCriterion(v MintAddressCriterion) error { +// MergeEvmMessageCriterion performs a merge with any union data inside the SignEvmMessageCriteria_Item, using the provided EvmMessageCriterion +func (t *SignEvmMessageCriteria_Item) MergeEvmMessageCriterion(v EvmMessageCriterion) error { b, err := json.Marshal(v) if err != nil { return err @@ -7602,22 +7757,32 @@ func (t *SignSolTransactionCriteria_Item) MergeMintAddressCriterion(v MintAddres return err } -// AsSolDataCriterion returns the union data inside the SignSolTransactionCriteria_Item as a SolDataCriterion -func (t SignSolTransactionCriteria_Item) AsSolDataCriterion() (SolDataCriterion, error) { - var body SolDataCriterion +func (t SignEvmMessageCriteria_Item) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *SignEvmMessageCriteria_Item) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsEthValueCriterion returns the union data inside the SignEvmTransactionCriteria_Item as a EthValueCriterion +func (t SignEvmTransactionCriteria_Item) AsEthValueCriterion() (EthValueCriterion, error) { + var body EthValueCriterion err := json.Unmarshal(t.union, &body) return body, err } -// FromSolDataCriterion overwrites any union data inside the SignSolTransactionCriteria_Item as the provided SolDataCriterion -func (t *SignSolTransactionCriteria_Item) FromSolDataCriterion(v SolDataCriterion) error { +// FromEthValueCriterion overwrites any union data inside the SignEvmTransactionCriteria_Item as the provided EthValueCriterion +func (t *SignEvmTransactionCriteria_Item) FromEthValueCriterion(v EthValueCriterion) error { b, err := json.Marshal(v) t.union = b return err } -// MergeSolDataCriterion performs a merge with any union data inside the SignSolTransactionCriteria_Item, using the provided SolDataCriterion -func (t *SignSolTransactionCriteria_Item) MergeSolDataCriterion(v SolDataCriterion) error { +// MergeEthValueCriterion performs a merge with any union data inside the SignEvmTransactionCriteria_Item, using the provided EthValueCriterion +func (t *SignEvmTransactionCriteria_Item) MergeEthValueCriterion(v EthValueCriterion) error { b, err := json.Marshal(v) if err != nil { return err @@ -7628,22 +7793,22 @@ func (t *SignSolTransactionCriteria_Item) MergeSolDataCriterion(v SolDataCriteri return err } -// AsProgramIdCriterion returns the union data inside the SignSolTransactionCriteria_Item as a ProgramIdCriterion -func (t SignSolTransactionCriteria_Item) AsProgramIdCriterion() (ProgramIdCriterion, error) { - var body ProgramIdCriterion +// AsEvmAddressCriterion returns the union data inside the SignEvmTransactionCriteria_Item as a EvmAddressCriterion +func (t SignEvmTransactionCriteria_Item) AsEvmAddressCriterion() (EvmAddressCriterion, error) { + var body EvmAddressCriterion err := json.Unmarshal(t.union, &body) return body, err } -// FromProgramIdCriterion overwrites any union data inside the SignSolTransactionCriteria_Item as the provided ProgramIdCriterion -func (t *SignSolTransactionCriteria_Item) FromProgramIdCriterion(v ProgramIdCriterion) error { +// FromEvmAddressCriterion overwrites any union data inside the SignEvmTransactionCriteria_Item as the provided EvmAddressCriterion +func (t *SignEvmTransactionCriteria_Item) FromEvmAddressCriterion(v EvmAddressCriterion) error { b, err := json.Marshal(v) t.union = b return err } -// MergeProgramIdCriterion performs a merge with any union data inside the SignSolTransactionCriteria_Item, using the provided ProgramIdCriterion -func (t *SignSolTransactionCriteria_Item) MergeProgramIdCriterion(v ProgramIdCriterion) error { +// MergeEvmAddressCriterion performs a merge with any union data inside the SignEvmTransactionCriteria_Item, using the provided EvmAddressCriterion +func (t *SignEvmTransactionCriteria_Item) MergeEvmAddressCriterion(v EvmAddressCriterion) error { b, err := json.Marshal(v) if err != nil { return err @@ -7654,32 +7819,22 @@ func (t *SignSolTransactionCriteria_Item) MergeProgramIdCriterion(v ProgramIdCri return err } -func (t SignSolTransactionCriteria_Item) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *SignSolTransactionCriteria_Item) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsSolDataParameterCondition returns the union data inside the SolDataCondition_Params_Item as a SolDataParameterCondition -func (t SolDataCondition_Params_Item) AsSolDataParameterCondition() (SolDataParameterCondition, error) { - var body SolDataParameterCondition +// AsEvmDataCriterion returns the union data inside the SignEvmTransactionCriteria_Item as a EvmDataCriterion +func (t SignEvmTransactionCriteria_Item) AsEvmDataCriterion() (EvmDataCriterion, error) { + var body EvmDataCriterion err := json.Unmarshal(t.union, &body) return body, err } -// FromSolDataParameterCondition overwrites any union data inside the SolDataCondition_Params_Item as the provided SolDataParameterCondition -func (t *SolDataCondition_Params_Item) FromSolDataParameterCondition(v SolDataParameterCondition) error { +// FromEvmDataCriterion overwrites any union data inside the SignEvmTransactionCriteria_Item as the provided EvmDataCriterion +func (t *SignEvmTransactionCriteria_Item) FromEvmDataCriterion(v EvmDataCriterion) error { b, err := json.Marshal(v) t.union = b return err } -// MergeSolDataParameterCondition performs a merge with any union data inside the SolDataCondition_Params_Item, using the provided SolDataParameterCondition -func (t *SolDataCondition_Params_Item) MergeSolDataParameterCondition(v SolDataParameterCondition) error { +// MergeEvmDataCriterion performs a merge with any union data inside the SignEvmTransactionCriteria_Item, using the provided EvmDataCriterion +func (t *SignEvmTransactionCriteria_Item) MergeEvmDataCriterion(v EvmDataCriterion) error { b, err := json.Marshal(v) if err != nil { return err @@ -7690,22 +7845,22 @@ func (t *SolDataCondition_Params_Item) MergeSolDataParameterCondition(v SolDataP return err } -// AsSolDataParameterConditionList returns the union data inside the SolDataCondition_Params_Item as a SolDataParameterConditionList -func (t SolDataCondition_Params_Item) AsSolDataParameterConditionList() (SolDataParameterConditionList, error) { - var body SolDataParameterConditionList +// AsNetUSDChangeCriterion returns the union data inside the SignEvmTransactionCriteria_Item as a NetUSDChangeCriterion +func (t SignEvmTransactionCriteria_Item) AsNetUSDChangeCriterion() (NetUSDChangeCriterion, error) { + var body NetUSDChangeCriterion err := json.Unmarshal(t.union, &body) return body, err } -// FromSolDataParameterConditionList overwrites any union data inside the SolDataCondition_Params_Item as the provided SolDataParameterConditionList -func (t *SolDataCondition_Params_Item) FromSolDataParameterConditionList(v SolDataParameterConditionList) error { +// FromNetUSDChangeCriterion overwrites any union data inside the SignEvmTransactionCriteria_Item as the provided NetUSDChangeCriterion +func (t *SignEvmTransactionCriteria_Item) FromNetUSDChangeCriterion(v NetUSDChangeCriterion) error { b, err := json.Marshal(v) t.union = b return err } -// MergeSolDataParameterConditionList performs a merge with any union data inside the SolDataCondition_Params_Item, using the provided SolDataParameterConditionList -func (t *SolDataCondition_Params_Item) MergeSolDataParameterConditionList(v SolDataParameterConditionList) error { +// MergeNetUSDChangeCriterion performs a merge with any union data inside the SignEvmTransactionCriteria_Item, using the provided NetUSDChangeCriterion +func (t *SignEvmTransactionCriteria_Item) MergeNetUSDChangeCriterion(v NetUSDChangeCriterion) error { b, err := json.Marshal(v) if err != nil { return err @@ -7716,32 +7871,32 @@ func (t *SolDataCondition_Params_Item) MergeSolDataParameterConditionList(v SolD return err } -func (t SolDataCondition_Params_Item) MarshalJSON() ([]byte, error) { +func (t SignEvmTransactionCriteria_Item) MarshalJSON() ([]byte, error) { b, err := t.union.MarshalJSON() return b, err } -func (t *SolDataCondition_Params_Item) UnmarshalJSON(b []byte) error { +func (t *SignEvmTransactionCriteria_Item) UnmarshalJSON(b []byte) error { err := t.union.UnmarshalJSON(b) return err } -// AsKnownIdlType returns the union data inside the SolDataCriterion_Idls_Item as a KnownIdlType -func (t SolDataCriterion_Idls_Item) AsKnownIdlType() (KnownIdlType, error) { - var body KnownIdlType +// AsSignEvmTypedDataFieldCriterion returns the union data inside the SignEvmTypedDataCriteria_Item as a SignEvmTypedDataFieldCriterion +func (t SignEvmTypedDataCriteria_Item) AsSignEvmTypedDataFieldCriterion() (SignEvmTypedDataFieldCriterion, error) { + var body SignEvmTypedDataFieldCriterion err := json.Unmarshal(t.union, &body) return body, err } -// FromKnownIdlType overwrites any union data inside the SolDataCriterion_Idls_Item as the provided KnownIdlType -func (t *SolDataCriterion_Idls_Item) FromKnownIdlType(v KnownIdlType) error { +// FromSignEvmTypedDataFieldCriterion overwrites any union data inside the SignEvmTypedDataCriteria_Item as the provided SignEvmTypedDataFieldCriterion +func (t *SignEvmTypedDataCriteria_Item) FromSignEvmTypedDataFieldCriterion(v SignEvmTypedDataFieldCriterion) error { b, err := json.Marshal(v) t.union = b return err } -// MergeKnownIdlType performs a merge with any union data inside the SolDataCriterion_Idls_Item, using the provided KnownIdlType -func (t *SolDataCriterion_Idls_Item) MergeKnownIdlType(v KnownIdlType) error { +// MergeSignEvmTypedDataFieldCriterion performs a merge with any union data inside the SignEvmTypedDataCriteria_Item, using the provided SignEvmTypedDataFieldCriterion +func (t *SignEvmTypedDataCriteria_Item) MergeSignEvmTypedDataFieldCriterion(v SignEvmTypedDataFieldCriterion) error { b, err := json.Marshal(v) if err != nil { return err @@ -7752,22 +7907,22 @@ func (t *SolDataCriterion_Idls_Item) MergeKnownIdlType(v KnownIdlType) error { return err } -// AsIdl returns the union data inside the SolDataCriterion_Idls_Item as a Idl -func (t SolDataCriterion_Idls_Item) AsIdl() (Idl, error) { - var body Idl +// AsSignEvmTypedDataVerifyingContractCriterion returns the union data inside the SignEvmTypedDataCriteria_Item as a SignEvmTypedDataVerifyingContractCriterion +func (t SignEvmTypedDataCriteria_Item) AsSignEvmTypedDataVerifyingContractCriterion() (SignEvmTypedDataVerifyingContractCriterion, error) { + var body SignEvmTypedDataVerifyingContractCriterion err := json.Unmarshal(t.union, &body) return body, err } -// FromIdl overwrites any union data inside the SolDataCriterion_Idls_Item as the provided Idl -func (t *SolDataCriterion_Idls_Item) FromIdl(v Idl) error { +// FromSignEvmTypedDataVerifyingContractCriterion overwrites any union data inside the SignEvmTypedDataCriteria_Item as the provided SignEvmTypedDataVerifyingContractCriterion +func (t *SignEvmTypedDataCriteria_Item) FromSignEvmTypedDataVerifyingContractCriterion(v SignEvmTypedDataVerifyingContractCriterion) error { b, err := json.Marshal(v) t.union = b return err } -// MergeIdl performs a merge with any union data inside the SolDataCriterion_Idls_Item, using the provided Idl -func (t *SolDataCriterion_Idls_Item) MergeIdl(v Idl) error { +// MergeSignEvmTypedDataVerifyingContractCriterion performs a merge with any union data inside the SignEvmTypedDataCriteria_Item, using the provided SignEvmTypedDataVerifyingContractCriterion +func (t *SignEvmTypedDataCriteria_Item) MergeSignEvmTypedDataVerifyingContractCriterion(v SignEvmTypedDataVerifyingContractCriterion) error { b, err := json.Marshal(v) if err != nil { return err @@ -7778,32 +7933,32 @@ func (t *SolDataCriterion_Idls_Item) MergeIdl(v Idl) error { return err } -func (t SolDataCriterion_Idls_Item) MarshalJSON() ([]byte, error) { +func (t SignEvmTypedDataCriteria_Item) MarshalJSON() ([]byte, error) { b, err := t.union.MarshalJSON() return b, err } -func (t *SolDataCriterion_Idls_Item) UnmarshalJSON(b []byte) error { +func (t *SignEvmTypedDataCriteria_Item) UnmarshalJSON(b []byte) error { err := t.union.UnmarshalJSON(b) return err } -// AsX402V1PaymentPayload returns the union data inside the X402PaymentPayload as a X402V1PaymentPayload -func (t X402PaymentPayload) AsX402V1PaymentPayload() (X402V1PaymentPayload, error) { - var body X402V1PaymentPayload +// AsEvmTypedAddressCondition returns the union data inside the SignEvmTypedDataFieldCriterion_Conditions_Item as a EvmTypedAddressCondition +func (t SignEvmTypedDataFieldCriterion_Conditions_Item) AsEvmTypedAddressCondition() (EvmTypedAddressCondition, error) { + var body EvmTypedAddressCondition err := json.Unmarshal(t.union, &body) return body, err } -// FromX402V1PaymentPayload overwrites any union data inside the X402PaymentPayload as the provided X402V1PaymentPayload -func (t *X402PaymentPayload) FromX402V1PaymentPayload(v X402V1PaymentPayload) error { +// FromEvmTypedAddressCondition overwrites any union data inside the SignEvmTypedDataFieldCriterion_Conditions_Item as the provided EvmTypedAddressCondition +func (t *SignEvmTypedDataFieldCriterion_Conditions_Item) FromEvmTypedAddressCondition(v EvmTypedAddressCondition) error { b, err := json.Marshal(v) t.union = b return err } -// MergeX402V1PaymentPayload performs a merge with any union data inside the X402PaymentPayload, using the provided X402V1PaymentPayload -func (t *X402PaymentPayload) MergeX402V1PaymentPayload(v X402V1PaymentPayload) error { +// MergeEvmTypedAddressCondition performs a merge with any union data inside the SignEvmTypedDataFieldCriterion_Conditions_Item, using the provided EvmTypedAddressCondition +func (t *SignEvmTypedDataFieldCriterion_Conditions_Item) MergeEvmTypedAddressCondition(v EvmTypedAddressCondition) error { b, err := json.Marshal(v) if err != nil { return err @@ -7814,22 +7969,22 @@ func (t *X402PaymentPayload) MergeX402V1PaymentPayload(v X402V1PaymentPayload) e return err } -// AsX402V2PaymentPayload returns the union data inside the X402PaymentPayload as a X402V2PaymentPayload -func (t X402PaymentPayload) AsX402V2PaymentPayload() (X402V2PaymentPayload, error) { - var body X402V2PaymentPayload +// AsEvmTypedNumericalCondition returns the union data inside the SignEvmTypedDataFieldCriterion_Conditions_Item as a EvmTypedNumericalCondition +func (t SignEvmTypedDataFieldCriterion_Conditions_Item) AsEvmTypedNumericalCondition() (EvmTypedNumericalCondition, error) { + var body EvmTypedNumericalCondition err := json.Unmarshal(t.union, &body) return body, err } -// FromX402V2PaymentPayload overwrites any union data inside the X402PaymentPayload as the provided X402V2PaymentPayload -func (t *X402PaymentPayload) FromX402V2PaymentPayload(v X402V2PaymentPayload) error { +// FromEvmTypedNumericalCondition overwrites any union data inside the SignEvmTypedDataFieldCriterion_Conditions_Item as the provided EvmTypedNumericalCondition +func (t *SignEvmTypedDataFieldCriterion_Conditions_Item) FromEvmTypedNumericalCondition(v EvmTypedNumericalCondition) error { b, err := json.Marshal(v) t.union = b return err } -// MergeX402V2PaymentPayload performs a merge with any union data inside the X402PaymentPayload, using the provided X402V2PaymentPayload -func (t *X402PaymentPayload) MergeX402V2PaymentPayload(v X402V2PaymentPayload) error { +// MergeEvmTypedNumericalCondition performs a merge with any union data inside the SignEvmTypedDataFieldCriterion_Conditions_Item, using the provided EvmTypedNumericalCondition +func (t *SignEvmTypedDataFieldCriterion_Conditions_Item) MergeEvmTypedNumericalCondition(v EvmTypedNumericalCondition) error { b, err := json.Marshal(v) if err != nil { return err @@ -7840,32 +7995,22 @@ func (t *X402PaymentPayload) MergeX402V2PaymentPayload(v X402V2PaymentPayload) e return err } -func (t X402PaymentPayload) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *X402PaymentPayload) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsX402V1PaymentRequirements returns the union data inside the X402PaymentRequirements as a X402V1PaymentRequirements -func (t X402PaymentRequirements) AsX402V1PaymentRequirements() (X402V1PaymentRequirements, error) { - var body X402V1PaymentRequirements +// AsEvmTypedStringCondition returns the union data inside the SignEvmTypedDataFieldCriterion_Conditions_Item as a EvmTypedStringCondition +func (t SignEvmTypedDataFieldCriterion_Conditions_Item) AsEvmTypedStringCondition() (EvmTypedStringCondition, error) { + var body EvmTypedStringCondition err := json.Unmarshal(t.union, &body) return body, err } -// FromX402V1PaymentRequirements overwrites any union data inside the X402PaymentRequirements as the provided X402V1PaymentRequirements -func (t *X402PaymentRequirements) FromX402V1PaymentRequirements(v X402V1PaymentRequirements) error { +// FromEvmTypedStringCondition overwrites any union data inside the SignEvmTypedDataFieldCriterion_Conditions_Item as the provided EvmTypedStringCondition +func (t *SignEvmTypedDataFieldCriterion_Conditions_Item) FromEvmTypedStringCondition(v EvmTypedStringCondition) error { b, err := json.Marshal(v) t.union = b return err } -// MergeX402V1PaymentRequirements performs a merge with any union data inside the X402PaymentRequirements, using the provided X402V1PaymentRequirements -func (t *X402PaymentRequirements) MergeX402V1PaymentRequirements(v X402V1PaymentRequirements) error { +// MergeEvmTypedStringCondition performs a merge with any union data inside the SignEvmTypedDataFieldCriterion_Conditions_Item, using the provided EvmTypedStringCondition +func (t *SignEvmTypedDataFieldCriterion_Conditions_Item) MergeEvmTypedStringCondition(v EvmTypedStringCondition) error { b, err := json.Marshal(v) if err != nil { return err @@ -7876,22 +8021,32 @@ func (t *X402PaymentRequirements) MergeX402V1PaymentRequirements(v X402V1Payment return err } -// AsX402V2PaymentRequirements returns the union data inside the X402PaymentRequirements as a X402V2PaymentRequirements -func (t X402PaymentRequirements) AsX402V2PaymentRequirements() (X402V2PaymentRequirements, error) { - var body X402V2PaymentRequirements +func (t SignEvmTypedDataFieldCriterion_Conditions_Item) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *SignEvmTypedDataFieldCriterion_Conditions_Item) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsSolMessageCriterion returns the union data inside the SignSolMessageCriteria_Item as a SolMessageCriterion +func (t SignSolMessageCriteria_Item) AsSolMessageCriterion() (SolMessageCriterion, error) { + var body SolMessageCriterion err := json.Unmarshal(t.union, &body) return body, err } -// FromX402V2PaymentRequirements overwrites any union data inside the X402PaymentRequirements as the provided X402V2PaymentRequirements -func (t *X402PaymentRequirements) FromX402V2PaymentRequirements(v X402V2PaymentRequirements) error { +// FromSolMessageCriterion overwrites any union data inside the SignSolMessageCriteria_Item as the provided SolMessageCriterion +func (t *SignSolMessageCriteria_Item) FromSolMessageCriterion(v SolMessageCriterion) error { b, err := json.Marshal(v) t.union = b return err } -// MergeX402V2PaymentRequirements performs a merge with any union data inside the X402PaymentRequirements, using the provided X402V2PaymentRequirements -func (t *X402PaymentRequirements) MergeX402V2PaymentRequirements(v X402V2PaymentRequirements) error { +// MergeSolMessageCriterion performs a merge with any union data inside the SignSolMessageCriteria_Item, using the provided SolMessageCriterion +func (t *SignSolMessageCriteria_Item) MergeSolMessageCriterion(v SolMessageCriterion) error { b, err := json.Marshal(v) if err != nil { return err @@ -7902,32 +8057,32 @@ func (t *X402PaymentRequirements) MergeX402V2PaymentRequirements(v X402V2Payment return err } -func (t X402PaymentRequirements) MarshalJSON() ([]byte, error) { +func (t SignSolMessageCriteria_Item) MarshalJSON() ([]byte, error) { b, err := t.union.MarshalJSON() return b, err } -func (t *X402PaymentRequirements) UnmarshalJSON(b []byte) error { +func (t *SignSolMessageCriteria_Item) UnmarshalJSON(b []byte) error { err := t.union.UnmarshalJSON(b) return err } -// AsX402ExactEvmPayload returns the union data inside the X402V1PaymentPayload_Payload as a X402ExactEvmPayload -func (t X402V1PaymentPayload_Payload) AsX402ExactEvmPayload() (X402ExactEvmPayload, error) { - var body X402ExactEvmPayload +// AsSolAddressCriterion returns the union data inside the SignSolTransactionCriteria_Item as a SolAddressCriterion +func (t SignSolTransactionCriteria_Item) AsSolAddressCriterion() (SolAddressCriterion, error) { + var body SolAddressCriterion err := json.Unmarshal(t.union, &body) return body, err } -// FromX402ExactEvmPayload overwrites any union data inside the X402V1PaymentPayload_Payload as the provided X402ExactEvmPayload -func (t *X402V1PaymentPayload_Payload) FromX402ExactEvmPayload(v X402ExactEvmPayload) error { - b, err := json.Marshal(v) +// FromSolAddressCriterion overwrites any union data inside the SignSolTransactionCriteria_Item as the provided SolAddressCriterion +func (t *SignSolTransactionCriteria_Item) FromSolAddressCriterion(v SolAddressCriterion) error { + b, err := json.Marshal(v) t.union = b return err } -// MergeX402ExactEvmPayload performs a merge with any union data inside the X402V1PaymentPayload_Payload, using the provided X402ExactEvmPayload -func (t *X402V1PaymentPayload_Payload) MergeX402ExactEvmPayload(v X402ExactEvmPayload) error { +// MergeSolAddressCriterion performs a merge with any union data inside the SignSolTransactionCriteria_Item, using the provided SolAddressCriterion +func (t *SignSolTransactionCriteria_Item) MergeSolAddressCriterion(v SolAddressCriterion) error { b, err := json.Marshal(v) if err != nil { return err @@ -7938,22 +8093,22 @@ func (t *X402V1PaymentPayload_Payload) MergeX402ExactEvmPayload(v X402ExactEvmPa return err } -// AsX402ExactEvmPermit2Payload returns the union data inside the X402V1PaymentPayload_Payload as a X402ExactEvmPermit2Payload -func (t X402V1PaymentPayload_Payload) AsX402ExactEvmPermit2Payload() (X402ExactEvmPermit2Payload, error) { - var body X402ExactEvmPermit2Payload +// AsSolValueCriterion returns the union data inside the SignSolTransactionCriteria_Item as a SolValueCriterion +func (t SignSolTransactionCriteria_Item) AsSolValueCriterion() (SolValueCriterion, error) { + var body SolValueCriterion err := json.Unmarshal(t.union, &body) return body, err } -// FromX402ExactEvmPermit2Payload overwrites any union data inside the X402V1PaymentPayload_Payload as the provided X402ExactEvmPermit2Payload -func (t *X402V1PaymentPayload_Payload) FromX402ExactEvmPermit2Payload(v X402ExactEvmPermit2Payload) error { +// FromSolValueCriterion overwrites any union data inside the SignSolTransactionCriteria_Item as the provided SolValueCriterion +func (t *SignSolTransactionCriteria_Item) FromSolValueCriterion(v SolValueCriterion) error { b, err := json.Marshal(v) t.union = b return err } -// MergeX402ExactEvmPermit2Payload performs a merge with any union data inside the X402V1PaymentPayload_Payload, using the provided X402ExactEvmPermit2Payload -func (t *X402V1PaymentPayload_Payload) MergeX402ExactEvmPermit2Payload(v X402ExactEvmPermit2Payload) error { +// MergeSolValueCriterion performs a merge with any union data inside the SignSolTransactionCriteria_Item, using the provided SolValueCriterion +func (t *SignSolTransactionCriteria_Item) MergeSolValueCriterion(v SolValueCriterion) error { b, err := json.Marshal(v) if err != nil { return err @@ -7964,22 +8119,22 @@ func (t *X402V1PaymentPayload_Payload) MergeX402ExactEvmPermit2Payload(v X402Exa return err } -// AsX402ExactSolanaPayload returns the union data inside the X402V1PaymentPayload_Payload as a X402ExactSolanaPayload -func (t X402V1PaymentPayload_Payload) AsX402ExactSolanaPayload() (X402ExactSolanaPayload, error) { - var body X402ExactSolanaPayload +// AsSplAddressCriterion returns the union data inside the SignSolTransactionCriteria_Item as a SplAddressCriterion +func (t SignSolTransactionCriteria_Item) AsSplAddressCriterion() (SplAddressCriterion, error) { + var body SplAddressCriterion err := json.Unmarshal(t.union, &body) return body, err } -// FromX402ExactSolanaPayload overwrites any union data inside the X402V1PaymentPayload_Payload as the provided X402ExactSolanaPayload -func (t *X402V1PaymentPayload_Payload) FromX402ExactSolanaPayload(v X402ExactSolanaPayload) error { +// FromSplAddressCriterion overwrites any union data inside the SignSolTransactionCriteria_Item as the provided SplAddressCriterion +func (t *SignSolTransactionCriteria_Item) FromSplAddressCriterion(v SplAddressCriterion) error { b, err := json.Marshal(v) t.union = b return err } -// MergeX402ExactSolanaPayload performs a merge with any union data inside the X402V1PaymentPayload_Payload, using the provided X402ExactSolanaPayload -func (t *X402V1PaymentPayload_Payload) MergeX402ExactSolanaPayload(v X402ExactSolanaPayload) error { +// MergeSplAddressCriterion performs a merge with any union data inside the SignSolTransactionCriteria_Item, using the provided SplAddressCriterion +func (t *SignSolTransactionCriteria_Item) MergeSplAddressCriterion(v SplAddressCriterion) error { b, err := json.Marshal(v) if err != nil { return err @@ -7990,32 +8145,48 @@ func (t *X402V1PaymentPayload_Payload) MergeX402ExactSolanaPayload(v X402ExactSo return err } -func (t X402V1PaymentPayload_Payload) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err +// AsSplValueCriterion returns the union data inside the SignSolTransactionCriteria_Item as a SplValueCriterion +func (t SignSolTransactionCriteria_Item) AsSplValueCriterion() (SplValueCriterion, error) { + var body SplValueCriterion + err := json.Unmarshal(t.union, &body) + return body, err } -func (t *X402V1PaymentPayload_Payload) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) +// FromSplValueCriterion overwrites any union data inside the SignSolTransactionCriteria_Item as the provided SplValueCriterion +func (t *SignSolTransactionCriteria_Item) FromSplValueCriterion(v SplValueCriterion) error { + b, err := json.Marshal(v) + t.union = b return err } -// AsX402ExactEvmPayload returns the union data inside the X402V2PaymentPayload_Payload as a X402ExactEvmPayload -func (t X402V2PaymentPayload_Payload) AsX402ExactEvmPayload() (X402ExactEvmPayload, error) { - var body X402ExactEvmPayload +// MergeSplValueCriterion performs a merge with any union data inside the SignSolTransactionCriteria_Item, using the provided SplValueCriterion +func (t *SignSolTransactionCriteria_Item) MergeSplValueCriterion(v SplValueCriterion) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JsonMerge(t.union, b) + t.union = merged + return err +} + +// AsMintAddressCriterion returns the union data inside the SignSolTransactionCriteria_Item as a MintAddressCriterion +func (t SignSolTransactionCriteria_Item) AsMintAddressCriterion() (MintAddressCriterion, error) { + var body MintAddressCriterion err := json.Unmarshal(t.union, &body) return body, err } -// FromX402ExactEvmPayload overwrites any union data inside the X402V2PaymentPayload_Payload as the provided X402ExactEvmPayload -func (t *X402V2PaymentPayload_Payload) FromX402ExactEvmPayload(v X402ExactEvmPayload) error { +// FromMintAddressCriterion overwrites any union data inside the SignSolTransactionCriteria_Item as the provided MintAddressCriterion +func (t *SignSolTransactionCriteria_Item) FromMintAddressCriterion(v MintAddressCriterion) error { b, err := json.Marshal(v) t.union = b return err } -// MergeX402ExactEvmPayload performs a merge with any union data inside the X402V2PaymentPayload_Payload, using the provided X402ExactEvmPayload -func (t *X402V2PaymentPayload_Payload) MergeX402ExactEvmPayload(v X402ExactEvmPayload) error { +// MergeMintAddressCriterion performs a merge with any union data inside the SignSolTransactionCriteria_Item, using the provided MintAddressCriterion +func (t *SignSolTransactionCriteria_Item) MergeMintAddressCriterion(v MintAddressCriterion) error { b, err := json.Marshal(v) if err != nil { return err @@ -8026,22 +8197,22 @@ func (t *X402V2PaymentPayload_Payload) MergeX402ExactEvmPayload(v X402ExactEvmPa return err } -// AsX402ExactEvmPermit2Payload returns the union data inside the X402V2PaymentPayload_Payload as a X402ExactEvmPermit2Payload -func (t X402V2PaymentPayload_Payload) AsX402ExactEvmPermit2Payload() (X402ExactEvmPermit2Payload, error) { - var body X402ExactEvmPermit2Payload +// AsSolDataCriterion returns the union data inside the SignSolTransactionCriteria_Item as a SolDataCriterion +func (t SignSolTransactionCriteria_Item) AsSolDataCriterion() (SolDataCriterion, error) { + var body SolDataCriterion err := json.Unmarshal(t.union, &body) return body, err } -// FromX402ExactEvmPermit2Payload overwrites any union data inside the X402V2PaymentPayload_Payload as the provided X402ExactEvmPermit2Payload -func (t *X402V2PaymentPayload_Payload) FromX402ExactEvmPermit2Payload(v X402ExactEvmPermit2Payload) error { +// FromSolDataCriterion overwrites any union data inside the SignSolTransactionCriteria_Item as the provided SolDataCriterion +func (t *SignSolTransactionCriteria_Item) FromSolDataCriterion(v SolDataCriterion) error { b, err := json.Marshal(v) t.union = b return err } -// MergeX402ExactEvmPermit2Payload performs a merge with any union data inside the X402V2PaymentPayload_Payload, using the provided X402ExactEvmPermit2Payload -func (t *X402V2PaymentPayload_Payload) MergeX402ExactEvmPermit2Payload(v X402ExactEvmPermit2Payload) error { +// MergeSolDataCriterion performs a merge with any union data inside the SignSolTransactionCriteria_Item, using the provided SolDataCriterion +func (t *SignSolTransactionCriteria_Item) MergeSolDataCriterion(v SolDataCriterion) error { b, err := json.Marshal(v) if err != nil { return err @@ -8052,22 +8223,22 @@ func (t *X402V2PaymentPayload_Payload) MergeX402ExactEvmPermit2Payload(v X402Exa return err } -// AsX402ExactSolanaPayload returns the union data inside the X402V2PaymentPayload_Payload as a X402ExactSolanaPayload -func (t X402V2PaymentPayload_Payload) AsX402ExactSolanaPayload() (X402ExactSolanaPayload, error) { - var body X402ExactSolanaPayload +// AsProgramIdCriterion returns the union data inside the SignSolTransactionCriteria_Item as a ProgramIdCriterion +func (t SignSolTransactionCriteria_Item) AsProgramIdCriterion() (ProgramIdCriterion, error) { + var body ProgramIdCriterion err := json.Unmarshal(t.union, &body) return body, err } -// FromX402ExactSolanaPayload overwrites any union data inside the X402V2PaymentPayload_Payload as the provided X402ExactSolanaPayload -func (t *X402V2PaymentPayload_Payload) FromX402ExactSolanaPayload(v X402ExactSolanaPayload) error { +// FromProgramIdCriterion overwrites any union data inside the SignSolTransactionCriteria_Item as the provided ProgramIdCriterion +func (t *SignSolTransactionCriteria_Item) FromProgramIdCriterion(v ProgramIdCriterion) error { b, err := json.Marshal(v) t.union = b return err } -// MergeX402ExactSolanaPayload performs a merge with any union data inside the X402V2PaymentPayload_Payload, using the provided X402ExactSolanaPayload -func (t *X402V2PaymentPayload_Payload) MergeX402ExactSolanaPayload(v X402ExactSolanaPayload) error { +// MergeProgramIdCriterion performs a merge with any union data inside the SignSolTransactionCriteria_Item, using the provided ProgramIdCriterion +func (t *SignSolTransactionCriteria_Item) MergeProgramIdCriterion(v ProgramIdCriterion) error { b, err := json.Marshal(v) if err != nil { return err @@ -8078,353 +8249,852 @@ func (t *X402V2PaymentPayload_Payload) MergeX402ExactSolanaPayload(v X402ExactSo return err } -func (t X402V2PaymentPayload_Payload) MarshalJSON() ([]byte, error) { +func (t SignSolTransactionCriteria_Item) MarshalJSON() ([]byte, error) { b, err := t.union.MarshalJSON() return b, err } -func (t *X402V2PaymentPayload_Payload) UnmarshalJSON(b []byte) error { +func (t *SignSolTransactionCriteria_Item) UnmarshalJSON(b []byte) error { err := t.union.UnmarshalJSON(b) return err } -// RequestEditorFn is the function signature for the RequestEditor callback function -type RequestEditorFn func(ctx context.Context, req *http.Request) error - -// Doer performs HTTP requests. -// -// The standard http.Client implements this interface. -type HttpRequestDoer interface { - Do(req *http.Request) (*http.Response, error) +// AsSolDataParameterCondition returns the union data inside the SolDataCondition_Params_Item as a SolDataParameterCondition +func (t SolDataCondition_Params_Item) AsSolDataParameterCondition() (SolDataParameterCondition, error) { + var body SolDataParameterCondition + err := json.Unmarshal(t.union, &body) + return body, err } -// CDPClient which conforms to the OpenAPI3 specification for this service. -type CDPClient struct { - // The endpoint of the server conforming to this interface, with scheme, - // https://api.deepmap.com for example. This can contain a path relative - // to the server, such as https://api.deepmap.com/dev-test, and all the - // paths in the swagger spec will be appended to the server. - Server string +// FromSolDataParameterCondition overwrites any union data inside the SolDataCondition_Params_Item as the provided SolDataParameterCondition +func (t *SolDataCondition_Params_Item) FromSolDataParameterCondition(v SolDataParameterCondition) error { + b, err := json.Marshal(v) + t.union = b + return err +} - // Doer for performing requests, typically a *http.Client with any - // customized settings, such as certificate chains. - Client HttpRequestDoer +// MergeSolDataParameterCondition performs a merge with any union data inside the SolDataCondition_Params_Item, using the provided SolDataParameterCondition +func (t *SolDataCondition_Params_Item) MergeSolDataParameterCondition(v SolDataParameterCondition) error { + b, err := json.Marshal(v) + if err != nil { + return err + } - // A list of callbacks for modifying requests which are generated before sending over - // the network. - RequestEditors []RequestEditorFn + merged, err := runtime.JsonMerge(t.union, b) + t.union = merged + return err } -// ClientOption allows setting custom parameters during construction -type ClientOption func(*CDPClient) error - -// Creates a new CDPClient, with reasonable defaults -func NewClient(server string, opts ...ClientOption) (*CDPClient, error) { - // create a client with sane default values - client := CDPClient{ - Server: server, - } - // mutate client and add all optional params - for _, o := range opts { - if err := o(&client); err != nil { - return nil, err - } - } - // ensure the server URL always has a trailing slash - if !strings.HasSuffix(client.Server, "/") { - client.Server += "/" - } - // create httpClient, if not already present - if client.Client == nil { - client.Client = &http.Client{} - } - return &client, nil +// AsSolDataParameterConditionList returns the union data inside the SolDataCondition_Params_Item as a SolDataParameterConditionList +func (t SolDataCondition_Params_Item) AsSolDataParameterConditionList() (SolDataParameterConditionList, error) { + var body SolDataParameterConditionList + err := json.Unmarshal(t.union, &body) + return body, err } -// WithHTTPClient allows overriding the default Doer, which is -// automatically created using http.Client. This is useful for tests. -func WithHTTPClient(doer HttpRequestDoer) ClientOption { - return func(c *CDPClient) error { - c.Client = doer - return nil - } +// FromSolDataParameterConditionList overwrites any union data inside the SolDataCondition_Params_Item as the provided SolDataParameterConditionList +func (t *SolDataCondition_Params_Item) FromSolDataParameterConditionList(v SolDataParameterConditionList) error { + b, err := json.Marshal(v) + t.union = b + return err } -// WithRequestEditorFn allows setting up a callback function, which will be -// called right before sending the request. This can be used to mutate the request. -func WithRequestEditorFn(fn RequestEditorFn) ClientOption { - return func(c *CDPClient) error { - c.RequestEditors = append(c.RequestEditors, fn) - return nil +// MergeSolDataParameterConditionList performs a merge with any union data inside the SolDataCondition_Params_Item, using the provided SolDataParameterConditionList +func (t *SolDataCondition_Params_Item) MergeSolDataParameterConditionList(v SolDataParameterConditionList) error { + b, err := json.Marshal(v) + if err != nil { + return err } + + merged, err := runtime.JsonMerge(t.union, b) + t.union = merged + return err } -// The interface specification for the client above. -type ClientInterface interface { - // ListDataTokenBalances request - ListDataTokenBalances(ctx context.Context, network ListEvmTokenBalancesNetwork, address string, params *ListDataTokenBalancesParams, reqEditors ...RequestEditorFn) (*http.Response, error) +func (t SolDataCondition_Params_Item) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} - // ListTokensForAccount request - ListTokensForAccount(ctx context.Context, network ListTokensForAccountParamsNetwork, address string, reqEditors ...RequestEditorFn) (*http.Response, error) +func (t *SolDataCondition_Params_Item) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} - // GetSQLGrammar request - GetSQLGrammar(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) +// AsKnownIdlType returns the union data inside the SolDataCriterion_Idls_Item as a KnownIdlType +func (t SolDataCriterion_Idls_Item) AsKnownIdlType() (KnownIdlType, error) { + var body KnownIdlType + err := json.Unmarshal(t.union, &body) + return body, err +} - // RunSQLQueryWithBody request with any body - RunSQLQueryWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) +// FromKnownIdlType overwrites any union data inside the SolDataCriterion_Idls_Item as the provided KnownIdlType +func (t *SolDataCriterion_Idls_Item) FromKnownIdlType(v KnownIdlType) error { + b, err := json.Marshal(v) + t.union = b + return err +} - RunSQLQuery(ctx context.Context, body RunSQLQueryJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) +// MergeKnownIdlType performs a merge with any union data inside the SolDataCriterion_Idls_Item, using the provided KnownIdlType +func (t *SolDataCriterion_Idls_Item) MergeKnownIdlType(v KnownIdlType) error { + b, err := json.Marshal(v) + if err != nil { + return err + } - // ListWebhookSubscriptions request - ListWebhookSubscriptions(ctx context.Context, params *ListWebhookSubscriptionsParams, reqEditors ...RequestEditorFn) (*http.Response, error) + merged, err := runtime.JsonMerge(t.union, b) + t.union = merged + return err +} - // CreateWebhookSubscriptionWithBody request with any body - CreateWebhookSubscriptionWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) +// AsIdl returns the union data inside the SolDataCriterion_Idls_Item as a Idl +func (t SolDataCriterion_Idls_Item) AsIdl() (Idl, error) { + var body Idl + err := json.Unmarshal(t.union, &body) + return body, err +} - CreateWebhookSubscription(ctx context.Context, body CreateWebhookSubscriptionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // DeleteWebhookSubscription request - DeleteWebhookSubscription(ctx context.Context, subscriptionId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) +// FromIdl overwrites any union data inside the SolDataCriterion_Idls_Item as the provided Idl +func (t *SolDataCriterion_Idls_Item) FromIdl(v Idl) error { + b, err := json.Marshal(v) + t.union = b + return err +} - // GetWebhookSubscription request - GetWebhookSubscription(ctx context.Context, subscriptionId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) +// MergeIdl performs a merge with any union data inside the SolDataCriterion_Idls_Item, using the provided Idl +func (t *SolDataCriterion_Idls_Item) MergeIdl(v Idl) error { + b, err := json.Marshal(v) + if err != nil { + return err + } - // UpdateWebhookSubscriptionWithBody request with any body - UpdateWebhookSubscriptionWithBody(ctx context.Context, subscriptionId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + merged, err := runtime.JsonMerge(t.union, b) + t.union = merged + return err +} - UpdateWebhookSubscription(ctx context.Context, subscriptionId openapi_types.UUID, body UpdateWebhookSubscriptionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) +func (t SolDataCriterion_Idls_Item) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} - // ListEndUsers request - ListEndUsers(ctx context.Context, params *ListEndUsersParams, reqEditors ...RequestEditorFn) (*http.Response, error) +func (t *SolDataCriterion_Idls_Item) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} - // CreateEndUserWithBody request with any body - CreateEndUserWithBody(ctx context.Context, params *CreateEndUserParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) +// AsX402V2PaymentPayload returns the union data inside the X402PaymentPayload as a X402V2PaymentPayload +func (t X402PaymentPayload) AsX402V2PaymentPayload() (X402V2PaymentPayload, error) { + var body X402V2PaymentPayload + err := json.Unmarshal(t.union, &body) + return body, err +} - CreateEndUser(ctx context.Context, params *CreateEndUserParams, body CreateEndUserJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) +// FromX402V2PaymentPayload overwrites any union data inside the X402PaymentPayload as the provided X402V2PaymentPayload +func (t *X402PaymentPayload) FromX402V2PaymentPayload(v X402V2PaymentPayload) error { + b, err := json.Marshal(v) + t.union = b + return err +} - // ValidateEndUserAccessTokenWithBody request with any body - ValidateEndUserAccessTokenWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) +// MergeX402V2PaymentPayload performs a merge with any union data inside the X402PaymentPayload, using the provided X402V2PaymentPayload +func (t *X402PaymentPayload) MergeX402V2PaymentPayload(v X402V2PaymentPayload) error { + b, err := json.Marshal(v) + if err != nil { + return err + } - ValidateEndUserAccessToken(ctx context.Context, body ValidateEndUserAccessTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + merged, err := runtime.JsonMerge(t.union, b) + t.union = merged + return err +} - // ImportEndUserWithBody request with any body - ImportEndUserWithBody(ctx context.Context, params *ImportEndUserParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) +// AsX402V1PaymentPayload returns the union data inside the X402PaymentPayload as a X402V1PaymentPayload +func (t X402PaymentPayload) AsX402V1PaymentPayload() (X402V1PaymentPayload, error) { + var body X402V1PaymentPayload + err := json.Unmarshal(t.union, &body) + return body, err +} - ImportEndUser(ctx context.Context, params *ImportEndUserParams, body ImportEndUserJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) +// FromX402V1PaymentPayload overwrites any union data inside the X402PaymentPayload as the provided X402V1PaymentPayload +func (t *X402PaymentPayload) FromX402V1PaymentPayload(v X402V1PaymentPayload) error { + b, err := json.Marshal(v) + t.union = b + return err +} - // GetEndUser request - GetEndUser(ctx context.Context, userId string, reqEditors ...RequestEditorFn) (*http.Response, error) +// MergeX402V1PaymentPayload performs a merge with any union data inside the X402PaymentPayload, using the provided X402V1PaymentPayload +func (t *X402PaymentPayload) MergeX402V1PaymentPayload(v X402V1PaymentPayload) error { + b, err := json.Marshal(v) + if err != nil { + return err + } - // AddEndUserEvmAccountWithBody request with any body - AddEndUserEvmAccountWithBody(ctx context.Context, userId string, params *AddEndUserEvmAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + merged, err := runtime.JsonMerge(t.union, b) + t.union = merged + return err +} - AddEndUserEvmAccount(ctx context.Context, userId string, params *AddEndUserEvmAccountParams, body AddEndUserEvmAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) +func (t X402PaymentPayload) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} - // AddEndUserEvmSmartAccountWithBody request with any body - AddEndUserEvmSmartAccountWithBody(ctx context.Context, userId string, params *AddEndUserEvmSmartAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) +func (t *X402PaymentPayload) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} - AddEndUserEvmSmartAccount(ctx context.Context, userId string, params *AddEndUserEvmSmartAccountParams, body AddEndUserEvmSmartAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) +// AsX402V2PaymentRequirements returns the union data inside the X402PaymentRequirements as a X402V2PaymentRequirements +func (t X402PaymentRequirements) AsX402V2PaymentRequirements() (X402V2PaymentRequirements, error) { + var body X402V2PaymentRequirements + err := json.Unmarshal(t.union, &body) + return body, err +} - // AddEndUserSolanaAccountWithBody request with any body - AddEndUserSolanaAccountWithBody(ctx context.Context, userId string, params *AddEndUserSolanaAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) +// FromX402V2PaymentRequirements overwrites any union data inside the X402PaymentRequirements as the provided X402V2PaymentRequirements +func (t *X402PaymentRequirements) FromX402V2PaymentRequirements(v X402V2PaymentRequirements) error { + b, err := json.Marshal(v) + t.union = b + return err +} - AddEndUserSolanaAccount(ctx context.Context, userId string, params *AddEndUserSolanaAccountParams, body AddEndUserSolanaAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) +// MergeX402V2PaymentRequirements performs a merge with any union data inside the X402PaymentRequirements, using the provided X402V2PaymentRequirements +func (t *X402PaymentRequirements) MergeX402V2PaymentRequirements(v X402V2PaymentRequirements) error { + b, err := json.Marshal(v) + if err != nil { + return err + } - // ListEvmAccounts request - ListEvmAccounts(ctx context.Context, params *ListEvmAccountsParams, reqEditors ...RequestEditorFn) (*http.Response, error) + merged, err := runtime.JsonMerge(t.union, b) + t.union = merged + return err +} - // CreateEvmAccountWithBody request with any body - CreateEvmAccountWithBody(ctx context.Context, params *CreateEvmAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) +// AsX402V1PaymentRequirements returns the union data inside the X402PaymentRequirements as a X402V1PaymentRequirements +func (t X402PaymentRequirements) AsX402V1PaymentRequirements() (X402V1PaymentRequirements, error) { + var body X402V1PaymentRequirements + err := json.Unmarshal(t.union, &body) + return body, err +} - CreateEvmAccount(ctx context.Context, params *CreateEvmAccountParams, body CreateEvmAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) +// FromX402V1PaymentRequirements overwrites any union data inside the X402PaymentRequirements as the provided X402V1PaymentRequirements +func (t *X402PaymentRequirements) FromX402V1PaymentRequirements(v X402V1PaymentRequirements) error { + b, err := json.Marshal(v) + t.union = b + return err +} - // GetEvmAccountByName request - GetEvmAccountByName(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*http.Response, error) +// MergeX402V1PaymentRequirements performs a merge with any union data inside the X402PaymentRequirements, using the provided X402V1PaymentRequirements +func (t *X402PaymentRequirements) MergeX402V1PaymentRequirements(v X402V1PaymentRequirements) error { + b, err := json.Marshal(v) + if err != nil { + return err + } - // ExportEvmAccountByNameWithBody request with any body - ExportEvmAccountByNameWithBody(ctx context.Context, name string, params *ExportEvmAccountByNameParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + merged, err := runtime.JsonMerge(t.union, b) + t.union = merged + return err +} - ExportEvmAccountByName(ctx context.Context, name string, params *ExportEvmAccountByNameParams, body ExportEvmAccountByNameJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) +func (t X402PaymentRequirements) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} - // ImportEvmAccountWithBody request with any body - ImportEvmAccountWithBody(ctx context.Context, params *ImportEvmAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) +func (t *X402PaymentRequirements) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} - ImportEvmAccount(ctx context.Context, params *ImportEvmAccountParams, body ImportEvmAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) +// AsX402ExactEvmPayload returns the union data inside the X402V1PaymentPayload_Payload as a X402ExactEvmPayload +func (t X402V1PaymentPayload_Payload) AsX402ExactEvmPayload() (X402ExactEvmPayload, error) { + var body X402ExactEvmPayload + err := json.Unmarshal(t.union, &body) + return body, err +} - // GetEvmAccount request - GetEvmAccount(ctx context.Context, address string, reqEditors ...RequestEditorFn) (*http.Response, error) +// FromX402ExactEvmPayload overwrites any union data inside the X402V1PaymentPayload_Payload as the provided X402ExactEvmPayload +func (t *X402V1PaymentPayload_Payload) FromX402ExactEvmPayload(v X402ExactEvmPayload) error { + b, err := json.Marshal(v) + t.union = b + return err +} - // UpdateEvmAccountWithBody request with any body - UpdateEvmAccountWithBody(ctx context.Context, address string, params *UpdateEvmAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) +// MergeX402ExactEvmPayload performs a merge with any union data inside the X402V1PaymentPayload_Payload, using the provided X402ExactEvmPayload +func (t *X402V1PaymentPayload_Payload) MergeX402ExactEvmPayload(v X402ExactEvmPayload) error { + b, err := json.Marshal(v) + if err != nil { + return err + } - UpdateEvmAccount(ctx context.Context, address string, params *UpdateEvmAccountParams, body UpdateEvmAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + merged, err := runtime.JsonMerge(t.union, b) + t.union = merged + return err +} - // CreateEvmEip7702DelegationWithBody request with any body - CreateEvmEip7702DelegationWithBody(ctx context.Context, address string, params *CreateEvmEip7702DelegationParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) +// AsX402ExactEvmPermit2Payload returns the union data inside the X402V1PaymentPayload_Payload as a X402ExactEvmPermit2Payload +func (t X402V1PaymentPayload_Payload) AsX402ExactEvmPermit2Payload() (X402ExactEvmPermit2Payload, error) { + var body X402ExactEvmPermit2Payload + err := json.Unmarshal(t.union, &body) + return body, err +} - CreateEvmEip7702Delegation(ctx context.Context, address string, params *CreateEvmEip7702DelegationParams, body CreateEvmEip7702DelegationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) +// FromX402ExactEvmPermit2Payload overwrites any union data inside the X402V1PaymentPayload_Payload as the provided X402ExactEvmPermit2Payload +func (t *X402V1PaymentPayload_Payload) FromX402ExactEvmPermit2Payload(v X402ExactEvmPermit2Payload) error { + b, err := json.Marshal(v) + t.union = b + return err +} - // ExportEvmAccountWithBody request with any body - ExportEvmAccountWithBody(ctx context.Context, address string, params *ExportEvmAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) +// MergeX402ExactEvmPermit2Payload performs a merge with any union data inside the X402V1PaymentPayload_Payload, using the provided X402ExactEvmPermit2Payload +func (t *X402V1PaymentPayload_Payload) MergeX402ExactEvmPermit2Payload(v X402ExactEvmPermit2Payload) error { + b, err := json.Marshal(v) + if err != nil { + return err + } - ExportEvmAccount(ctx context.Context, address string, params *ExportEvmAccountParams, body ExportEvmAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + merged, err := runtime.JsonMerge(t.union, b) + t.union = merged + return err +} - // SendEvmTransactionWithBody request with any body - SendEvmTransactionWithBody(ctx context.Context, address string, params *SendEvmTransactionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) +// AsX402ExactSolanaPayload returns the union data inside the X402V1PaymentPayload_Payload as a X402ExactSolanaPayload +func (t X402V1PaymentPayload_Payload) AsX402ExactSolanaPayload() (X402ExactSolanaPayload, error) { + var body X402ExactSolanaPayload + err := json.Unmarshal(t.union, &body) + return body, err +} - SendEvmTransaction(ctx context.Context, address string, params *SendEvmTransactionParams, body SendEvmTransactionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) +// FromX402ExactSolanaPayload overwrites any union data inside the X402V1PaymentPayload_Payload as the provided X402ExactSolanaPayload +func (t *X402V1PaymentPayload_Payload) FromX402ExactSolanaPayload(v X402ExactSolanaPayload) error { + b, err := json.Marshal(v) + t.union = b + return err +} - // SignEvmHashWithBody request with any body - SignEvmHashWithBody(ctx context.Context, address string, params *SignEvmHashParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) +// MergeX402ExactSolanaPayload performs a merge with any union data inside the X402V1PaymentPayload_Payload, using the provided X402ExactSolanaPayload +func (t *X402V1PaymentPayload_Payload) MergeX402ExactSolanaPayload(v X402ExactSolanaPayload) error { + b, err := json.Marshal(v) + if err != nil { + return err + } - SignEvmHash(ctx context.Context, address string, params *SignEvmHashParams, body SignEvmHashJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + merged, err := runtime.JsonMerge(t.union, b) + t.union = merged + return err +} - // SignEvmMessageWithBody request with any body - SignEvmMessageWithBody(ctx context.Context, address string, params *SignEvmMessageParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) +func (t X402V1PaymentPayload_Payload) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} - SignEvmMessage(ctx context.Context, address string, params *SignEvmMessageParams, body SignEvmMessageJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) +func (t *X402V1PaymentPayload_Payload) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} - // SignEvmTransactionWithBody request with any body - SignEvmTransactionWithBody(ctx context.Context, address string, params *SignEvmTransactionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) +// AsX402ExactEvmPayload returns the union data inside the X402V2PaymentPayload_Payload as a X402ExactEvmPayload +func (t X402V2PaymentPayload_Payload) AsX402ExactEvmPayload() (X402ExactEvmPayload, error) { + var body X402ExactEvmPayload + err := json.Unmarshal(t.union, &body) + return body, err +} - SignEvmTransaction(ctx context.Context, address string, params *SignEvmTransactionParams, body SignEvmTransactionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) +// FromX402ExactEvmPayload overwrites any union data inside the X402V2PaymentPayload_Payload as the provided X402ExactEvmPayload +func (t *X402V2PaymentPayload_Payload) FromX402ExactEvmPayload(v X402ExactEvmPayload) error { + b, err := json.Marshal(v) + t.union = b + return err +} - // SignEvmTypedDataWithBody request with any body - SignEvmTypedDataWithBody(ctx context.Context, address string, params *SignEvmTypedDataParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) +// MergeX402ExactEvmPayload performs a merge with any union data inside the X402V2PaymentPayload_Payload, using the provided X402ExactEvmPayload +func (t *X402V2PaymentPayload_Payload) MergeX402ExactEvmPayload(v X402ExactEvmPayload) error { + b, err := json.Marshal(v) + if err != nil { + return err + } - SignEvmTypedData(ctx context.Context, address string, params *SignEvmTypedDataParams, body SignEvmTypedDataJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + merged, err := runtime.JsonMerge(t.union, b) + t.union = merged + return err +} - // GetEvmEip7702DelegationOperationById request - GetEvmEip7702DelegationOperationById(ctx context.Context, delegationOperationId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) +// AsX402ExactEvmPermit2Payload returns the union data inside the X402V2PaymentPayload_Payload as a X402ExactEvmPermit2Payload +func (t X402V2PaymentPayload_Payload) AsX402ExactEvmPermit2Payload() (X402ExactEvmPermit2Payload, error) { + var body X402ExactEvmPermit2Payload + err := json.Unmarshal(t.union, &body) + return body, err +} - // RequestEvmFaucetWithBody request with any body - RequestEvmFaucetWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) +// FromX402ExactEvmPermit2Payload overwrites any union data inside the X402V2PaymentPayload_Payload as the provided X402ExactEvmPermit2Payload +func (t *X402V2PaymentPayload_Payload) FromX402ExactEvmPermit2Payload(v X402ExactEvmPermit2Payload) error { + b, err := json.Marshal(v) + t.union = b + return err +} - RequestEvmFaucet(ctx context.Context, body RequestEvmFaucetJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) +// MergeX402ExactEvmPermit2Payload performs a merge with any union data inside the X402V2PaymentPayload_Payload, using the provided X402ExactEvmPermit2Payload +func (t *X402V2PaymentPayload_Payload) MergeX402ExactEvmPermit2Payload(v X402ExactEvmPermit2Payload) error { + b, err := json.Marshal(v) + if err != nil { + return err + } - // ListEvmSmartAccounts request - ListEvmSmartAccounts(ctx context.Context, params *ListEvmSmartAccountsParams, reqEditors ...RequestEditorFn) (*http.Response, error) + merged, err := runtime.JsonMerge(t.union, b) + t.union = merged + return err +} - // CreateEvmSmartAccountWithBody request with any body - CreateEvmSmartAccountWithBody(ctx context.Context, params *CreateEvmSmartAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) +// AsX402ExactSolanaPayload returns the union data inside the X402V2PaymentPayload_Payload as a X402ExactSolanaPayload +func (t X402V2PaymentPayload_Payload) AsX402ExactSolanaPayload() (X402ExactSolanaPayload, error) { + var body X402ExactSolanaPayload + err := json.Unmarshal(t.union, &body) + return body, err +} - CreateEvmSmartAccount(ctx context.Context, params *CreateEvmSmartAccountParams, body CreateEvmSmartAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) +// FromX402ExactSolanaPayload overwrites any union data inside the X402V2PaymentPayload_Payload as the provided X402ExactSolanaPayload +func (t *X402V2PaymentPayload_Payload) FromX402ExactSolanaPayload(v X402ExactSolanaPayload) error { + b, err := json.Marshal(v) + t.union = b + return err +} - // GetEvmSmartAccountByName request - GetEvmSmartAccountByName(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*http.Response, error) +// MergeX402ExactSolanaPayload performs a merge with any union data inside the X402V2PaymentPayload_Payload, using the provided X402ExactSolanaPayload +func (t *X402V2PaymentPayload_Payload) MergeX402ExactSolanaPayload(v X402ExactSolanaPayload) error { + b, err := json.Marshal(v) + if err != nil { + return err + } - // GetEvmSmartAccount request - GetEvmSmartAccount(ctx context.Context, address string, reqEditors ...RequestEditorFn) (*http.Response, error) + merged, err := runtime.JsonMerge(t.union, b) + t.union = merged + return err +} - // UpdateEvmSmartAccountWithBody request with any body - UpdateEvmSmartAccountWithBody(ctx context.Context, address string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) +func (t X402V2PaymentPayload_Payload) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} - UpdateEvmSmartAccount(ctx context.Context, address string, body UpdateEvmSmartAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) +func (t *X402V2PaymentPayload_Payload) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} - // CreateSpendPermissionWithBody request with any body - CreateSpendPermissionWithBody(ctx context.Context, address string, params *CreateSpendPermissionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) +// RequestEditorFn is the function signature for the RequestEditor callback function +type RequestEditorFn func(ctx context.Context, req *http.Request) error - CreateSpendPermission(ctx context.Context, address string, params *CreateSpendPermissionParams, body CreateSpendPermissionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) +// Doer performs HTTP requests. +// +// The standard http.Client implements this interface. +type HttpRequestDoer interface { + Do(req *http.Request) (*http.Response, error) +} - // ListSpendPermissions request - ListSpendPermissions(ctx context.Context, address string, params *ListSpendPermissionsParams, reqEditors ...RequestEditorFn) (*http.Response, error) +// CDPClient which conforms to the OpenAPI3 specification for this service. +type CDPClient struct { + // The endpoint of the server conforming to this interface, with scheme, + // https://api.deepmap.com for example. This can contain a path relative + // to the server, such as https://api.deepmap.com/dev-test, and all the + // paths in the swagger spec will be appended to the server. + Server string - // RevokeSpendPermissionWithBody request with any body - RevokeSpendPermissionWithBody(ctx context.Context, address string, params *RevokeSpendPermissionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // Doer for performing requests, typically a *http.Client with any + // customized settings, such as certificate chains. + Client HttpRequestDoer - RevokeSpendPermission(ctx context.Context, address string, params *RevokeSpendPermissionParams, body RevokeSpendPermissionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // A list of callbacks for modifying requests which are generated before sending over + // the network. + RequestEditors []RequestEditorFn +} - // PrepareUserOperationWithBody request with any body - PrepareUserOperationWithBody(ctx context.Context, address string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) +// ClientOption allows setting custom parameters during construction +type ClientOption func(*CDPClient) error - PrepareUserOperation(ctx context.Context, address string, body PrepareUserOperationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) +// Creates a new CDPClient, with reasonable defaults +func NewClient(server string, opts ...ClientOption) (*CDPClient, error) { + // create a client with sane default values + client := CDPClient{ + Server: server, + } + // mutate client and add all optional params + for _, o := range opts { + if err := o(&client); err != nil { + return nil, err + } + } + // ensure the server URL always has a trailing slash + if !strings.HasSuffix(client.Server, "/") { + client.Server += "/" + } + // create httpClient, if not already present + if client.Client == nil { + client.Client = &http.Client{} + } + return &client, nil +} - // PrepareAndSendUserOperationWithBody request with any body - PrepareAndSendUserOperationWithBody(ctx context.Context, address string, params *PrepareAndSendUserOperationParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) +// WithHTTPClient allows overriding the default Doer, which is +// automatically created using http.Client. This is useful for tests. +func WithHTTPClient(doer HttpRequestDoer) ClientOption { + return func(c *CDPClient) error { + c.Client = doer + return nil + } +} - PrepareAndSendUserOperation(ctx context.Context, address string, params *PrepareAndSendUserOperationParams, body PrepareAndSendUserOperationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) +// WithRequestEditorFn allows setting up a callback function, which will be +// called right before sending the request. This can be used to mutate the request. +func WithRequestEditorFn(fn RequestEditorFn) ClientOption { + return func(c *CDPClient) error { + c.RequestEditors = append(c.RequestEditors, fn) + return nil + } +} - // GetUserOperation request - GetUserOperation(ctx context.Context, address string, userOpHash string, reqEditors ...RequestEditorFn) (*http.Response, error) +// The interface specification for the client above. +type ClientInterface interface { + // ListDataTokenBalances request + ListDataTokenBalances(ctx context.Context, network ListEvmTokenBalancesNetwork, address string, params *ListDataTokenBalancesParams, reqEditors ...RequestEditorFn) (*http.Response, error) - // SendUserOperationWithBody request with any body - SendUserOperationWithBody(ctx context.Context, address string, userOpHash string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // ListTokensForAccount request + ListTokensForAccount(ctx context.Context, network ListTokensForAccountParamsNetwork, address string, reqEditors ...RequestEditorFn) (*http.Response, error) - SendUserOperation(ctx context.Context, address string, userOpHash string, body SendUserOperationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // GetSQLGrammar request + GetSQLGrammar(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - // CreateEvmSwapQuoteWithBody request with any body - CreateEvmSwapQuoteWithBody(ctx context.Context, params *CreateEvmSwapQuoteParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // RunSQLQueryWithBody request with any body + RunSQLQueryWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - CreateEvmSwapQuote(ctx context.Context, params *CreateEvmSwapQuoteParams, body CreateEvmSwapQuoteJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + RunSQLQuery(ctx context.Context, body RunSQLQueryJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetEvmSwapPrice request - GetEvmSwapPrice(ctx context.Context, params *GetEvmSwapPriceParams, reqEditors ...RequestEditorFn) (*http.Response, error) + // ListWebhookSubscriptions request + ListWebhookSubscriptions(ctx context.Context, params *ListWebhookSubscriptionsParams, reqEditors ...RequestEditorFn) (*http.Response, error) - // ListEvmTokenBalances request - ListEvmTokenBalances(ctx context.Context, network ListEvmTokenBalancesNetwork, address string, params *ListEvmTokenBalancesParams, reqEditors ...RequestEditorFn) (*http.Response, error) + // CreateWebhookSubscriptionWithBody request with any body + CreateWebhookSubscriptionWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetOnrampUserLimitsWithBody request with any body - GetOnrampUserLimitsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + CreateWebhookSubscription(ctx context.Context, body CreateWebhookSubscriptionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - GetOnrampUserLimits(ctx context.Context, body GetOnrampUserLimitsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // DeleteWebhookSubscription request + DeleteWebhookSubscription(ctx context.Context, subscriptionId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) - // CreateOnrampOrderWithBody request with any body - CreateOnrampOrderWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // GetWebhookSubscription request + GetWebhookSubscription(ctx context.Context, subscriptionId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) - CreateOnrampOrder(ctx context.Context, body CreateOnrampOrderJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // UpdateWebhookSubscriptionWithBody request with any body + UpdateWebhookSubscriptionWithBody(ctx context.Context, subscriptionId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetOnrampOrderById request - GetOnrampOrderById(ctx context.Context, orderId string, reqEditors ...RequestEditorFn) (*http.Response, error) + UpdateWebhookSubscription(ctx context.Context, subscriptionId openapi_types.UUID, body UpdateWebhookSubscriptionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // CreateOnrampSessionWithBody request with any body - CreateOnrampSessionWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // RevokeDelegationForEndUserWithBody request with any body + RevokeDelegationForEndUserWithBody(ctx context.Context, projectId string, userId string, params *RevokeDelegationForEndUserParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - CreateOnrampSession(ctx context.Context, body CreateOnrampSessionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + RevokeDelegationForEndUser(ctx context.Context, projectId string, userId string, params *RevokeDelegationForEndUserParams, body RevokeDelegationForEndUserJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // ListPolicies request - ListPolicies(ctx context.Context, params *ListPoliciesParams, reqEditors ...RequestEditorFn) (*http.Response, error) + // CreateEvmEip7702DelegationWithEndUserAccountWithBody request with any body + CreateEvmEip7702DelegationWithEndUserAccountWithBody(ctx context.Context, projectId string, userId string, params *CreateEvmEip7702DelegationWithEndUserAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - // CreatePolicyWithBody request with any body - CreatePolicyWithBody(ctx context.Context, params *CreatePolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + CreateEvmEip7702DelegationWithEndUserAccount(ctx context.Context, projectId string, userId string, params *CreateEvmEip7702DelegationWithEndUserAccountParams, body CreateEvmEip7702DelegationWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - CreatePolicy(ctx context.Context, params *CreatePolicyParams, body CreatePolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // SendEvmTransactionWithEndUserAccountWithBody request with any body + SendEvmTransactionWithEndUserAccountWithBody(ctx context.Context, projectId string, userId string, params *SendEvmTransactionWithEndUserAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - // DeletePolicy request - DeletePolicy(ctx context.Context, policyId string, params *DeletePolicyParams, reqEditors ...RequestEditorFn) (*http.Response, error) + SendEvmTransactionWithEndUserAccount(ctx context.Context, projectId string, userId string, params *SendEvmTransactionWithEndUserAccountParams, body SendEvmTransactionWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetPolicyById request - GetPolicyById(ctx context.Context, policyId string, reqEditors ...RequestEditorFn) (*http.Response, error) + // SignEvmHashWithEndUserAccountWithBody request with any body + SignEvmHashWithEndUserAccountWithBody(ctx context.Context, projectId string, userId string, params *SignEvmHashWithEndUserAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - // UpdatePolicyWithBody request with any body - UpdatePolicyWithBody(ctx context.Context, policyId string, params *UpdatePolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + SignEvmHashWithEndUserAccount(ctx context.Context, projectId string, userId string, params *SignEvmHashWithEndUserAccountParams, body SignEvmHashWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - UpdatePolicy(ctx context.Context, policyId string, params *UpdatePolicyParams, body UpdatePolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // SignEvmMessageWithEndUserAccountWithBody request with any body + SignEvmMessageWithEndUserAccountWithBody(ctx context.Context, projectId string, userId string, params *SignEvmMessageWithEndUserAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - // ListSolanaAccounts request - ListSolanaAccounts(ctx context.Context, params *ListSolanaAccountsParams, reqEditors ...RequestEditorFn) (*http.Response, error) + SignEvmMessageWithEndUserAccount(ctx context.Context, projectId string, userId string, params *SignEvmMessageWithEndUserAccountParams, body SignEvmMessageWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // CreateSolanaAccountWithBody request with any body - CreateSolanaAccountWithBody(ctx context.Context, params *CreateSolanaAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // SignEvmTransactionWithEndUserAccountWithBody request with any body + SignEvmTransactionWithEndUserAccountWithBody(ctx context.Context, projectId string, userId string, params *SignEvmTransactionWithEndUserAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - CreateSolanaAccount(ctx context.Context, params *CreateSolanaAccountParams, body CreateSolanaAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + SignEvmTransactionWithEndUserAccount(ctx context.Context, projectId string, userId string, params *SignEvmTransactionWithEndUserAccountParams, body SignEvmTransactionWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetSolanaAccountByName request - GetSolanaAccountByName(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*http.Response, error) + // SignEvmTypedDataWithEndUserAccountWithBody request with any body + SignEvmTypedDataWithEndUserAccountWithBody(ctx context.Context, projectId string, userId string, params *SignEvmTypedDataWithEndUserAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - // ExportSolanaAccountByNameWithBody request with any body - ExportSolanaAccountByNameWithBody(ctx context.Context, name string, params *ExportSolanaAccountByNameParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + SignEvmTypedDataWithEndUserAccount(ctx context.Context, projectId string, userId string, params *SignEvmTypedDataWithEndUserAccountParams, body SignEvmTypedDataWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - ExportSolanaAccountByName(ctx context.Context, name string, params *ExportSolanaAccountByNameParams, body ExportSolanaAccountByNameJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // SendUserOperationWithEndUserAccountWithBody request with any body + SendUserOperationWithEndUserAccountWithBody(ctx context.Context, projectId string, userId string, address string, params *SendUserOperationWithEndUserAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - // ImportSolanaAccountWithBody request with any body - ImportSolanaAccountWithBody(ctx context.Context, params *ImportSolanaAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + SendUserOperationWithEndUserAccount(ctx context.Context, projectId string, userId string, address string, params *SendUserOperationWithEndUserAccountParams, body SendUserOperationWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - ImportSolanaAccount(ctx context.Context, params *ImportSolanaAccountParams, body ImportSolanaAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // RevokeSpendPermissionWithEndUserAccountWithBody request with any body + RevokeSpendPermissionWithEndUserAccountWithBody(ctx context.Context, projectId string, userId string, address string, params *RevokeSpendPermissionWithEndUserAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - // SendSolanaTransactionWithBody request with any body - SendSolanaTransactionWithBody(ctx context.Context, params *SendSolanaTransactionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + RevokeSpendPermissionWithEndUserAccount(ctx context.Context, projectId string, userId string, address string, params *RevokeSpendPermissionWithEndUserAccountParams, body RevokeSpendPermissionWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - SendSolanaTransaction(ctx context.Context, params *SendSolanaTransactionParams, body SendSolanaTransactionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // SendEvmAssetWithEndUserAccountWithBody request with any body + SendEvmAssetWithEndUserAccountWithBody(ctx context.Context, projectId string, userId string, address BlockchainAddress, asset Asset, params *SendEvmAssetWithEndUserAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + SendEvmAssetWithEndUserAccount(ctx context.Context, projectId string, userId string, address BlockchainAddress, asset Asset, params *SendEvmAssetWithEndUserAccountParams, body SendEvmAssetWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // SendSolanaTransactionWithEndUserAccountWithBody request with any body + SendSolanaTransactionWithEndUserAccountWithBody(ctx context.Context, projectId string, userId string, params *SendSolanaTransactionWithEndUserAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + SendSolanaTransactionWithEndUserAccount(ctx context.Context, projectId string, userId string, params *SendSolanaTransactionWithEndUserAccountParams, body SendSolanaTransactionWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // SignSolanaHashWithEndUserAccountWithBody request with any body + SignSolanaHashWithEndUserAccountWithBody(ctx context.Context, projectId string, userId string, params *SignSolanaHashWithEndUserAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + SignSolanaHashWithEndUserAccount(ctx context.Context, projectId string, userId string, params *SignSolanaHashWithEndUserAccountParams, body SignSolanaHashWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // SignSolanaMessageWithEndUserAccountWithBody request with any body + SignSolanaMessageWithEndUserAccountWithBody(ctx context.Context, projectId string, userId string, params *SignSolanaMessageWithEndUserAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + SignSolanaMessageWithEndUserAccount(ctx context.Context, projectId string, userId string, params *SignSolanaMessageWithEndUserAccountParams, body SignSolanaMessageWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // SignSolanaTransactionWithEndUserAccountWithBody request with any body + SignSolanaTransactionWithEndUserAccountWithBody(ctx context.Context, projectId string, userId string, params *SignSolanaTransactionWithEndUserAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + SignSolanaTransactionWithEndUserAccount(ctx context.Context, projectId string, userId string, params *SignSolanaTransactionWithEndUserAccountParams, body SignSolanaTransactionWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // SendSolanaAssetWithEndUserAccountWithBody request with any body + SendSolanaAssetWithEndUserAccountWithBody(ctx context.Context, projectId string, userId string, address BlockchainAddress, asset Asset, params *SendSolanaAssetWithEndUserAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + SendSolanaAssetWithEndUserAccount(ctx context.Context, projectId string, userId string, address BlockchainAddress, asset Asset, params *SendSolanaAssetWithEndUserAccountParams, body SendSolanaAssetWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ListEndUsers request + ListEndUsers(ctx context.Context, params *ListEndUsersParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // CreateEndUserWithBody request with any body + CreateEndUserWithBody(ctx context.Context, params *CreateEndUserParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + CreateEndUser(ctx context.Context, params *CreateEndUserParams, body CreateEndUserJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ValidateEndUserAccessTokenWithBody request with any body + ValidateEndUserAccessTokenWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + ValidateEndUserAccessToken(ctx context.Context, body ValidateEndUserAccessTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ImportEndUserWithBody request with any body + ImportEndUserWithBody(ctx context.Context, params *ImportEndUserParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + ImportEndUser(ctx context.Context, params *ImportEndUserParams, body ImportEndUserJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetEndUser request + GetEndUser(ctx context.Context, userId string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // AddEndUserEvmAccountWithBody request with any body + AddEndUserEvmAccountWithBody(ctx context.Context, userId string, params *AddEndUserEvmAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + AddEndUserEvmAccount(ctx context.Context, userId string, params *AddEndUserEvmAccountParams, body AddEndUserEvmAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // AddEndUserEvmSmartAccountWithBody request with any body + AddEndUserEvmSmartAccountWithBody(ctx context.Context, userId string, params *AddEndUserEvmSmartAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + AddEndUserEvmSmartAccount(ctx context.Context, userId string, params *AddEndUserEvmSmartAccountParams, body AddEndUserEvmSmartAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // AddEndUserSolanaAccountWithBody request with any body + AddEndUserSolanaAccountWithBody(ctx context.Context, userId string, params *AddEndUserSolanaAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + AddEndUserSolanaAccount(ctx context.Context, userId string, params *AddEndUserSolanaAccountParams, body AddEndUserSolanaAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ListEvmAccounts request + ListEvmAccounts(ctx context.Context, params *ListEvmAccountsParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // CreateEvmAccountWithBody request with any body + CreateEvmAccountWithBody(ctx context.Context, params *CreateEvmAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + CreateEvmAccount(ctx context.Context, params *CreateEvmAccountParams, body CreateEvmAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetEvmAccountByName request + GetEvmAccountByName(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ExportEvmAccountByNameWithBody request with any body + ExportEvmAccountByNameWithBody(ctx context.Context, name string, params *ExportEvmAccountByNameParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + ExportEvmAccountByName(ctx context.Context, name string, params *ExportEvmAccountByNameParams, body ExportEvmAccountByNameJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ImportEvmAccountWithBody request with any body + ImportEvmAccountWithBody(ctx context.Context, params *ImportEvmAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + ImportEvmAccount(ctx context.Context, params *ImportEvmAccountParams, body ImportEvmAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetEvmAccount request + GetEvmAccount(ctx context.Context, address string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // UpdateEvmAccountWithBody request with any body + UpdateEvmAccountWithBody(ctx context.Context, address string, params *UpdateEvmAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + UpdateEvmAccount(ctx context.Context, address string, params *UpdateEvmAccountParams, body UpdateEvmAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // CreateEvmEip7702DelegationWithBody request with any body + CreateEvmEip7702DelegationWithBody(ctx context.Context, address string, params *CreateEvmEip7702DelegationParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + CreateEvmEip7702Delegation(ctx context.Context, address string, params *CreateEvmEip7702DelegationParams, body CreateEvmEip7702DelegationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ExportEvmAccountWithBody request with any body + ExportEvmAccountWithBody(ctx context.Context, address string, params *ExportEvmAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + ExportEvmAccount(ctx context.Context, address string, params *ExportEvmAccountParams, body ExportEvmAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // SendEvmTransactionWithBody request with any body + SendEvmTransactionWithBody(ctx context.Context, address string, params *SendEvmTransactionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + SendEvmTransaction(ctx context.Context, address string, params *SendEvmTransactionParams, body SendEvmTransactionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // SignEvmHashWithBody request with any body + SignEvmHashWithBody(ctx context.Context, address string, params *SignEvmHashParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + SignEvmHash(ctx context.Context, address string, params *SignEvmHashParams, body SignEvmHashJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // SignEvmMessageWithBody request with any body + SignEvmMessageWithBody(ctx context.Context, address string, params *SignEvmMessageParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + SignEvmMessage(ctx context.Context, address string, params *SignEvmMessageParams, body SignEvmMessageJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // SignEvmTransactionWithBody request with any body + SignEvmTransactionWithBody(ctx context.Context, address string, params *SignEvmTransactionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + SignEvmTransaction(ctx context.Context, address string, params *SignEvmTransactionParams, body SignEvmTransactionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // SignEvmTypedDataWithBody request with any body + SignEvmTypedDataWithBody(ctx context.Context, address string, params *SignEvmTypedDataParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + SignEvmTypedData(ctx context.Context, address string, params *SignEvmTypedDataParams, body SignEvmTypedDataJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetEvmEip7702DelegationOperationById request + GetEvmEip7702DelegationOperationById(ctx context.Context, delegationOperationId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) + + // RequestEvmFaucetWithBody request with any body + RequestEvmFaucetWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + RequestEvmFaucet(ctx context.Context, body RequestEvmFaucetJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ListEvmSmartAccounts request + ListEvmSmartAccounts(ctx context.Context, params *ListEvmSmartAccountsParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // CreateEvmSmartAccountWithBody request with any body + CreateEvmSmartAccountWithBody(ctx context.Context, params *CreateEvmSmartAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + CreateEvmSmartAccount(ctx context.Context, params *CreateEvmSmartAccountParams, body CreateEvmSmartAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetEvmSmartAccountByName request + GetEvmSmartAccountByName(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetEvmSmartAccount request + GetEvmSmartAccount(ctx context.Context, address string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // UpdateEvmSmartAccountWithBody request with any body + UpdateEvmSmartAccountWithBody(ctx context.Context, address string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + UpdateEvmSmartAccount(ctx context.Context, address string, body UpdateEvmSmartAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // CreateSpendPermissionWithBody request with any body + CreateSpendPermissionWithBody(ctx context.Context, address string, params *CreateSpendPermissionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + CreateSpendPermission(ctx context.Context, address string, params *CreateSpendPermissionParams, body CreateSpendPermissionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ListSpendPermissions request + ListSpendPermissions(ctx context.Context, address string, params *ListSpendPermissionsParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // RevokeSpendPermissionWithBody request with any body + RevokeSpendPermissionWithBody(ctx context.Context, address string, params *RevokeSpendPermissionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + RevokeSpendPermission(ctx context.Context, address string, params *RevokeSpendPermissionParams, body RevokeSpendPermissionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PrepareUserOperationWithBody request with any body + PrepareUserOperationWithBody(ctx context.Context, address string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + PrepareUserOperation(ctx context.Context, address string, body PrepareUserOperationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PrepareAndSendUserOperationWithBody request with any body + PrepareAndSendUserOperationWithBody(ctx context.Context, address string, params *PrepareAndSendUserOperationParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + PrepareAndSendUserOperation(ctx context.Context, address string, params *PrepareAndSendUserOperationParams, body PrepareAndSendUserOperationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetUserOperation request + GetUserOperation(ctx context.Context, address string, userOpHash string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // SendUserOperationWithBody request with any body + SendUserOperationWithBody(ctx context.Context, address string, userOpHash string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + SendUserOperation(ctx context.Context, address string, userOpHash string, body SendUserOperationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // CreateEvmSwapQuoteWithBody request with any body + CreateEvmSwapQuoteWithBody(ctx context.Context, params *CreateEvmSwapQuoteParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + CreateEvmSwapQuote(ctx context.Context, params *CreateEvmSwapQuoteParams, body CreateEvmSwapQuoteJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetEvmSwapPrice request + GetEvmSwapPrice(ctx context.Context, params *GetEvmSwapPriceParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ListEvmTokenBalances request + ListEvmTokenBalances(ctx context.Context, network ListEvmTokenBalancesNetwork, address string, params *ListEvmTokenBalancesParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetOnrampUserLimitsWithBody request with any body + GetOnrampUserLimitsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + GetOnrampUserLimits(ctx context.Context, body GetOnrampUserLimitsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // CreateOnrampOrderWithBody request with any body + CreateOnrampOrderWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + CreateOnrampOrder(ctx context.Context, body CreateOnrampOrderJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetOnrampOrderById request + GetOnrampOrderById(ctx context.Context, orderId string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // CreateOnrampSessionWithBody request with any body + CreateOnrampSessionWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + CreateOnrampSession(ctx context.Context, body CreateOnrampSessionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ListPolicies request + ListPolicies(ctx context.Context, params *ListPoliciesParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // CreatePolicyWithBody request with any body + CreatePolicyWithBody(ctx context.Context, params *CreatePolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + CreatePolicy(ctx context.Context, params *CreatePolicyParams, body CreatePolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeletePolicy request + DeletePolicy(ctx context.Context, policyId string, params *DeletePolicyParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetPolicyById request + GetPolicyById(ctx context.Context, policyId string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // UpdatePolicyWithBody request with any body + UpdatePolicyWithBody(ctx context.Context, policyId string, params *UpdatePolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + UpdatePolicy(ctx context.Context, policyId string, params *UpdatePolicyParams, body UpdatePolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ListSolanaAccounts request + ListSolanaAccounts(ctx context.Context, params *ListSolanaAccountsParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // CreateSolanaAccountWithBody request with any body + CreateSolanaAccountWithBody(ctx context.Context, params *CreateSolanaAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + CreateSolanaAccount(ctx context.Context, params *CreateSolanaAccountParams, body CreateSolanaAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetSolanaAccountByName request + GetSolanaAccountByName(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ExportSolanaAccountByNameWithBody request with any body + ExportSolanaAccountByNameWithBody(ctx context.Context, name string, params *ExportSolanaAccountByNameParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + ExportSolanaAccountByName(ctx context.Context, name string, params *ExportSolanaAccountByNameParams, body ExportSolanaAccountByNameJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ImportSolanaAccountWithBody request with any body + ImportSolanaAccountWithBody(ctx context.Context, params *ImportSolanaAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + ImportSolanaAccount(ctx context.Context, params *ImportSolanaAccountParams, body ImportSolanaAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // SendSolanaTransactionWithBody request with any body + SendSolanaTransactionWithBody(ctx context.Context, params *SendSolanaTransactionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + SendSolanaTransaction(ctx context.Context, params *SendSolanaTransactionParams, body SendSolanaTransactionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // GetSolanaAccount request GetSolanaAccount(ctx context.Context, address string, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -8615,8 +9285,8 @@ func (c *CDPClient) UpdateWebhookSubscription(ctx context.Context, subscriptionI return c.Client.Do(req) } -func (c *CDPClient) ListEndUsers(ctx context.Context, params *ListEndUsersParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewListEndUsersRequest(c.Server, params) +func (c *CDPClient) RevokeDelegationForEndUserWithBody(ctx context.Context, projectId string, userId string, params *RevokeDelegationForEndUserParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewRevokeDelegationForEndUserRequestWithBody(c.Server, projectId, userId, params, contentType, body) if err != nil { return nil, err } @@ -8627,8 +9297,8 @@ func (c *CDPClient) ListEndUsers(ctx context.Context, params *ListEndUsersParams return c.Client.Do(req) } -func (c *CDPClient) CreateEndUserWithBody(ctx context.Context, params *CreateEndUserParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateEndUserRequestWithBody(c.Server, params, contentType, body) +func (c *CDPClient) RevokeDelegationForEndUser(ctx context.Context, projectId string, userId string, params *RevokeDelegationForEndUserParams, body RevokeDelegationForEndUserJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewRevokeDelegationForEndUserRequest(c.Server, projectId, userId, params, body) if err != nil { return nil, err } @@ -8639,8 +9309,8 @@ func (c *CDPClient) CreateEndUserWithBody(ctx context.Context, params *CreateEnd return c.Client.Do(req) } -func (c *CDPClient) CreateEndUser(ctx context.Context, params *CreateEndUserParams, body CreateEndUserJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateEndUserRequest(c.Server, params, body) +func (c *CDPClient) CreateEvmEip7702DelegationWithEndUserAccountWithBody(ctx context.Context, projectId string, userId string, params *CreateEvmEip7702DelegationWithEndUserAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateEvmEip7702DelegationWithEndUserAccountRequestWithBody(c.Server, projectId, userId, params, contentType, body) if err != nil { return nil, err } @@ -8651,8 +9321,8 @@ func (c *CDPClient) CreateEndUser(ctx context.Context, params *CreateEndUserPara return c.Client.Do(req) } -func (c *CDPClient) ValidateEndUserAccessTokenWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewValidateEndUserAccessTokenRequestWithBody(c.Server, contentType, body) +func (c *CDPClient) CreateEvmEip7702DelegationWithEndUserAccount(ctx context.Context, projectId string, userId string, params *CreateEvmEip7702DelegationWithEndUserAccountParams, body CreateEvmEip7702DelegationWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateEvmEip7702DelegationWithEndUserAccountRequest(c.Server, projectId, userId, params, body) if err != nil { return nil, err } @@ -8663,8 +9333,8 @@ func (c *CDPClient) ValidateEndUserAccessTokenWithBody(ctx context.Context, cont return c.Client.Do(req) } -func (c *CDPClient) ValidateEndUserAccessToken(ctx context.Context, body ValidateEndUserAccessTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewValidateEndUserAccessTokenRequest(c.Server, body) +func (c *CDPClient) SendEvmTransactionWithEndUserAccountWithBody(ctx context.Context, projectId string, userId string, params *SendEvmTransactionWithEndUserAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewSendEvmTransactionWithEndUserAccountRequestWithBody(c.Server, projectId, userId, params, contentType, body) if err != nil { return nil, err } @@ -8675,8 +9345,8 @@ func (c *CDPClient) ValidateEndUserAccessToken(ctx context.Context, body Validat return c.Client.Do(req) } -func (c *CDPClient) ImportEndUserWithBody(ctx context.Context, params *ImportEndUserParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewImportEndUserRequestWithBody(c.Server, params, contentType, body) +func (c *CDPClient) SendEvmTransactionWithEndUserAccount(ctx context.Context, projectId string, userId string, params *SendEvmTransactionWithEndUserAccountParams, body SendEvmTransactionWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewSendEvmTransactionWithEndUserAccountRequest(c.Server, projectId, userId, params, body) if err != nil { return nil, err } @@ -8687,8 +9357,8 @@ func (c *CDPClient) ImportEndUserWithBody(ctx context.Context, params *ImportEnd return c.Client.Do(req) } -func (c *CDPClient) ImportEndUser(ctx context.Context, params *ImportEndUserParams, body ImportEndUserJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewImportEndUserRequest(c.Server, params, body) +func (c *CDPClient) SignEvmHashWithEndUserAccountWithBody(ctx context.Context, projectId string, userId string, params *SignEvmHashWithEndUserAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewSignEvmHashWithEndUserAccountRequestWithBody(c.Server, projectId, userId, params, contentType, body) if err != nil { return nil, err } @@ -8699,8 +9369,8 @@ func (c *CDPClient) ImportEndUser(ctx context.Context, params *ImportEndUserPara return c.Client.Do(req) } -func (c *CDPClient) GetEndUser(ctx context.Context, userId string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetEndUserRequest(c.Server, userId) +func (c *CDPClient) SignEvmHashWithEndUserAccount(ctx context.Context, projectId string, userId string, params *SignEvmHashWithEndUserAccountParams, body SignEvmHashWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewSignEvmHashWithEndUserAccountRequest(c.Server, projectId, userId, params, body) if err != nil { return nil, err } @@ -8711,8 +9381,8 @@ func (c *CDPClient) GetEndUser(ctx context.Context, userId string, reqEditors .. return c.Client.Do(req) } -func (c *CDPClient) AddEndUserEvmAccountWithBody(ctx context.Context, userId string, params *AddEndUserEvmAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewAddEndUserEvmAccountRequestWithBody(c.Server, userId, params, contentType, body) +func (c *CDPClient) SignEvmMessageWithEndUserAccountWithBody(ctx context.Context, projectId string, userId string, params *SignEvmMessageWithEndUserAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewSignEvmMessageWithEndUserAccountRequestWithBody(c.Server, projectId, userId, params, contentType, body) if err != nil { return nil, err } @@ -8723,8 +9393,8 @@ func (c *CDPClient) AddEndUserEvmAccountWithBody(ctx context.Context, userId str return c.Client.Do(req) } -func (c *CDPClient) AddEndUserEvmAccount(ctx context.Context, userId string, params *AddEndUserEvmAccountParams, body AddEndUserEvmAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewAddEndUserEvmAccountRequest(c.Server, userId, params, body) +func (c *CDPClient) SignEvmMessageWithEndUserAccount(ctx context.Context, projectId string, userId string, params *SignEvmMessageWithEndUserAccountParams, body SignEvmMessageWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewSignEvmMessageWithEndUserAccountRequest(c.Server, projectId, userId, params, body) if err != nil { return nil, err } @@ -8735,8 +9405,8 @@ func (c *CDPClient) AddEndUserEvmAccount(ctx context.Context, userId string, par return c.Client.Do(req) } -func (c *CDPClient) AddEndUserEvmSmartAccountWithBody(ctx context.Context, userId string, params *AddEndUserEvmSmartAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewAddEndUserEvmSmartAccountRequestWithBody(c.Server, userId, params, contentType, body) +func (c *CDPClient) SignEvmTransactionWithEndUserAccountWithBody(ctx context.Context, projectId string, userId string, params *SignEvmTransactionWithEndUserAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewSignEvmTransactionWithEndUserAccountRequestWithBody(c.Server, projectId, userId, params, contentType, body) if err != nil { return nil, err } @@ -8747,8 +9417,8 @@ func (c *CDPClient) AddEndUserEvmSmartAccountWithBody(ctx context.Context, userI return c.Client.Do(req) } -func (c *CDPClient) AddEndUserEvmSmartAccount(ctx context.Context, userId string, params *AddEndUserEvmSmartAccountParams, body AddEndUserEvmSmartAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewAddEndUserEvmSmartAccountRequest(c.Server, userId, params, body) +func (c *CDPClient) SignEvmTransactionWithEndUserAccount(ctx context.Context, projectId string, userId string, params *SignEvmTransactionWithEndUserAccountParams, body SignEvmTransactionWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewSignEvmTransactionWithEndUserAccountRequest(c.Server, projectId, userId, params, body) if err != nil { return nil, err } @@ -8759,8 +9429,8 @@ func (c *CDPClient) AddEndUserEvmSmartAccount(ctx context.Context, userId string return c.Client.Do(req) } -func (c *CDPClient) AddEndUserSolanaAccountWithBody(ctx context.Context, userId string, params *AddEndUserSolanaAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewAddEndUserSolanaAccountRequestWithBody(c.Server, userId, params, contentType, body) +func (c *CDPClient) SignEvmTypedDataWithEndUserAccountWithBody(ctx context.Context, projectId string, userId string, params *SignEvmTypedDataWithEndUserAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewSignEvmTypedDataWithEndUserAccountRequestWithBody(c.Server, projectId, userId, params, contentType, body) if err != nil { return nil, err } @@ -8771,8 +9441,8 @@ func (c *CDPClient) AddEndUserSolanaAccountWithBody(ctx context.Context, userId return c.Client.Do(req) } -func (c *CDPClient) AddEndUserSolanaAccount(ctx context.Context, userId string, params *AddEndUserSolanaAccountParams, body AddEndUserSolanaAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewAddEndUserSolanaAccountRequest(c.Server, userId, params, body) +func (c *CDPClient) SignEvmTypedDataWithEndUserAccount(ctx context.Context, projectId string, userId string, params *SignEvmTypedDataWithEndUserAccountParams, body SignEvmTypedDataWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewSignEvmTypedDataWithEndUserAccountRequest(c.Server, projectId, userId, params, body) if err != nil { return nil, err } @@ -8783,8 +9453,8 @@ func (c *CDPClient) AddEndUserSolanaAccount(ctx context.Context, userId string, return c.Client.Do(req) } -func (c *CDPClient) ListEvmAccounts(ctx context.Context, params *ListEvmAccountsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewListEvmAccountsRequest(c.Server, params) +func (c *CDPClient) SendUserOperationWithEndUserAccountWithBody(ctx context.Context, projectId string, userId string, address string, params *SendUserOperationWithEndUserAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewSendUserOperationWithEndUserAccountRequestWithBody(c.Server, projectId, userId, address, params, contentType, body) if err != nil { return nil, err } @@ -8795,8 +9465,8 @@ func (c *CDPClient) ListEvmAccounts(ctx context.Context, params *ListEvmAccounts return c.Client.Do(req) } -func (c *CDPClient) CreateEvmAccountWithBody(ctx context.Context, params *CreateEvmAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateEvmAccountRequestWithBody(c.Server, params, contentType, body) +func (c *CDPClient) SendUserOperationWithEndUserAccount(ctx context.Context, projectId string, userId string, address string, params *SendUserOperationWithEndUserAccountParams, body SendUserOperationWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewSendUserOperationWithEndUserAccountRequest(c.Server, projectId, userId, address, params, body) if err != nil { return nil, err } @@ -8807,8 +9477,8 @@ func (c *CDPClient) CreateEvmAccountWithBody(ctx context.Context, params *Create return c.Client.Do(req) } -func (c *CDPClient) CreateEvmAccount(ctx context.Context, params *CreateEvmAccountParams, body CreateEvmAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateEvmAccountRequest(c.Server, params, body) +func (c *CDPClient) RevokeSpendPermissionWithEndUserAccountWithBody(ctx context.Context, projectId string, userId string, address string, params *RevokeSpendPermissionWithEndUserAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewRevokeSpendPermissionWithEndUserAccountRequestWithBody(c.Server, projectId, userId, address, params, contentType, body) if err != nil { return nil, err } @@ -8819,8 +9489,8 @@ func (c *CDPClient) CreateEvmAccount(ctx context.Context, params *CreateEvmAccou return c.Client.Do(req) } -func (c *CDPClient) GetEvmAccountByName(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetEvmAccountByNameRequest(c.Server, name) +func (c *CDPClient) RevokeSpendPermissionWithEndUserAccount(ctx context.Context, projectId string, userId string, address string, params *RevokeSpendPermissionWithEndUserAccountParams, body RevokeSpendPermissionWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewRevokeSpendPermissionWithEndUserAccountRequest(c.Server, projectId, userId, address, params, body) if err != nil { return nil, err } @@ -8831,8 +9501,8 @@ func (c *CDPClient) GetEvmAccountByName(ctx context.Context, name string, reqEdi return c.Client.Do(req) } -func (c *CDPClient) ExportEvmAccountByNameWithBody(ctx context.Context, name string, params *ExportEvmAccountByNameParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewExportEvmAccountByNameRequestWithBody(c.Server, name, params, contentType, body) +func (c *CDPClient) SendEvmAssetWithEndUserAccountWithBody(ctx context.Context, projectId string, userId string, address BlockchainAddress, asset Asset, params *SendEvmAssetWithEndUserAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewSendEvmAssetWithEndUserAccountRequestWithBody(c.Server, projectId, userId, address, asset, params, contentType, body) if err != nil { return nil, err } @@ -8843,8 +9513,8 @@ func (c *CDPClient) ExportEvmAccountByNameWithBody(ctx context.Context, name str return c.Client.Do(req) } -func (c *CDPClient) ExportEvmAccountByName(ctx context.Context, name string, params *ExportEvmAccountByNameParams, body ExportEvmAccountByNameJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewExportEvmAccountByNameRequest(c.Server, name, params, body) +func (c *CDPClient) SendEvmAssetWithEndUserAccount(ctx context.Context, projectId string, userId string, address BlockchainAddress, asset Asset, params *SendEvmAssetWithEndUserAccountParams, body SendEvmAssetWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewSendEvmAssetWithEndUserAccountRequest(c.Server, projectId, userId, address, asset, params, body) if err != nil { return nil, err } @@ -8855,8 +9525,8 @@ func (c *CDPClient) ExportEvmAccountByName(ctx context.Context, name string, par return c.Client.Do(req) } -func (c *CDPClient) ImportEvmAccountWithBody(ctx context.Context, params *ImportEvmAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewImportEvmAccountRequestWithBody(c.Server, params, contentType, body) +func (c *CDPClient) SendSolanaTransactionWithEndUserAccountWithBody(ctx context.Context, projectId string, userId string, params *SendSolanaTransactionWithEndUserAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewSendSolanaTransactionWithEndUserAccountRequestWithBody(c.Server, projectId, userId, params, contentType, body) if err != nil { return nil, err } @@ -8867,8 +9537,8 @@ func (c *CDPClient) ImportEvmAccountWithBody(ctx context.Context, params *Import return c.Client.Do(req) } -func (c *CDPClient) ImportEvmAccount(ctx context.Context, params *ImportEvmAccountParams, body ImportEvmAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewImportEvmAccountRequest(c.Server, params, body) +func (c *CDPClient) SendSolanaTransactionWithEndUserAccount(ctx context.Context, projectId string, userId string, params *SendSolanaTransactionWithEndUserAccountParams, body SendSolanaTransactionWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewSendSolanaTransactionWithEndUserAccountRequest(c.Server, projectId, userId, params, body) if err != nil { return nil, err } @@ -8879,8 +9549,8 @@ func (c *CDPClient) ImportEvmAccount(ctx context.Context, params *ImportEvmAccou return c.Client.Do(req) } -func (c *CDPClient) GetEvmAccount(ctx context.Context, address string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetEvmAccountRequest(c.Server, address) +func (c *CDPClient) SignSolanaHashWithEndUserAccountWithBody(ctx context.Context, projectId string, userId string, params *SignSolanaHashWithEndUserAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewSignSolanaHashWithEndUserAccountRequestWithBody(c.Server, projectId, userId, params, contentType, body) if err != nil { return nil, err } @@ -8891,8 +9561,8 @@ func (c *CDPClient) GetEvmAccount(ctx context.Context, address string, reqEditor return c.Client.Do(req) } -func (c *CDPClient) UpdateEvmAccountWithBody(ctx context.Context, address string, params *UpdateEvmAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdateEvmAccountRequestWithBody(c.Server, address, params, contentType, body) +func (c *CDPClient) SignSolanaHashWithEndUserAccount(ctx context.Context, projectId string, userId string, params *SignSolanaHashWithEndUserAccountParams, body SignSolanaHashWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewSignSolanaHashWithEndUserAccountRequest(c.Server, projectId, userId, params, body) if err != nil { return nil, err } @@ -8903,8 +9573,8 @@ func (c *CDPClient) UpdateEvmAccountWithBody(ctx context.Context, address string return c.Client.Do(req) } -func (c *CDPClient) UpdateEvmAccount(ctx context.Context, address string, params *UpdateEvmAccountParams, body UpdateEvmAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdateEvmAccountRequest(c.Server, address, params, body) +func (c *CDPClient) SignSolanaMessageWithEndUserAccountWithBody(ctx context.Context, projectId string, userId string, params *SignSolanaMessageWithEndUserAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewSignSolanaMessageWithEndUserAccountRequestWithBody(c.Server, projectId, userId, params, contentType, body) if err != nil { return nil, err } @@ -8915,8 +9585,8 @@ func (c *CDPClient) UpdateEvmAccount(ctx context.Context, address string, params return c.Client.Do(req) } -func (c *CDPClient) CreateEvmEip7702DelegationWithBody(ctx context.Context, address string, params *CreateEvmEip7702DelegationParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateEvmEip7702DelegationRequestWithBody(c.Server, address, params, contentType, body) +func (c *CDPClient) SignSolanaMessageWithEndUserAccount(ctx context.Context, projectId string, userId string, params *SignSolanaMessageWithEndUserAccountParams, body SignSolanaMessageWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewSignSolanaMessageWithEndUserAccountRequest(c.Server, projectId, userId, params, body) if err != nil { return nil, err } @@ -8927,8 +9597,8 @@ func (c *CDPClient) CreateEvmEip7702DelegationWithBody(ctx context.Context, addr return c.Client.Do(req) } -func (c *CDPClient) CreateEvmEip7702Delegation(ctx context.Context, address string, params *CreateEvmEip7702DelegationParams, body CreateEvmEip7702DelegationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateEvmEip7702DelegationRequest(c.Server, address, params, body) +func (c *CDPClient) SignSolanaTransactionWithEndUserAccountWithBody(ctx context.Context, projectId string, userId string, params *SignSolanaTransactionWithEndUserAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewSignSolanaTransactionWithEndUserAccountRequestWithBody(c.Server, projectId, userId, params, contentType, body) if err != nil { return nil, err } @@ -8939,8 +9609,8 @@ func (c *CDPClient) CreateEvmEip7702Delegation(ctx context.Context, address stri return c.Client.Do(req) } -func (c *CDPClient) ExportEvmAccountWithBody(ctx context.Context, address string, params *ExportEvmAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewExportEvmAccountRequestWithBody(c.Server, address, params, contentType, body) +func (c *CDPClient) SignSolanaTransactionWithEndUserAccount(ctx context.Context, projectId string, userId string, params *SignSolanaTransactionWithEndUserAccountParams, body SignSolanaTransactionWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewSignSolanaTransactionWithEndUserAccountRequest(c.Server, projectId, userId, params, body) if err != nil { return nil, err } @@ -8951,8 +9621,8 @@ func (c *CDPClient) ExportEvmAccountWithBody(ctx context.Context, address string return c.Client.Do(req) } -func (c *CDPClient) ExportEvmAccount(ctx context.Context, address string, params *ExportEvmAccountParams, body ExportEvmAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewExportEvmAccountRequest(c.Server, address, params, body) +func (c *CDPClient) SendSolanaAssetWithEndUserAccountWithBody(ctx context.Context, projectId string, userId string, address BlockchainAddress, asset Asset, params *SendSolanaAssetWithEndUserAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewSendSolanaAssetWithEndUserAccountRequestWithBody(c.Server, projectId, userId, address, asset, params, contentType, body) if err != nil { return nil, err } @@ -8963,8 +9633,8 @@ func (c *CDPClient) ExportEvmAccount(ctx context.Context, address string, params return c.Client.Do(req) } -func (c *CDPClient) SendEvmTransactionWithBody(ctx context.Context, address string, params *SendEvmTransactionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewSendEvmTransactionRequestWithBody(c.Server, address, params, contentType, body) +func (c *CDPClient) SendSolanaAssetWithEndUserAccount(ctx context.Context, projectId string, userId string, address BlockchainAddress, asset Asset, params *SendSolanaAssetWithEndUserAccountParams, body SendSolanaAssetWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewSendSolanaAssetWithEndUserAccountRequest(c.Server, projectId, userId, address, asset, params, body) if err != nil { return nil, err } @@ -8975,8 +9645,8 @@ func (c *CDPClient) SendEvmTransactionWithBody(ctx context.Context, address stri return c.Client.Do(req) } -func (c *CDPClient) SendEvmTransaction(ctx context.Context, address string, params *SendEvmTransactionParams, body SendEvmTransactionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewSendEvmTransactionRequest(c.Server, address, params, body) +func (c *CDPClient) ListEndUsers(ctx context.Context, params *ListEndUsersParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewListEndUsersRequest(c.Server, params) if err != nil { return nil, err } @@ -8987,8 +9657,8 @@ func (c *CDPClient) SendEvmTransaction(ctx context.Context, address string, para return c.Client.Do(req) } -func (c *CDPClient) SignEvmHashWithBody(ctx context.Context, address string, params *SignEvmHashParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewSignEvmHashRequestWithBody(c.Server, address, params, contentType, body) +func (c *CDPClient) CreateEndUserWithBody(ctx context.Context, params *CreateEndUserParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateEndUserRequestWithBody(c.Server, params, contentType, body) if err != nil { return nil, err } @@ -8999,8 +9669,8 @@ func (c *CDPClient) SignEvmHashWithBody(ctx context.Context, address string, par return c.Client.Do(req) } -func (c *CDPClient) SignEvmHash(ctx context.Context, address string, params *SignEvmHashParams, body SignEvmHashJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewSignEvmHashRequest(c.Server, address, params, body) +func (c *CDPClient) CreateEndUser(ctx context.Context, params *CreateEndUserParams, body CreateEndUserJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateEndUserRequest(c.Server, params, body) if err != nil { return nil, err } @@ -9011,8 +9681,8 @@ func (c *CDPClient) SignEvmHash(ctx context.Context, address string, params *Sig return c.Client.Do(req) } -func (c *CDPClient) SignEvmMessageWithBody(ctx context.Context, address string, params *SignEvmMessageParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewSignEvmMessageRequestWithBody(c.Server, address, params, contentType, body) +func (c *CDPClient) ValidateEndUserAccessTokenWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewValidateEndUserAccessTokenRequestWithBody(c.Server, contentType, body) if err != nil { return nil, err } @@ -9023,8 +9693,8 @@ func (c *CDPClient) SignEvmMessageWithBody(ctx context.Context, address string, return c.Client.Do(req) } -func (c *CDPClient) SignEvmMessage(ctx context.Context, address string, params *SignEvmMessageParams, body SignEvmMessageJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewSignEvmMessageRequest(c.Server, address, params, body) +func (c *CDPClient) ValidateEndUserAccessToken(ctx context.Context, body ValidateEndUserAccessTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewValidateEndUserAccessTokenRequest(c.Server, body) if err != nil { return nil, err } @@ -9035,8 +9705,8 @@ func (c *CDPClient) SignEvmMessage(ctx context.Context, address string, params * return c.Client.Do(req) } -func (c *CDPClient) SignEvmTransactionWithBody(ctx context.Context, address string, params *SignEvmTransactionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewSignEvmTransactionRequestWithBody(c.Server, address, params, contentType, body) +func (c *CDPClient) ImportEndUserWithBody(ctx context.Context, params *ImportEndUserParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewImportEndUserRequestWithBody(c.Server, params, contentType, body) if err != nil { return nil, err } @@ -9047,8 +9717,8 @@ func (c *CDPClient) SignEvmTransactionWithBody(ctx context.Context, address stri return c.Client.Do(req) } -func (c *CDPClient) SignEvmTransaction(ctx context.Context, address string, params *SignEvmTransactionParams, body SignEvmTransactionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewSignEvmTransactionRequest(c.Server, address, params, body) +func (c *CDPClient) ImportEndUser(ctx context.Context, params *ImportEndUserParams, body ImportEndUserJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewImportEndUserRequest(c.Server, params, body) if err != nil { return nil, err } @@ -9059,8 +9729,8 @@ func (c *CDPClient) SignEvmTransaction(ctx context.Context, address string, para return c.Client.Do(req) } -func (c *CDPClient) SignEvmTypedDataWithBody(ctx context.Context, address string, params *SignEvmTypedDataParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewSignEvmTypedDataRequestWithBody(c.Server, address, params, contentType, body) +func (c *CDPClient) GetEndUser(ctx context.Context, userId string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetEndUserRequest(c.Server, userId) if err != nil { return nil, err } @@ -9071,8 +9741,8 @@ func (c *CDPClient) SignEvmTypedDataWithBody(ctx context.Context, address string return c.Client.Do(req) } -func (c *CDPClient) SignEvmTypedData(ctx context.Context, address string, params *SignEvmTypedDataParams, body SignEvmTypedDataJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewSignEvmTypedDataRequest(c.Server, address, params, body) +func (c *CDPClient) AddEndUserEvmAccountWithBody(ctx context.Context, userId string, params *AddEndUserEvmAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewAddEndUserEvmAccountRequestWithBody(c.Server, userId, params, contentType, body) if err != nil { return nil, err } @@ -9083,8 +9753,8 @@ func (c *CDPClient) SignEvmTypedData(ctx context.Context, address string, params return c.Client.Do(req) } -func (c *CDPClient) GetEvmEip7702DelegationOperationById(ctx context.Context, delegationOperationId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetEvmEip7702DelegationOperationByIdRequest(c.Server, delegationOperationId) +func (c *CDPClient) AddEndUserEvmAccount(ctx context.Context, userId string, params *AddEndUserEvmAccountParams, body AddEndUserEvmAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewAddEndUserEvmAccountRequest(c.Server, userId, params, body) if err != nil { return nil, err } @@ -9095,8 +9765,8 @@ func (c *CDPClient) GetEvmEip7702DelegationOperationById(ctx context.Context, de return c.Client.Do(req) } -func (c *CDPClient) RequestEvmFaucetWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewRequestEvmFaucetRequestWithBody(c.Server, contentType, body) +func (c *CDPClient) AddEndUserEvmSmartAccountWithBody(ctx context.Context, userId string, params *AddEndUserEvmSmartAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewAddEndUserEvmSmartAccountRequestWithBody(c.Server, userId, params, contentType, body) if err != nil { return nil, err } @@ -9107,8 +9777,8 @@ func (c *CDPClient) RequestEvmFaucetWithBody(ctx context.Context, contentType st return c.Client.Do(req) } -func (c *CDPClient) RequestEvmFaucet(ctx context.Context, body RequestEvmFaucetJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewRequestEvmFaucetRequest(c.Server, body) +func (c *CDPClient) AddEndUserEvmSmartAccount(ctx context.Context, userId string, params *AddEndUserEvmSmartAccountParams, body AddEndUserEvmSmartAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewAddEndUserEvmSmartAccountRequest(c.Server, userId, params, body) if err != nil { return nil, err } @@ -9119,8 +9789,8 @@ func (c *CDPClient) RequestEvmFaucet(ctx context.Context, body RequestEvmFaucetJ return c.Client.Do(req) } -func (c *CDPClient) ListEvmSmartAccounts(ctx context.Context, params *ListEvmSmartAccountsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewListEvmSmartAccountsRequest(c.Server, params) +func (c *CDPClient) AddEndUserSolanaAccountWithBody(ctx context.Context, userId string, params *AddEndUserSolanaAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewAddEndUserSolanaAccountRequestWithBody(c.Server, userId, params, contentType, body) if err != nil { return nil, err } @@ -9131,8 +9801,8 @@ func (c *CDPClient) ListEvmSmartAccounts(ctx context.Context, params *ListEvmSma return c.Client.Do(req) } -func (c *CDPClient) CreateEvmSmartAccountWithBody(ctx context.Context, params *CreateEvmSmartAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateEvmSmartAccountRequestWithBody(c.Server, params, contentType, body) +func (c *CDPClient) AddEndUserSolanaAccount(ctx context.Context, userId string, params *AddEndUserSolanaAccountParams, body AddEndUserSolanaAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewAddEndUserSolanaAccountRequest(c.Server, userId, params, body) if err != nil { return nil, err } @@ -9143,8 +9813,8 @@ func (c *CDPClient) CreateEvmSmartAccountWithBody(ctx context.Context, params *C return c.Client.Do(req) } -func (c *CDPClient) CreateEvmSmartAccount(ctx context.Context, params *CreateEvmSmartAccountParams, body CreateEvmSmartAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateEvmSmartAccountRequest(c.Server, params, body) +func (c *CDPClient) ListEvmAccounts(ctx context.Context, params *ListEvmAccountsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewListEvmAccountsRequest(c.Server, params) if err != nil { return nil, err } @@ -9155,8 +9825,8 @@ func (c *CDPClient) CreateEvmSmartAccount(ctx context.Context, params *CreateEvm return c.Client.Do(req) } -func (c *CDPClient) GetEvmSmartAccountByName(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetEvmSmartAccountByNameRequest(c.Server, name) +func (c *CDPClient) CreateEvmAccountWithBody(ctx context.Context, params *CreateEvmAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateEvmAccountRequestWithBody(c.Server, params, contentType, body) if err != nil { return nil, err } @@ -9167,8 +9837,8 @@ func (c *CDPClient) GetEvmSmartAccountByName(ctx context.Context, name string, r return c.Client.Do(req) } -func (c *CDPClient) GetEvmSmartAccount(ctx context.Context, address string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetEvmSmartAccountRequest(c.Server, address) +func (c *CDPClient) CreateEvmAccount(ctx context.Context, params *CreateEvmAccountParams, body CreateEvmAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateEvmAccountRequest(c.Server, params, body) if err != nil { return nil, err } @@ -9179,8 +9849,8 @@ func (c *CDPClient) GetEvmSmartAccount(ctx context.Context, address string, reqE return c.Client.Do(req) } -func (c *CDPClient) UpdateEvmSmartAccountWithBody(ctx context.Context, address string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdateEvmSmartAccountRequestWithBody(c.Server, address, contentType, body) +func (c *CDPClient) GetEvmAccountByName(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetEvmAccountByNameRequest(c.Server, name) if err != nil { return nil, err } @@ -9191,8 +9861,8 @@ func (c *CDPClient) UpdateEvmSmartAccountWithBody(ctx context.Context, address s return c.Client.Do(req) } -func (c *CDPClient) UpdateEvmSmartAccount(ctx context.Context, address string, body UpdateEvmSmartAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdateEvmSmartAccountRequest(c.Server, address, body) +func (c *CDPClient) ExportEvmAccountByNameWithBody(ctx context.Context, name string, params *ExportEvmAccountByNameParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewExportEvmAccountByNameRequestWithBody(c.Server, name, params, contentType, body) if err != nil { return nil, err } @@ -9203,8 +9873,8 @@ func (c *CDPClient) UpdateEvmSmartAccount(ctx context.Context, address string, b return c.Client.Do(req) } -func (c *CDPClient) CreateSpendPermissionWithBody(ctx context.Context, address string, params *CreateSpendPermissionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateSpendPermissionRequestWithBody(c.Server, address, params, contentType, body) +func (c *CDPClient) ExportEvmAccountByName(ctx context.Context, name string, params *ExportEvmAccountByNameParams, body ExportEvmAccountByNameJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewExportEvmAccountByNameRequest(c.Server, name, params, body) if err != nil { return nil, err } @@ -9215,8 +9885,8 @@ func (c *CDPClient) CreateSpendPermissionWithBody(ctx context.Context, address s return c.Client.Do(req) } -func (c *CDPClient) CreateSpendPermission(ctx context.Context, address string, params *CreateSpendPermissionParams, body CreateSpendPermissionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateSpendPermissionRequest(c.Server, address, params, body) +func (c *CDPClient) ImportEvmAccountWithBody(ctx context.Context, params *ImportEvmAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewImportEvmAccountRequestWithBody(c.Server, params, contentType, body) if err != nil { return nil, err } @@ -9227,8 +9897,8 @@ func (c *CDPClient) CreateSpendPermission(ctx context.Context, address string, p return c.Client.Do(req) } -func (c *CDPClient) ListSpendPermissions(ctx context.Context, address string, params *ListSpendPermissionsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewListSpendPermissionsRequest(c.Server, address, params) +func (c *CDPClient) ImportEvmAccount(ctx context.Context, params *ImportEvmAccountParams, body ImportEvmAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewImportEvmAccountRequest(c.Server, params, body) if err != nil { return nil, err } @@ -9239,8 +9909,8 @@ func (c *CDPClient) ListSpendPermissions(ctx context.Context, address string, pa return c.Client.Do(req) } -func (c *CDPClient) RevokeSpendPermissionWithBody(ctx context.Context, address string, params *RevokeSpendPermissionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewRevokeSpendPermissionRequestWithBody(c.Server, address, params, contentType, body) +func (c *CDPClient) GetEvmAccount(ctx context.Context, address string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetEvmAccountRequest(c.Server, address) if err != nil { return nil, err } @@ -9251,8 +9921,8 @@ func (c *CDPClient) RevokeSpendPermissionWithBody(ctx context.Context, address s return c.Client.Do(req) } -func (c *CDPClient) RevokeSpendPermission(ctx context.Context, address string, params *RevokeSpendPermissionParams, body RevokeSpendPermissionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewRevokeSpendPermissionRequest(c.Server, address, params, body) +func (c *CDPClient) UpdateEvmAccountWithBody(ctx context.Context, address string, params *UpdateEvmAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateEvmAccountRequestWithBody(c.Server, address, params, contentType, body) if err != nil { return nil, err } @@ -9263,8 +9933,8 @@ func (c *CDPClient) RevokeSpendPermission(ctx context.Context, address string, p return c.Client.Do(req) } -func (c *CDPClient) PrepareUserOperationWithBody(ctx context.Context, address string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewPrepareUserOperationRequestWithBody(c.Server, address, contentType, body) +func (c *CDPClient) UpdateEvmAccount(ctx context.Context, address string, params *UpdateEvmAccountParams, body UpdateEvmAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateEvmAccountRequest(c.Server, address, params, body) if err != nil { return nil, err } @@ -9275,8 +9945,8 @@ func (c *CDPClient) PrepareUserOperationWithBody(ctx context.Context, address st return c.Client.Do(req) } -func (c *CDPClient) PrepareUserOperation(ctx context.Context, address string, body PrepareUserOperationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewPrepareUserOperationRequest(c.Server, address, body) +func (c *CDPClient) CreateEvmEip7702DelegationWithBody(ctx context.Context, address string, params *CreateEvmEip7702DelegationParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateEvmEip7702DelegationRequestWithBody(c.Server, address, params, contentType, body) if err != nil { return nil, err } @@ -9287,8 +9957,8 @@ func (c *CDPClient) PrepareUserOperation(ctx context.Context, address string, bo return c.Client.Do(req) } -func (c *CDPClient) PrepareAndSendUserOperationWithBody(ctx context.Context, address string, params *PrepareAndSendUserOperationParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewPrepareAndSendUserOperationRequestWithBody(c.Server, address, params, contentType, body) +func (c *CDPClient) CreateEvmEip7702Delegation(ctx context.Context, address string, params *CreateEvmEip7702DelegationParams, body CreateEvmEip7702DelegationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateEvmEip7702DelegationRequest(c.Server, address, params, body) if err != nil { return nil, err } @@ -9299,8 +9969,8 @@ func (c *CDPClient) PrepareAndSendUserOperationWithBody(ctx context.Context, add return c.Client.Do(req) } -func (c *CDPClient) PrepareAndSendUserOperation(ctx context.Context, address string, params *PrepareAndSendUserOperationParams, body PrepareAndSendUserOperationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewPrepareAndSendUserOperationRequest(c.Server, address, params, body) +func (c *CDPClient) ExportEvmAccountWithBody(ctx context.Context, address string, params *ExportEvmAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewExportEvmAccountRequestWithBody(c.Server, address, params, contentType, body) if err != nil { return nil, err } @@ -9311,8 +9981,8 @@ func (c *CDPClient) PrepareAndSendUserOperation(ctx context.Context, address str return c.Client.Do(req) } -func (c *CDPClient) GetUserOperation(ctx context.Context, address string, userOpHash string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetUserOperationRequest(c.Server, address, userOpHash) +func (c *CDPClient) ExportEvmAccount(ctx context.Context, address string, params *ExportEvmAccountParams, body ExportEvmAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewExportEvmAccountRequest(c.Server, address, params, body) if err != nil { return nil, err } @@ -9323,8 +9993,8 @@ func (c *CDPClient) GetUserOperation(ctx context.Context, address string, userOp return c.Client.Do(req) } -func (c *CDPClient) SendUserOperationWithBody(ctx context.Context, address string, userOpHash string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewSendUserOperationRequestWithBody(c.Server, address, userOpHash, contentType, body) +func (c *CDPClient) SendEvmTransactionWithBody(ctx context.Context, address string, params *SendEvmTransactionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewSendEvmTransactionRequestWithBody(c.Server, address, params, contentType, body) if err != nil { return nil, err } @@ -9335,8 +10005,8 @@ func (c *CDPClient) SendUserOperationWithBody(ctx context.Context, address strin return c.Client.Do(req) } -func (c *CDPClient) SendUserOperation(ctx context.Context, address string, userOpHash string, body SendUserOperationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewSendUserOperationRequest(c.Server, address, userOpHash, body) +func (c *CDPClient) SendEvmTransaction(ctx context.Context, address string, params *SendEvmTransactionParams, body SendEvmTransactionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewSendEvmTransactionRequest(c.Server, address, params, body) if err != nil { return nil, err } @@ -9347,8 +10017,8 @@ func (c *CDPClient) SendUserOperation(ctx context.Context, address string, userO return c.Client.Do(req) } -func (c *CDPClient) CreateEvmSwapQuoteWithBody(ctx context.Context, params *CreateEvmSwapQuoteParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateEvmSwapQuoteRequestWithBody(c.Server, params, contentType, body) +func (c *CDPClient) SignEvmHashWithBody(ctx context.Context, address string, params *SignEvmHashParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewSignEvmHashRequestWithBody(c.Server, address, params, contentType, body) if err != nil { return nil, err } @@ -9359,8 +10029,8 @@ func (c *CDPClient) CreateEvmSwapQuoteWithBody(ctx context.Context, params *Crea return c.Client.Do(req) } -func (c *CDPClient) CreateEvmSwapQuote(ctx context.Context, params *CreateEvmSwapQuoteParams, body CreateEvmSwapQuoteJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateEvmSwapQuoteRequest(c.Server, params, body) +func (c *CDPClient) SignEvmHash(ctx context.Context, address string, params *SignEvmHashParams, body SignEvmHashJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewSignEvmHashRequest(c.Server, address, params, body) if err != nil { return nil, err } @@ -9371,8 +10041,8 @@ func (c *CDPClient) CreateEvmSwapQuote(ctx context.Context, params *CreateEvmSwa return c.Client.Do(req) } -func (c *CDPClient) GetEvmSwapPrice(ctx context.Context, params *GetEvmSwapPriceParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetEvmSwapPriceRequest(c.Server, params) +func (c *CDPClient) SignEvmMessageWithBody(ctx context.Context, address string, params *SignEvmMessageParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewSignEvmMessageRequestWithBody(c.Server, address, params, contentType, body) if err != nil { return nil, err } @@ -9383,8 +10053,8 @@ func (c *CDPClient) GetEvmSwapPrice(ctx context.Context, params *GetEvmSwapPrice return c.Client.Do(req) } -func (c *CDPClient) ListEvmTokenBalances(ctx context.Context, network ListEvmTokenBalancesNetwork, address string, params *ListEvmTokenBalancesParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewListEvmTokenBalancesRequest(c.Server, network, address, params) +func (c *CDPClient) SignEvmMessage(ctx context.Context, address string, params *SignEvmMessageParams, body SignEvmMessageJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewSignEvmMessageRequest(c.Server, address, params, body) if err != nil { return nil, err } @@ -9395,8 +10065,8 @@ func (c *CDPClient) ListEvmTokenBalances(ctx context.Context, network ListEvmTok return c.Client.Do(req) } -func (c *CDPClient) GetOnrampUserLimitsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetOnrampUserLimitsRequestWithBody(c.Server, contentType, body) +func (c *CDPClient) SignEvmTransactionWithBody(ctx context.Context, address string, params *SignEvmTransactionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewSignEvmTransactionRequestWithBody(c.Server, address, params, contentType, body) if err != nil { return nil, err } @@ -9407,8 +10077,8 @@ func (c *CDPClient) GetOnrampUserLimitsWithBody(ctx context.Context, contentType return c.Client.Do(req) } -func (c *CDPClient) GetOnrampUserLimits(ctx context.Context, body GetOnrampUserLimitsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetOnrampUserLimitsRequest(c.Server, body) +func (c *CDPClient) SignEvmTransaction(ctx context.Context, address string, params *SignEvmTransactionParams, body SignEvmTransactionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewSignEvmTransactionRequest(c.Server, address, params, body) if err != nil { return nil, err } @@ -9419,8 +10089,8 @@ func (c *CDPClient) GetOnrampUserLimits(ctx context.Context, body GetOnrampUserL return c.Client.Do(req) } -func (c *CDPClient) CreateOnrampOrderWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateOnrampOrderRequestWithBody(c.Server, contentType, body) +func (c *CDPClient) SignEvmTypedDataWithBody(ctx context.Context, address string, params *SignEvmTypedDataParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewSignEvmTypedDataRequestWithBody(c.Server, address, params, contentType, body) if err != nil { return nil, err } @@ -9431,8 +10101,8 @@ func (c *CDPClient) CreateOnrampOrderWithBody(ctx context.Context, contentType s return c.Client.Do(req) } -func (c *CDPClient) CreateOnrampOrder(ctx context.Context, body CreateOnrampOrderJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateOnrampOrderRequest(c.Server, body) +func (c *CDPClient) SignEvmTypedData(ctx context.Context, address string, params *SignEvmTypedDataParams, body SignEvmTypedDataJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewSignEvmTypedDataRequest(c.Server, address, params, body) if err != nil { return nil, err } @@ -9443,8 +10113,8 @@ func (c *CDPClient) CreateOnrampOrder(ctx context.Context, body CreateOnrampOrde return c.Client.Do(req) } -func (c *CDPClient) GetOnrampOrderById(ctx context.Context, orderId string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetOnrampOrderByIdRequest(c.Server, orderId) +func (c *CDPClient) GetEvmEip7702DelegationOperationById(ctx context.Context, delegationOperationId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetEvmEip7702DelegationOperationByIdRequest(c.Server, delegationOperationId) if err != nil { return nil, err } @@ -9455,8 +10125,8 @@ func (c *CDPClient) GetOnrampOrderById(ctx context.Context, orderId string, reqE return c.Client.Do(req) } -func (c *CDPClient) CreateOnrampSessionWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateOnrampSessionRequestWithBody(c.Server, contentType, body) +func (c *CDPClient) RequestEvmFaucetWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewRequestEvmFaucetRequestWithBody(c.Server, contentType, body) if err != nil { return nil, err } @@ -9467,8 +10137,8 @@ func (c *CDPClient) CreateOnrampSessionWithBody(ctx context.Context, contentType return c.Client.Do(req) } -func (c *CDPClient) CreateOnrampSession(ctx context.Context, body CreateOnrampSessionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateOnrampSessionRequest(c.Server, body) +func (c *CDPClient) RequestEvmFaucet(ctx context.Context, body RequestEvmFaucetJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewRequestEvmFaucetRequest(c.Server, body) if err != nil { return nil, err } @@ -9479,8 +10149,8 @@ func (c *CDPClient) CreateOnrampSession(ctx context.Context, body CreateOnrampSe return c.Client.Do(req) } -func (c *CDPClient) ListPolicies(ctx context.Context, params *ListPoliciesParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewListPoliciesRequest(c.Server, params) +func (c *CDPClient) ListEvmSmartAccounts(ctx context.Context, params *ListEvmSmartAccountsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewListEvmSmartAccountsRequest(c.Server, params) if err != nil { return nil, err } @@ -9491,8 +10161,8 @@ func (c *CDPClient) ListPolicies(ctx context.Context, params *ListPoliciesParams return c.Client.Do(req) } -func (c *CDPClient) CreatePolicyWithBody(ctx context.Context, params *CreatePolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreatePolicyRequestWithBody(c.Server, params, contentType, body) +func (c *CDPClient) CreateEvmSmartAccountWithBody(ctx context.Context, params *CreateEvmSmartAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateEvmSmartAccountRequestWithBody(c.Server, params, contentType, body) if err != nil { return nil, err } @@ -9503,8 +10173,8 @@ func (c *CDPClient) CreatePolicyWithBody(ctx context.Context, params *CreatePoli return c.Client.Do(req) } -func (c *CDPClient) CreatePolicy(ctx context.Context, params *CreatePolicyParams, body CreatePolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreatePolicyRequest(c.Server, params, body) +func (c *CDPClient) CreateEvmSmartAccount(ctx context.Context, params *CreateEvmSmartAccountParams, body CreateEvmSmartAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateEvmSmartAccountRequest(c.Server, params, body) if err != nil { return nil, err } @@ -9515,8 +10185,8 @@ func (c *CDPClient) CreatePolicy(ctx context.Context, params *CreatePolicyParams return c.Client.Do(req) } -func (c *CDPClient) DeletePolicy(ctx context.Context, policyId string, params *DeletePolicyParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewDeletePolicyRequest(c.Server, policyId, params) +func (c *CDPClient) GetEvmSmartAccountByName(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetEvmSmartAccountByNameRequest(c.Server, name) if err != nil { return nil, err } @@ -9527,8 +10197,8 @@ func (c *CDPClient) DeletePolicy(ctx context.Context, policyId string, params *D return c.Client.Do(req) } -func (c *CDPClient) GetPolicyById(ctx context.Context, policyId string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetPolicyByIdRequest(c.Server, policyId) +func (c *CDPClient) GetEvmSmartAccount(ctx context.Context, address string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetEvmSmartAccountRequest(c.Server, address) if err != nil { return nil, err } @@ -9539,8 +10209,8 @@ func (c *CDPClient) GetPolicyById(ctx context.Context, policyId string, reqEdito return c.Client.Do(req) } -func (c *CDPClient) UpdatePolicyWithBody(ctx context.Context, policyId string, params *UpdatePolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdatePolicyRequestWithBody(c.Server, policyId, params, contentType, body) +func (c *CDPClient) UpdateEvmSmartAccountWithBody(ctx context.Context, address string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateEvmSmartAccountRequestWithBody(c.Server, address, contentType, body) if err != nil { return nil, err } @@ -9551,8 +10221,8 @@ func (c *CDPClient) UpdatePolicyWithBody(ctx context.Context, policyId string, p return c.Client.Do(req) } -func (c *CDPClient) UpdatePolicy(ctx context.Context, policyId string, params *UpdatePolicyParams, body UpdatePolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdatePolicyRequest(c.Server, policyId, params, body) +func (c *CDPClient) UpdateEvmSmartAccount(ctx context.Context, address string, body UpdateEvmSmartAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateEvmSmartAccountRequest(c.Server, address, body) if err != nil { return nil, err } @@ -9563,8 +10233,8 @@ func (c *CDPClient) UpdatePolicy(ctx context.Context, policyId string, params *U return c.Client.Do(req) } -func (c *CDPClient) ListSolanaAccounts(ctx context.Context, params *ListSolanaAccountsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewListSolanaAccountsRequest(c.Server, params) +func (c *CDPClient) CreateSpendPermissionWithBody(ctx context.Context, address string, params *CreateSpendPermissionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateSpendPermissionRequestWithBody(c.Server, address, params, contentType, body) if err != nil { return nil, err } @@ -9575,8 +10245,8 @@ func (c *CDPClient) ListSolanaAccounts(ctx context.Context, params *ListSolanaAc return c.Client.Do(req) } -func (c *CDPClient) CreateSolanaAccountWithBody(ctx context.Context, params *CreateSolanaAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateSolanaAccountRequestWithBody(c.Server, params, contentType, body) +func (c *CDPClient) CreateSpendPermission(ctx context.Context, address string, params *CreateSpendPermissionParams, body CreateSpendPermissionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateSpendPermissionRequest(c.Server, address, params, body) if err != nil { return nil, err } @@ -9587,8 +10257,8 @@ func (c *CDPClient) CreateSolanaAccountWithBody(ctx context.Context, params *Cre return c.Client.Do(req) } -func (c *CDPClient) CreateSolanaAccount(ctx context.Context, params *CreateSolanaAccountParams, body CreateSolanaAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateSolanaAccountRequest(c.Server, params, body) +func (c *CDPClient) ListSpendPermissions(ctx context.Context, address string, params *ListSpendPermissionsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewListSpendPermissionsRequest(c.Server, address, params) if err != nil { return nil, err } @@ -9599,8 +10269,8 @@ func (c *CDPClient) CreateSolanaAccount(ctx context.Context, params *CreateSolan return c.Client.Do(req) } -func (c *CDPClient) GetSolanaAccountByName(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetSolanaAccountByNameRequest(c.Server, name) +func (c *CDPClient) RevokeSpendPermissionWithBody(ctx context.Context, address string, params *RevokeSpendPermissionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewRevokeSpendPermissionRequestWithBody(c.Server, address, params, contentType, body) if err != nil { return nil, err } @@ -9611,8 +10281,8 @@ func (c *CDPClient) GetSolanaAccountByName(ctx context.Context, name string, req return c.Client.Do(req) } -func (c *CDPClient) ExportSolanaAccountByNameWithBody(ctx context.Context, name string, params *ExportSolanaAccountByNameParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewExportSolanaAccountByNameRequestWithBody(c.Server, name, params, contentType, body) +func (c *CDPClient) RevokeSpendPermission(ctx context.Context, address string, params *RevokeSpendPermissionParams, body RevokeSpendPermissionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewRevokeSpendPermissionRequest(c.Server, address, params, body) if err != nil { return nil, err } @@ -9623,8 +10293,8 @@ func (c *CDPClient) ExportSolanaAccountByNameWithBody(ctx context.Context, name return c.Client.Do(req) } -func (c *CDPClient) ExportSolanaAccountByName(ctx context.Context, name string, params *ExportSolanaAccountByNameParams, body ExportSolanaAccountByNameJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewExportSolanaAccountByNameRequest(c.Server, name, params, body) +func (c *CDPClient) PrepareUserOperationWithBody(ctx context.Context, address string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPrepareUserOperationRequestWithBody(c.Server, address, contentType, body) if err != nil { return nil, err } @@ -9635,8 +10305,8 @@ func (c *CDPClient) ExportSolanaAccountByName(ctx context.Context, name string, return c.Client.Do(req) } -func (c *CDPClient) ImportSolanaAccountWithBody(ctx context.Context, params *ImportSolanaAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewImportSolanaAccountRequestWithBody(c.Server, params, contentType, body) +func (c *CDPClient) PrepareUserOperation(ctx context.Context, address string, body PrepareUserOperationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPrepareUserOperationRequest(c.Server, address, body) if err != nil { return nil, err } @@ -9647,8 +10317,8 @@ func (c *CDPClient) ImportSolanaAccountWithBody(ctx context.Context, params *Imp return c.Client.Do(req) } -func (c *CDPClient) ImportSolanaAccount(ctx context.Context, params *ImportSolanaAccountParams, body ImportSolanaAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewImportSolanaAccountRequest(c.Server, params, body) +func (c *CDPClient) PrepareAndSendUserOperationWithBody(ctx context.Context, address string, params *PrepareAndSendUserOperationParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPrepareAndSendUserOperationRequestWithBody(c.Server, address, params, contentType, body) if err != nil { return nil, err } @@ -9659,8 +10329,8 @@ func (c *CDPClient) ImportSolanaAccount(ctx context.Context, params *ImportSolan return c.Client.Do(req) } -func (c *CDPClient) SendSolanaTransactionWithBody(ctx context.Context, params *SendSolanaTransactionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewSendSolanaTransactionRequestWithBody(c.Server, params, contentType, body) +func (c *CDPClient) PrepareAndSendUserOperation(ctx context.Context, address string, params *PrepareAndSendUserOperationParams, body PrepareAndSendUserOperationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPrepareAndSendUserOperationRequest(c.Server, address, params, body) if err != nil { return nil, err } @@ -9671,8 +10341,8 @@ func (c *CDPClient) SendSolanaTransactionWithBody(ctx context.Context, params *S return c.Client.Do(req) } -func (c *CDPClient) SendSolanaTransaction(ctx context.Context, params *SendSolanaTransactionParams, body SendSolanaTransactionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewSendSolanaTransactionRequest(c.Server, params, body) +func (c *CDPClient) GetUserOperation(ctx context.Context, address string, userOpHash string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetUserOperationRequest(c.Server, address, userOpHash) if err != nil { return nil, err } @@ -9683,8 +10353,8 @@ func (c *CDPClient) SendSolanaTransaction(ctx context.Context, params *SendSolan return c.Client.Do(req) } -func (c *CDPClient) GetSolanaAccount(ctx context.Context, address string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetSolanaAccountRequest(c.Server, address) +func (c *CDPClient) SendUserOperationWithBody(ctx context.Context, address string, userOpHash string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewSendUserOperationRequestWithBody(c.Server, address, userOpHash, contentType, body) if err != nil { return nil, err } @@ -9695,8 +10365,8 @@ func (c *CDPClient) GetSolanaAccount(ctx context.Context, address string, reqEdi return c.Client.Do(req) } -func (c *CDPClient) UpdateSolanaAccountWithBody(ctx context.Context, address string, params *UpdateSolanaAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdateSolanaAccountRequestWithBody(c.Server, address, params, contentType, body) +func (c *CDPClient) SendUserOperation(ctx context.Context, address string, userOpHash string, body SendUserOperationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewSendUserOperationRequest(c.Server, address, userOpHash, body) if err != nil { return nil, err } @@ -9707,8 +10377,8 @@ func (c *CDPClient) UpdateSolanaAccountWithBody(ctx context.Context, address str return c.Client.Do(req) } -func (c *CDPClient) UpdateSolanaAccount(ctx context.Context, address string, params *UpdateSolanaAccountParams, body UpdateSolanaAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdateSolanaAccountRequest(c.Server, address, params, body) +func (c *CDPClient) CreateEvmSwapQuoteWithBody(ctx context.Context, params *CreateEvmSwapQuoteParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateEvmSwapQuoteRequestWithBody(c.Server, params, contentType, body) if err != nil { return nil, err } @@ -9719,8 +10389,8 @@ func (c *CDPClient) UpdateSolanaAccount(ctx context.Context, address string, par return c.Client.Do(req) } -func (c *CDPClient) ExportSolanaAccountWithBody(ctx context.Context, address string, params *ExportSolanaAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewExportSolanaAccountRequestWithBody(c.Server, address, params, contentType, body) +func (c *CDPClient) CreateEvmSwapQuote(ctx context.Context, params *CreateEvmSwapQuoteParams, body CreateEvmSwapQuoteJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateEvmSwapQuoteRequest(c.Server, params, body) if err != nil { return nil, err } @@ -9731,8 +10401,8 @@ func (c *CDPClient) ExportSolanaAccountWithBody(ctx context.Context, address str return c.Client.Do(req) } -func (c *CDPClient) ExportSolanaAccount(ctx context.Context, address string, params *ExportSolanaAccountParams, body ExportSolanaAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewExportSolanaAccountRequest(c.Server, address, params, body) +func (c *CDPClient) GetEvmSwapPrice(ctx context.Context, params *GetEvmSwapPriceParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetEvmSwapPriceRequest(c.Server, params) if err != nil { return nil, err } @@ -9743,8 +10413,8 @@ func (c *CDPClient) ExportSolanaAccount(ctx context.Context, address string, par return c.Client.Do(req) } -func (c *CDPClient) SignSolanaMessageWithBody(ctx context.Context, address string, params *SignSolanaMessageParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewSignSolanaMessageRequestWithBody(c.Server, address, params, contentType, body) +func (c *CDPClient) ListEvmTokenBalances(ctx context.Context, network ListEvmTokenBalancesNetwork, address string, params *ListEvmTokenBalancesParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewListEvmTokenBalancesRequest(c.Server, network, address, params) if err != nil { return nil, err } @@ -9755,8 +10425,8 @@ func (c *CDPClient) SignSolanaMessageWithBody(ctx context.Context, address strin return c.Client.Do(req) } -func (c *CDPClient) SignSolanaMessage(ctx context.Context, address string, params *SignSolanaMessageParams, body SignSolanaMessageJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewSignSolanaMessageRequest(c.Server, address, params, body) +func (c *CDPClient) GetOnrampUserLimitsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetOnrampUserLimitsRequestWithBody(c.Server, contentType, body) if err != nil { return nil, err } @@ -9767,8 +10437,8 @@ func (c *CDPClient) SignSolanaMessage(ctx context.Context, address string, param return c.Client.Do(req) } -func (c *CDPClient) SignSolanaTransactionWithBody(ctx context.Context, address string, params *SignSolanaTransactionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewSignSolanaTransactionRequestWithBody(c.Server, address, params, contentType, body) +func (c *CDPClient) GetOnrampUserLimits(ctx context.Context, body GetOnrampUserLimitsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetOnrampUserLimitsRequest(c.Server, body) if err != nil { return nil, err } @@ -9779,8 +10449,8 @@ func (c *CDPClient) SignSolanaTransactionWithBody(ctx context.Context, address s return c.Client.Do(req) } -func (c *CDPClient) SignSolanaTransaction(ctx context.Context, address string, params *SignSolanaTransactionParams, body SignSolanaTransactionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewSignSolanaTransactionRequest(c.Server, address, params, body) +func (c *CDPClient) CreateOnrampOrderWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateOnrampOrderRequestWithBody(c.Server, contentType, body) if err != nil { return nil, err } @@ -9791,8 +10461,8 @@ func (c *CDPClient) SignSolanaTransaction(ctx context.Context, address string, p return c.Client.Do(req) } -func (c *CDPClient) RequestSolanaFaucetWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewRequestSolanaFaucetRequestWithBody(c.Server, contentType, body) +func (c *CDPClient) CreateOnrampOrder(ctx context.Context, body CreateOnrampOrderJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateOnrampOrderRequest(c.Server, body) if err != nil { return nil, err } @@ -9803,8 +10473,8 @@ func (c *CDPClient) RequestSolanaFaucetWithBody(ctx context.Context, contentType return c.Client.Do(req) } -func (c *CDPClient) RequestSolanaFaucet(ctx context.Context, body RequestSolanaFaucetJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewRequestSolanaFaucetRequest(c.Server, body) +func (c *CDPClient) GetOnrampOrderById(ctx context.Context, orderId string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetOnrampOrderByIdRequest(c.Server, orderId) if err != nil { return nil, err } @@ -9815,8 +10485,8 @@ func (c *CDPClient) RequestSolanaFaucet(ctx context.Context, body RequestSolanaF return c.Client.Do(req) } -func (c *CDPClient) ListSolanaTokenBalances(ctx context.Context, network ListSolanaTokenBalancesNetwork, address string, params *ListSolanaTokenBalancesParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewListSolanaTokenBalancesRequest(c.Server, network, address, params) +func (c *CDPClient) CreateOnrampSessionWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateOnrampSessionRequestWithBody(c.Server, contentType, body) if err != nil { return nil, err } @@ -9827,8 +10497,8 @@ func (c *CDPClient) ListSolanaTokenBalances(ctx context.Context, network ListSol return c.Client.Do(req) } -func (c *CDPClient) SettleX402PaymentWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewSettleX402PaymentRequestWithBody(c.Server, contentType, body) +func (c *CDPClient) CreateOnrampSession(ctx context.Context, body CreateOnrampSessionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateOnrampSessionRequest(c.Server, body) if err != nil { return nil, err } @@ -9839,8 +10509,8 @@ func (c *CDPClient) SettleX402PaymentWithBody(ctx context.Context, contentType s return c.Client.Do(req) } -func (c *CDPClient) SettleX402Payment(ctx context.Context, body SettleX402PaymentJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewSettleX402PaymentRequest(c.Server, body) +func (c *CDPClient) ListPolicies(ctx context.Context, params *ListPoliciesParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewListPoliciesRequest(c.Server, params) if err != nil { return nil, err } @@ -9851,8 +10521,8 @@ func (c *CDPClient) SettleX402Payment(ctx context.Context, body SettleX402Paymen return c.Client.Do(req) } -func (c *CDPClient) SupportedX402PaymentKinds(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewSupportedX402PaymentKindsRequest(c.Server) +func (c *CDPClient) CreatePolicyWithBody(ctx context.Context, params *CreatePolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreatePolicyRequestWithBody(c.Server, params, contentType, body) if err != nil { return nil, err } @@ -9863,8 +10533,8 @@ func (c *CDPClient) SupportedX402PaymentKinds(ctx context.Context, reqEditors .. return c.Client.Do(req) } -func (c *CDPClient) VerifyX402PaymentWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewVerifyX402PaymentRequestWithBody(c.Server, contentType, body) +func (c *CDPClient) CreatePolicy(ctx context.Context, params *CreatePolicyParams, body CreatePolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreatePolicyRequest(c.Server, params, body) if err != nil { return nil, err } @@ -9875,8 +10545,8 @@ func (c *CDPClient) VerifyX402PaymentWithBody(ctx context.Context, contentType s return c.Client.Do(req) } -func (c *CDPClient) VerifyX402Payment(ctx context.Context, body VerifyX402PaymentJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewVerifyX402PaymentRequest(c.Server, body) +func (c *CDPClient) DeletePolicy(ctx context.Context, policyId string, params *DeletePolicyParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeletePolicyRequest(c.Server, policyId, params) if err != nil { return nil, err } @@ -9887,423 +10557,390 @@ func (c *CDPClient) VerifyX402Payment(ctx context.Context, body VerifyX402Paymen return c.Client.Do(req) } -// NewListDataTokenBalancesRequest generates requests for ListDataTokenBalances -func NewListDataTokenBalancesRequest(server string, network ListEvmTokenBalancesNetwork, address string, params *ListDataTokenBalancesParams) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "network", runtime.ParamLocationPath, network) +func (c *CDPClient) GetPolicyById(ctx context.Context, policyId string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetPolicyByIdRequest(c.Server, policyId) if err != nil { return nil, err } - - var pathParam1 string - - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "address", runtime.ParamLocationPath, address) - if err != nil { + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } + return c.Client.Do(req) +} - serverURL, err := url.Parse(server) +func (c *CDPClient) UpdatePolicyWithBody(ctx context.Context, policyId string, params *UpdatePolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdatePolicyRequestWithBody(c.Server, policyId, params, contentType, body) if err != nil { return nil, err } - - operationPath := fmt.Sprintf("/v2/data/evm/token-balances/%s/%s", pathParam0, pathParam1) - if operationPath[0] == '/' { - operationPath = "." + operationPath + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err } + return c.Client.Do(req) +} - queryURL, err := serverURL.Parse(operationPath) +func (c *CDPClient) UpdatePolicy(ctx context.Context, policyId string, params *UpdatePolicyParams, body UpdatePolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdatePolicyRequest(c.Server, policyId, params, body) if err != nil { return nil, err } - - if params != nil { - queryValues := queryURL.Query() - - if params.PageSize != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "pageSize", runtime.ParamLocationQuery, *params.PageSize); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.PageToken != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "pageToken", runtime.ParamLocationQuery, *params.PageToken); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err } + return c.Client.Do(req) +} - req, err := http.NewRequest("GET", queryURL.String(), nil) +func (c *CDPClient) ListSolanaAccounts(ctx context.Context, params *ListSolanaAccountsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewListSolanaAccountsRequest(c.Server, params) if err != nil { return nil, err } - - return req, nil + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) } -// NewListTokensForAccountRequest generates requests for ListTokensForAccount -func NewListTokensForAccountRequest(server string, network ListTokensForAccountParamsNetwork, address string) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "network", runtime.ParamLocationPath, network) +func (c *CDPClient) CreateSolanaAccountWithBody(ctx context.Context, params *CreateSolanaAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateSolanaAccountRequestWithBody(c.Server, params, contentType, body) if err != nil { return nil, err } - - var pathParam1 string - - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "address", runtime.ParamLocationPath, address) - if err != nil { + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } + return c.Client.Do(req) +} - serverURL, err := url.Parse(server) +func (c *CDPClient) CreateSolanaAccount(ctx context.Context, params *CreateSolanaAccountParams, body CreateSolanaAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateSolanaAccountRequest(c.Server, params, body) if err != nil { return nil, err } - - operationPath := fmt.Sprintf("/v2/data/evm/token-ownership/%s/%s", pathParam0, pathParam1) - if operationPath[0] == '/' { - operationPath = "." + operationPath + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err } + return c.Client.Do(req) +} - queryURL, err := serverURL.Parse(operationPath) +func (c *CDPClient) GetSolanaAccountByName(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetSolanaAccountByNameRequest(c.Server, name) if err != nil { return nil, err } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } - - return req, nil + return c.Client.Do(req) } -// NewGetSQLGrammarRequest generates requests for GetSQLGrammar -func NewGetSQLGrammarRequest(server string) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) +func (c *CDPClient) ExportSolanaAccountByNameWithBody(ctx context.Context, name string, params *ExportSolanaAccountByNameParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewExportSolanaAccountByNameRequestWithBody(c.Server, name, params, contentType, body) if err != nil { return nil, err } - - operationPath := fmt.Sprintf("/v2/data/query/grammar") - if operationPath[0] == '/' { - operationPath = "." + operationPath + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err } + return c.Client.Do(req) +} - queryURL, err := serverURL.Parse(operationPath) +func (c *CDPClient) ExportSolanaAccountByName(ctx context.Context, name string, params *ExportSolanaAccountByNameParams, body ExportSolanaAccountByNameJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewExportSolanaAccountByNameRequest(c.Server, name, params, body) if err != nil { return nil, err } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } - - return req, nil + return c.Client.Do(req) } -// NewRunSQLQueryRequest calls the generic RunSQLQuery builder with application/json body -func NewRunSQLQueryRequest(server string, body RunSQLQueryJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) +func (c *CDPClient) ImportSolanaAccountWithBody(ctx context.Context, params *ImportSolanaAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewImportSolanaAccountRequestWithBody(c.Server, params, contentType, body) if err != nil { return nil, err } - bodyReader = bytes.NewReader(buf) - return NewRunSQLQueryRequestWithBody(server, "application/json", bodyReader) + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) } -// NewRunSQLQueryRequestWithBody generates requests for RunSQLQuery with any type of body -func NewRunSQLQueryRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) +func (c *CDPClient) ImportSolanaAccount(ctx context.Context, params *ImportSolanaAccountParams, body ImportSolanaAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewImportSolanaAccountRequest(c.Server, params, body) if err != nil { return nil, err } - - operationPath := fmt.Sprintf("/v2/data/query/run") - if operationPath[0] == '/' { - operationPath = "." + operationPath + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err } + return c.Client.Do(req) +} - queryURL, err := serverURL.Parse(operationPath) +func (c *CDPClient) SendSolanaTransactionWithBody(ctx context.Context, params *SendSolanaTransactionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewSendSolanaTransactionRequestWithBody(c.Server, params, contentType, body) if err != nil { return nil, err } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } - - req.Header.Add("Content-Type", contentType) - - return req, nil + return c.Client.Do(req) } -// NewListWebhookSubscriptionsRequest generates requests for ListWebhookSubscriptions -func NewListWebhookSubscriptionsRequest(server string, params *ListWebhookSubscriptionsParams) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) +func (c *CDPClient) SendSolanaTransaction(ctx context.Context, params *SendSolanaTransactionParams, body SendSolanaTransactionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewSendSolanaTransactionRequest(c.Server, params, body) if err != nil { return nil, err } - - operationPath := fmt.Sprintf("/v2/data/webhooks/subscriptions") - if operationPath[0] == '/' { - operationPath = "." + operationPath + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err } + return c.Client.Do(req) +} - queryURL, err := serverURL.Parse(operationPath) +func (c *CDPClient) GetSolanaAccount(ctx context.Context, address string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetSolanaAccountRequest(c.Server, address) if err != nil { return nil, err } - - if params != nil { - queryValues := queryURL.Query() - - if params.PageSize != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "pageSize", runtime.ParamLocationQuery, *params.PageSize); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.PageToken != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "pageToken", runtime.ParamLocationQuery, *params.PageToken); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err } + return c.Client.Do(req) +} - req, err := http.NewRequest("GET", queryURL.String(), nil) +func (c *CDPClient) UpdateSolanaAccountWithBody(ctx context.Context, address string, params *UpdateSolanaAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateSolanaAccountRequestWithBody(c.Server, address, params, contentType, body) if err != nil { return nil, err } - - return req, nil + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) } -// NewCreateWebhookSubscriptionRequest calls the generic CreateWebhookSubscription builder with application/json body -func NewCreateWebhookSubscriptionRequest(server string, body CreateWebhookSubscriptionJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) +func (c *CDPClient) UpdateSolanaAccount(ctx context.Context, address string, params *UpdateSolanaAccountParams, body UpdateSolanaAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateSolanaAccountRequest(c.Server, address, params, body) if err != nil { return nil, err } - bodyReader = bytes.NewReader(buf) - return NewCreateWebhookSubscriptionRequestWithBody(server, "application/json", bodyReader) + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) } -// NewCreateWebhookSubscriptionRequestWithBody generates requests for CreateWebhookSubscription with any type of body -func NewCreateWebhookSubscriptionRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) +func (c *CDPClient) ExportSolanaAccountWithBody(ctx context.Context, address string, params *ExportSolanaAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewExportSolanaAccountRequestWithBody(c.Server, address, params, contentType, body) if err != nil { return nil, err } - - operationPath := fmt.Sprintf("/v2/data/webhooks/subscriptions") - if operationPath[0] == '/' { - operationPath = "." + operationPath + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err } + return c.Client.Do(req) +} - queryURL, err := serverURL.Parse(operationPath) +func (c *CDPClient) ExportSolanaAccount(ctx context.Context, address string, params *ExportSolanaAccountParams, body ExportSolanaAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewExportSolanaAccountRequest(c.Server, address, params, body) if err != nil { return nil, err } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } - - req.Header.Add("Content-Type", contentType) - - return req, nil + return c.Client.Do(req) } -// NewDeleteWebhookSubscriptionRequest generates requests for DeleteWebhookSubscription -func NewDeleteWebhookSubscriptionRequest(server string, subscriptionId openapi_types.UUID) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "subscriptionId", runtime.ParamLocationPath, subscriptionId) +func (c *CDPClient) SignSolanaMessageWithBody(ctx context.Context, address string, params *SignSolanaMessageParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewSignSolanaMessageRequestWithBody(c.Server, address, params, contentType, body) if err != nil { return nil, err } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} - serverURL, err := url.Parse(server) +func (c *CDPClient) SignSolanaMessage(ctx context.Context, address string, params *SignSolanaMessageParams, body SignSolanaMessageJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewSignSolanaMessageRequest(c.Server, address, params, body) if err != nil { return nil, err } - - operationPath := fmt.Sprintf("/v2/data/webhooks/subscriptions/%s", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err } + return c.Client.Do(req) +} - queryURL, err := serverURL.Parse(operationPath) +func (c *CDPClient) SignSolanaTransactionWithBody(ctx context.Context, address string, params *SignSolanaTransactionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewSignSolanaTransactionRequestWithBody(c.Server, address, params, contentType, body) if err != nil { return nil, err } - - req, err := http.NewRequest("DELETE", queryURL.String(), nil) - if err != nil { + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } - - return req, nil + return c.Client.Do(req) } -// NewGetWebhookSubscriptionRequest generates requests for GetWebhookSubscription -func NewGetWebhookSubscriptionRequest(server string, subscriptionId openapi_types.UUID) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "subscriptionId", runtime.ParamLocationPath, subscriptionId) +func (c *CDPClient) SignSolanaTransaction(ctx context.Context, address string, params *SignSolanaTransactionParams, body SignSolanaTransactionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewSignSolanaTransactionRequest(c.Server, address, params, body) if err != nil { return nil, err } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} - serverURL, err := url.Parse(server) +func (c *CDPClient) RequestSolanaFaucetWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewRequestSolanaFaucetRequestWithBody(c.Server, contentType, body) if err != nil { return nil, err } - - operationPath := fmt.Sprintf("/v2/data/webhooks/subscriptions/%s", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err } + return c.Client.Do(req) +} - queryURL, err := serverURL.Parse(operationPath) +func (c *CDPClient) RequestSolanaFaucet(ctx context.Context, body RequestSolanaFaucetJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewRequestSolanaFaucetRequest(c.Server, body) if err != nil { return nil, err } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } - - return req, nil + return c.Client.Do(req) } -// NewUpdateWebhookSubscriptionRequest calls the generic UpdateWebhookSubscription builder with application/json body -func NewUpdateWebhookSubscriptionRequest(server string, subscriptionId openapi_types.UUID, body UpdateWebhookSubscriptionJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) +func (c *CDPClient) ListSolanaTokenBalances(ctx context.Context, network ListSolanaTokenBalancesNetwork, address string, params *ListSolanaTokenBalancesParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewListSolanaTokenBalancesRequest(c.Server, network, address, params) if err != nil { return nil, err } - bodyReader = bytes.NewReader(buf) - return NewUpdateWebhookSubscriptionRequestWithBody(server, subscriptionId, "application/json", bodyReader) + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) } -// NewUpdateWebhookSubscriptionRequestWithBody generates requests for UpdateWebhookSubscription with any type of body -func NewUpdateWebhookSubscriptionRequestWithBody(server string, subscriptionId openapi_types.UUID, contentType string, body io.Reader) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "subscriptionId", runtime.ParamLocationPath, subscriptionId) +func (c *CDPClient) SettleX402PaymentWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewSettleX402PaymentRequestWithBody(c.Server, contentType, body) if err != nil { return nil, err } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} - serverURL, err := url.Parse(server) +func (c *CDPClient) SettleX402Payment(ctx context.Context, body SettleX402PaymentJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewSettleX402PaymentRequest(c.Server, body) if err != nil { return nil, err } - - operationPath := fmt.Sprintf("/v2/data/webhooks/subscriptions/%s", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err } + return c.Client.Do(req) +} - queryURL, err := serverURL.Parse(operationPath) +func (c *CDPClient) SupportedX402PaymentKinds(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewSupportedX402PaymentKindsRequest(c.Server) if err != nil { return nil, err } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} - req, err := http.NewRequest("PUT", queryURL.String(), body) +func (c *CDPClient) VerifyX402PaymentWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewVerifyX402PaymentRequestWithBody(c.Server, contentType, body) if err != nil { return nil, err } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} - req.Header.Add("Content-Type", contentType) - - return req, nil +func (c *CDPClient) VerifyX402Payment(ctx context.Context, body VerifyX402PaymentJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewVerifyX402PaymentRequest(c.Server, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) } -// NewListEndUsersRequest generates requests for ListEndUsers -func NewListEndUsersRequest(server string, params *ListEndUsersParams) (*http.Request, error) { +// NewListDataTokenBalancesRequest generates requests for ListDataTokenBalances +func NewListDataTokenBalancesRequest(server string, network ListEvmTokenBalancesNetwork, address string, params *ListDataTokenBalancesParams) (*http.Request, error) { var err error + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "network", runtime.ParamLocationPath, network) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "address", runtime.ParamLocationPath, address) + if err != nil { + return nil, err + } + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/v2/end-users") + operationPath := fmt.Sprintf("/v2/data/evm/token-balances/%s/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -10348,22 +10985,6 @@ func NewListEndUsersRequest(server string, params *ListEndUsersParams) (*http.Re } - if params.Sort != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", false, "sort", runtime.ParamLocationQuery, *params.Sort); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - queryURL.RawQuery = queryValues.Encode() } @@ -10375,27 +10996,30 @@ func NewListEndUsersRequest(server string, params *ListEndUsersParams) (*http.Re return req, nil } -// NewCreateEndUserRequest calls the generic CreateEndUser builder with application/json body -func NewCreateEndUserRequest(server string, params *CreateEndUserParams, body CreateEndUserJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) +// NewListTokensForAccountRequest generates requests for ListTokensForAccount +func NewListTokensForAccountRequest(server string, network ListTokensForAccountParamsNetwork, address string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "network", runtime.ParamLocationPath, network) if err != nil { return nil, err } - bodyReader = bytes.NewReader(buf) - return NewCreateEndUserRequestWithBody(server, params, "application/json", bodyReader) -} -// NewCreateEndUserRequestWithBody generates requests for CreateEndUser with any type of body -func NewCreateEndUserRequestWithBody(server string, params *CreateEndUserParams, contentType string, body io.Reader) (*http.Request, error) { - var err error + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "address", runtime.ParamLocationPath, address) + if err != nil { + return nil, err + } serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/v2/end-users") + operationPath := fmt.Sprintf("/v2/data/evm/token-ownership/%s/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -10405,55 +11029,54 @@ func NewCreateEndUserRequestWithBody(server string, params *CreateEndUserParams, return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), body) + req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } - req.Header.Add("Content-Type", contentType) - - if params != nil { - - if params.XWalletAuth != nil { - var headerParam0 string - - headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Wallet-Auth", runtime.ParamLocationHeader, *params.XWalletAuth) - if err != nil { - return nil, err - } + return req, nil +} - req.Header.Set("X-Wallet-Auth", headerParam0) - } +// NewGetSQLGrammarRequest generates requests for GetSQLGrammar +func NewGetSQLGrammarRequest(server string) (*http.Request, error) { + var err error - if params.XIdempotencyKey != nil { - var headerParam1 string + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } - headerParam1, err = runtime.StyleParamWithLocation("simple", false, "X-Idempotency-Key", runtime.ParamLocationHeader, *params.XIdempotencyKey) - if err != nil { - return nil, err - } + operationPath := fmt.Sprintf("/v2/data/query/grammar") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } - req.Header.Set("X-Idempotency-Key", headerParam1) - } + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err } return req, nil } -// NewValidateEndUserAccessTokenRequest calls the generic ValidateEndUserAccessToken builder with application/json body -func NewValidateEndUserAccessTokenRequest(server string, body ValidateEndUserAccessTokenJSONRequestBody) (*http.Request, error) { +// NewRunSQLQueryRequest calls the generic RunSQLQuery builder with application/json body +func NewRunSQLQueryRequest(server string, body RunSQLQueryJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewValidateEndUserAccessTokenRequestWithBody(server, "application/json", bodyReader) + return NewRunSQLQueryRequestWithBody(server, "application/json", bodyReader) } -// NewValidateEndUserAccessTokenRequestWithBody generates requests for ValidateEndUserAccessToken with any type of body -func NewValidateEndUserAccessTokenRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { +// NewRunSQLQueryRequestWithBody generates requests for RunSQLQuery with any type of body +func NewRunSQLQueryRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error serverURL, err := url.Parse(server) @@ -10461,7 +11084,7 @@ func NewValidateEndUserAccessTokenRequestWithBody(server string, contentType str return nil, err } - operationPath := fmt.Sprintf("/v2/end-users/auth/validate-token") + operationPath := fmt.Sprintf("/v2/data/query/run") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -10481,19 +11104,8 @@ func NewValidateEndUserAccessTokenRequestWithBody(server string, contentType str return req, nil } -// NewImportEndUserRequest calls the generic ImportEndUser builder with application/json body -func NewImportEndUserRequest(server string, params *ImportEndUserParams, body ImportEndUserJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewImportEndUserRequestWithBody(server, params, "application/json", bodyReader) -} - -// NewImportEndUserRequestWithBody generates requests for ImportEndUser with any type of body -func NewImportEndUserRequestWithBody(server string, params *ImportEndUserParams, contentType string, body io.Reader) (*http.Request, error) { +// NewListWebhookSubscriptionsRequest generates requests for ListWebhookSubscriptions +func NewListWebhookSubscriptionsRequest(server string, params *ListWebhookSubscriptionsParams) (*http.Request, error) { var err error serverURL, err := url.Parse(server) @@ -10501,7 +11113,7 @@ func NewImportEndUserRequestWithBody(server string, params *ImportEndUserParams, return nil, err } - operationPath := fmt.Sprintf("/v2/end-users/import") + operationPath := fmt.Sprintf("/v2/data/webhooks/subscriptions") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -10511,59 +11123,73 @@ func NewImportEndUserRequestWithBody(server string, params *ImportEndUserParams, return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - if params != nil { + queryValues := queryURL.Query() - if params.XWalletAuth != nil { - var headerParam0 string + if params.PageSize != nil { - headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Wallet-Auth", runtime.ParamLocationHeader, *params.XWalletAuth) - if err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "pageSize", runtime.ParamLocationQuery, *params.PageSize); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } } - req.Header.Set("X-Wallet-Auth", headerParam0) } - if params.XIdempotencyKey != nil { - var headerParam1 string + if params.PageToken != nil { - headerParam1, err = runtime.StyleParamWithLocation("simple", false, "X-Idempotency-Key", runtime.ParamLocationHeader, *params.XIdempotencyKey) - if err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "pageToken", runtime.ParamLocationQuery, *params.PageToken); err != nil { return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } } - req.Header.Set("X-Idempotency-Key", headerParam1) } + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err } return req, nil } -// NewGetEndUserRequest generates requests for GetEndUser -func NewGetEndUserRequest(server string, userId string) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "userId", runtime.ParamLocationPath, userId) +// NewCreateWebhookSubscriptionRequest calls the generic CreateWebhookSubscription builder with application/json body +func NewCreateWebhookSubscriptionRequest(server string, body CreateWebhookSubscriptionJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) if err != nil { return nil, err } + bodyReader = bytes.NewReader(buf) + return NewCreateWebhookSubscriptionRequestWithBody(server, "application/json", bodyReader) +} + +// NewCreateWebhookSubscriptionRequestWithBody generates requests for CreateWebhookSubscription with any type of body +func NewCreateWebhookSubscriptionRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/v2/end-users/%s", pathParam0) + operationPath := fmt.Sprintf("/v2/data/webhooks/subscriptions") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -10573,32 +11199,23 @@ func NewGetEndUserRequest(server string, userId string) (*http.Request, error) { return nil, err } - req, err := http.NewRequest("GET", queryURL.String(), nil) + req, err := http.NewRequest("POST", queryURL.String(), body) if err != nil { return nil, err } - return req, nil -} + req.Header.Add("Content-Type", contentType) -// NewAddEndUserEvmAccountRequest calls the generic AddEndUserEvmAccount builder with application/json body -func NewAddEndUserEvmAccountRequest(server string, userId string, params *AddEndUserEvmAccountParams, body AddEndUserEvmAccountJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewAddEndUserEvmAccountRequestWithBody(server, userId, params, "application/json", bodyReader) + return req, nil } -// NewAddEndUserEvmAccountRequestWithBody generates requests for AddEndUserEvmAccount with any type of body -func NewAddEndUserEvmAccountRequestWithBody(server string, userId string, params *AddEndUserEvmAccountParams, contentType string, body io.Reader) (*http.Request, error) { +// NewDeleteWebhookSubscriptionRequest generates requests for DeleteWebhookSubscription +func NewDeleteWebhookSubscriptionRequest(server string, subscriptionId openapi_types.UUID) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "userId", runtime.ParamLocationPath, userId) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "subscriptionId", runtime.ParamLocationPath, subscriptionId) if err != nil { return nil, err } @@ -10608,7 +11225,7 @@ func NewAddEndUserEvmAccountRequestWithBody(server string, userId string, params return nil, err } - operationPath := fmt.Sprintf("/v2/end-users/%s/evm", pathParam0) + operationPath := fmt.Sprintf("/v2/data/webhooks/subscriptions/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -10618,60 +11235,66 @@ func NewAddEndUserEvmAccountRequestWithBody(server string, userId string, params return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), body) + req, err := http.NewRequest("DELETE", queryURL.String(), nil) if err != nil { return nil, err } - req.Header.Add("Content-Type", contentType) - - if params != nil { + return req, nil +} - if params.XWalletAuth != nil { - var headerParam0 string +// NewGetWebhookSubscriptionRequest generates requests for GetWebhookSubscription +func NewGetWebhookSubscriptionRequest(server string, subscriptionId openapi_types.UUID) (*http.Request, error) { + var err error - headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Wallet-Auth", runtime.ParamLocationHeader, *params.XWalletAuth) - if err != nil { - return nil, err - } + var pathParam0 string - req.Header.Set("X-Wallet-Auth", headerParam0) - } + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "subscriptionId", runtime.ParamLocationPath, subscriptionId) + if err != nil { + return nil, err + } - if params.XIdempotencyKey != nil { - var headerParam1 string + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } - headerParam1, err = runtime.StyleParamWithLocation("simple", false, "X-Idempotency-Key", runtime.ParamLocationHeader, *params.XIdempotencyKey) - if err != nil { - return nil, err - } + operationPath := fmt.Sprintf("/v2/data/webhooks/subscriptions/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } - req.Header.Set("X-Idempotency-Key", headerParam1) - } + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err } return req, nil } -// NewAddEndUserEvmSmartAccountRequest calls the generic AddEndUserEvmSmartAccount builder with application/json body -func NewAddEndUserEvmSmartAccountRequest(server string, userId string, params *AddEndUserEvmSmartAccountParams, body AddEndUserEvmSmartAccountJSONRequestBody) (*http.Request, error) { +// NewUpdateWebhookSubscriptionRequest calls the generic UpdateWebhookSubscription builder with application/json body +func NewUpdateWebhookSubscriptionRequest(server string, subscriptionId openapi_types.UUID, body UpdateWebhookSubscriptionJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewAddEndUserEvmSmartAccountRequestWithBody(server, userId, params, "application/json", bodyReader) + return NewUpdateWebhookSubscriptionRequestWithBody(server, subscriptionId, "application/json", bodyReader) } -// NewAddEndUserEvmSmartAccountRequestWithBody generates requests for AddEndUserEvmSmartAccount with any type of body -func NewAddEndUserEvmSmartAccountRequestWithBody(server string, userId string, params *AddEndUserEvmSmartAccountParams, contentType string, body io.Reader) (*http.Request, error) { +// NewUpdateWebhookSubscriptionRequestWithBody generates requests for UpdateWebhookSubscription with any type of body +func NewUpdateWebhookSubscriptionRequestWithBody(server string, subscriptionId openapi_types.UUID, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "userId", runtime.ParamLocationPath, userId) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "subscriptionId", runtime.ParamLocationPath, subscriptionId) if err != nil { return nil, err } @@ -10681,7 +11304,7 @@ func NewAddEndUserEvmSmartAccountRequestWithBody(server string, userId string, p return nil, err } - operationPath := fmt.Sprintf("/v2/end-users/%s/evm-smart-account", pathParam0) + operationPath := fmt.Sprintf("/v2/data/webhooks/subscriptions/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -10691,60 +11314,41 @@ func NewAddEndUserEvmSmartAccountRequestWithBody(server string, userId string, p return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), body) + req, err := http.NewRequest("PUT", queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) - if params != nil { - - if params.XWalletAuth != nil { - var headerParam0 string - - headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Wallet-Auth", runtime.ParamLocationHeader, *params.XWalletAuth) - if err != nil { - return nil, err - } - - req.Header.Set("X-Wallet-Auth", headerParam0) - } - - if params.XIdempotencyKey != nil { - var headerParam1 string - - headerParam1, err = runtime.StyleParamWithLocation("simple", false, "X-Idempotency-Key", runtime.ParamLocationHeader, *params.XIdempotencyKey) - if err != nil { - return nil, err - } - - req.Header.Set("X-Idempotency-Key", headerParam1) - } - - } - return req, nil } -// NewAddEndUserSolanaAccountRequest calls the generic AddEndUserSolanaAccount builder with application/json body -func NewAddEndUserSolanaAccountRequest(server string, userId string, params *AddEndUserSolanaAccountParams, body AddEndUserSolanaAccountJSONRequestBody) (*http.Request, error) { +// NewRevokeDelegationForEndUserRequest calls the generic RevokeDelegationForEndUser builder with application/json body +func NewRevokeDelegationForEndUserRequest(server string, projectId string, userId string, params *RevokeDelegationForEndUserParams, body RevokeDelegationForEndUserJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewAddEndUserSolanaAccountRequestWithBody(server, userId, params, "application/json", bodyReader) + return NewRevokeDelegationForEndUserRequestWithBody(server, projectId, userId, params, "application/json", bodyReader) } -// NewAddEndUserSolanaAccountRequestWithBody generates requests for AddEndUserSolanaAccount with any type of body -func NewAddEndUserSolanaAccountRequestWithBody(server string, userId string, params *AddEndUserSolanaAccountParams, contentType string, body io.Reader) (*http.Request, error) { +// NewRevokeDelegationForEndUserRequestWithBody generates requests for RevokeDelegationForEndUser with any type of body +func NewRevokeDelegationForEndUserRequestWithBody(server string, projectId string, userId string, params *RevokeDelegationForEndUserParams, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "userId", runtime.ParamLocationPath, userId) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "projectId", runtime.ParamLocationPath, projectId) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "userId", runtime.ParamLocationPath, userId) if err != nil { return nil, err } @@ -10754,7 +11358,7 @@ func NewAddEndUserSolanaAccountRequestWithBody(server string, userId string, par return nil, err } - operationPath := fmt.Sprintf("/v2/end-users/%s/solana", pathParam0) + operationPath := fmt.Sprintf("/v2/embedded-wallet-api/projects/%s/end-users/%s/delegation", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -10764,7 +11368,7 @@ func NewAddEndUserSolanaAccountRequestWithBody(server string, userId string, par return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), body) + req, err := http.NewRequest("DELETE", queryURL.String(), body) if err != nil { return nil, err } @@ -10784,15 +11388,26 @@ func NewAddEndUserSolanaAccountRequestWithBody(server string, userId string, par req.Header.Set("X-Wallet-Auth", headerParam0) } - if params.XIdempotencyKey != nil { + if params.XDeveloperAuth != nil { var headerParam1 string - headerParam1, err = runtime.StyleParamWithLocation("simple", false, "X-Idempotency-Key", runtime.ParamLocationHeader, *params.XIdempotencyKey) + headerParam1, err = runtime.StyleParamWithLocation("simple", false, "X-Developer-Auth", runtime.ParamLocationHeader, *params.XDeveloperAuth) if err != nil { return nil, err } - req.Header.Set("X-Idempotency-Key", headerParam1) + req.Header.Set("X-Developer-Auth", headerParam1) + } + + if params.XIdempotencyKey != nil { + var headerParam2 string + + headerParam2, err = runtime.StyleParamWithLocation("simple", false, "X-Idempotency-Key", runtime.ParamLocationHeader, *params.XIdempotencyKey) + if err != nil { + return nil, err + } + + req.Header.Set("X-Idempotency-Key", headerParam2) } } @@ -10800,16 +11415,41 @@ func NewAddEndUserSolanaAccountRequestWithBody(server string, userId string, par return req, nil } -// NewListEvmAccountsRequest generates requests for ListEvmAccounts -func NewListEvmAccountsRequest(server string, params *ListEvmAccountsParams) (*http.Request, error) { +// NewCreateEvmEip7702DelegationWithEndUserAccountRequest calls the generic CreateEvmEip7702DelegationWithEndUserAccount builder with application/json body +func NewCreateEvmEip7702DelegationWithEndUserAccountRequest(server string, projectId string, userId string, params *CreateEvmEip7702DelegationWithEndUserAccountParams, body CreateEvmEip7702DelegationWithEndUserAccountJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewCreateEvmEip7702DelegationWithEndUserAccountRequestWithBody(server, projectId, userId, params, "application/json", bodyReader) +} + +// NewCreateEvmEip7702DelegationWithEndUserAccountRequestWithBody generates requests for CreateEvmEip7702DelegationWithEndUserAccount with any type of body +func NewCreateEvmEip7702DelegationWithEndUserAccountRequestWithBody(server string, projectId string, userId string, params *CreateEvmEip7702DelegationWithEndUserAccountParams, contentType string, body io.Reader) (*http.Request, error) { var err error + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "projectId", runtime.ParamLocationPath, projectId) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "userId", runtime.ParamLocationPath, userId) + if err != nil { + return nil, err + } + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/v2/evm/accounts") + operationPath := fmt.Sprintf("/v2/embedded-wallet-api/projects/%s/end-users/%s/evm/eip7702/delegation", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -10819,73 +11459,88 @@ func NewListEvmAccountsRequest(server string, params *ListEvmAccountsParams) (*h return nil, err } + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + if params != nil { - queryValues := queryURL.Query() - if params.PageSize != nil { + if params.XWalletAuth != nil { + var headerParam0 string - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "pageSize", runtime.ParamLocationQuery, *params.PageSize); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Wallet-Auth", runtime.ParamLocationHeader, *params.XWalletAuth) + if err != nil { return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } } + req.Header.Set("X-Wallet-Auth", headerParam0) } - if params.PageToken != nil { + if params.XIdempotencyKey != nil { + var headerParam1 string - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "pageToken", runtime.ParamLocationQuery, *params.PageToken); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + headerParam1, err = runtime.StyleParamWithLocation("simple", false, "X-Idempotency-Key", runtime.ParamLocationHeader, *params.XIdempotencyKey) + if err != nil { return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } } + req.Header.Set("X-Idempotency-Key", headerParam1) } - queryURL.RawQuery = queryValues.Encode() - } + if params.XDeveloperAuth != nil { + var headerParam2 string + + headerParam2, err = runtime.StyleParamWithLocation("simple", false, "X-Developer-Auth", runtime.ParamLocationHeader, *params.XDeveloperAuth) + if err != nil { + return nil, err + } + + req.Header.Set("X-Developer-Auth", headerParam2) + } - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err } return req, nil } -// NewCreateEvmAccountRequest calls the generic CreateEvmAccount builder with application/json body -func NewCreateEvmAccountRequest(server string, params *CreateEvmAccountParams, body CreateEvmAccountJSONRequestBody) (*http.Request, error) { +// NewSendEvmTransactionWithEndUserAccountRequest calls the generic SendEvmTransactionWithEndUserAccount builder with application/json body +func NewSendEvmTransactionWithEndUserAccountRequest(server string, projectId string, userId string, params *SendEvmTransactionWithEndUserAccountParams, body SendEvmTransactionWithEndUserAccountJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewCreateEvmAccountRequestWithBody(server, params, "application/json", bodyReader) + return NewSendEvmTransactionWithEndUserAccountRequestWithBody(server, projectId, userId, params, "application/json", bodyReader) } -// NewCreateEvmAccountRequestWithBody generates requests for CreateEvmAccount with any type of body -func NewCreateEvmAccountRequestWithBody(server string, params *CreateEvmAccountParams, contentType string, body io.Reader) (*http.Request, error) { +// NewSendEvmTransactionWithEndUserAccountRequestWithBody generates requests for SendEvmTransactionWithEndUserAccount with any type of body +func NewSendEvmTransactionWithEndUserAccountRequestWithBody(server string, projectId string, userId string, params *SendEvmTransactionWithEndUserAccountParams, contentType string, body io.Reader) (*http.Request, error) { var err error + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "projectId", runtime.ParamLocationPath, projectId) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "userId", runtime.ParamLocationPath, userId) + if err != nil { + return nil, err + } + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/v2/evm/accounts") + operationPath := fmt.Sprintf("/v2/embedded-wallet-api/projects/%s/end-users/%s/evm/send/transaction", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -10926,63 +11581,47 @@ func NewCreateEvmAccountRequestWithBody(server string, params *CreateEvmAccountP req.Header.Set("X-Idempotency-Key", headerParam1) } - } - - return req, nil -} - -// NewGetEvmAccountByNameRequest generates requests for GetEvmAccountByName -func NewGetEvmAccountByNameRequest(server string, name string) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "name", runtime.ParamLocationPath, name) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } + if params.XDeveloperAuth != nil { + var headerParam2 string - operationPath := fmt.Sprintf("/v2/evm/accounts/by-name/%s", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } + headerParam2, err = runtime.StyleParamWithLocation("simple", false, "X-Developer-Auth", runtime.ParamLocationHeader, *params.XDeveloperAuth) + if err != nil { + return nil, err + } - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } + req.Header.Set("X-Developer-Auth", headerParam2) + } - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err } return req, nil } -// NewExportEvmAccountByNameRequest calls the generic ExportEvmAccountByName builder with application/json body -func NewExportEvmAccountByNameRequest(server string, name string, params *ExportEvmAccountByNameParams, body ExportEvmAccountByNameJSONRequestBody) (*http.Request, error) { +// NewSignEvmHashWithEndUserAccountRequest calls the generic SignEvmHashWithEndUserAccount builder with application/json body +func NewSignEvmHashWithEndUserAccountRequest(server string, projectId string, userId string, params *SignEvmHashWithEndUserAccountParams, body SignEvmHashWithEndUserAccountJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewExportEvmAccountByNameRequestWithBody(server, name, params, "application/json", bodyReader) + return NewSignEvmHashWithEndUserAccountRequestWithBody(server, projectId, userId, params, "application/json", bodyReader) } -// NewExportEvmAccountByNameRequestWithBody generates requests for ExportEvmAccountByName with any type of body -func NewExportEvmAccountByNameRequestWithBody(server string, name string, params *ExportEvmAccountByNameParams, contentType string, body io.Reader) (*http.Request, error) { +// NewSignEvmHashWithEndUserAccountRequestWithBody generates requests for SignEvmHashWithEndUserAccount with any type of body +func NewSignEvmHashWithEndUserAccountRequestWithBody(server string, projectId string, userId string, params *SignEvmHashWithEndUserAccountParams, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "name", runtime.ParamLocationPath, name) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "projectId", runtime.ParamLocationPath, projectId) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "userId", runtime.ParamLocationPath, userId) if err != nil { return nil, err } @@ -10992,7 +11631,7 @@ func NewExportEvmAccountByNameRequestWithBody(server string, name string, params return nil, err } - operationPath := fmt.Sprintf("/v2/evm/accounts/export/by-name/%s", pathParam0) + operationPath := fmt.Sprintf("/v2/embedded-wallet-api/projects/%s/end-users/%s/evm/sign", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -11033,32 +11672,57 @@ func NewExportEvmAccountByNameRequestWithBody(server string, name string, params req.Header.Set("X-Idempotency-Key", headerParam1) } - } + if params.XDeveloperAuth != nil { + var headerParam2 string - return req, nil -} + headerParam2, err = runtime.StyleParamWithLocation("simple", false, "X-Developer-Auth", runtime.ParamLocationHeader, *params.XDeveloperAuth) + if err != nil { + return nil, err + } -// NewImportEvmAccountRequest calls the generic ImportEvmAccount builder with application/json body -func NewImportEvmAccountRequest(server string, params *ImportEvmAccountParams, body ImportEvmAccountJSONRequestBody) (*http.Request, error) { + req.Header.Set("X-Developer-Auth", headerParam2) + } + + } + + return req, nil +} + +// NewSignEvmMessageWithEndUserAccountRequest calls the generic SignEvmMessageWithEndUserAccount builder with application/json body +func NewSignEvmMessageWithEndUserAccountRequest(server string, projectId string, userId string, params *SignEvmMessageWithEndUserAccountParams, body SignEvmMessageWithEndUserAccountJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewImportEvmAccountRequestWithBody(server, params, "application/json", bodyReader) + return NewSignEvmMessageWithEndUserAccountRequestWithBody(server, projectId, userId, params, "application/json", bodyReader) } -// NewImportEvmAccountRequestWithBody generates requests for ImportEvmAccount with any type of body -func NewImportEvmAccountRequestWithBody(server string, params *ImportEvmAccountParams, contentType string, body io.Reader) (*http.Request, error) { +// NewSignEvmMessageWithEndUserAccountRequestWithBody generates requests for SignEvmMessageWithEndUserAccount with any type of body +func NewSignEvmMessageWithEndUserAccountRequestWithBody(server string, projectId string, userId string, params *SignEvmMessageWithEndUserAccountParams, contentType string, body io.Reader) (*http.Request, error) { var err error + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "projectId", runtime.ParamLocationPath, projectId) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "userId", runtime.ParamLocationPath, userId) + if err != nil { + return nil, err + } + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/v2/evm/accounts/import") + operationPath := fmt.Sprintf("/v2/embedded-wallet-api/projects/%s/end-users/%s/evm/sign/message", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -11099,63 +11763,47 @@ func NewImportEvmAccountRequestWithBody(server string, params *ImportEvmAccountP req.Header.Set("X-Idempotency-Key", headerParam1) } - } - - return req, nil -} - -// NewGetEvmAccountRequest generates requests for GetEvmAccount -func NewGetEvmAccountRequest(server string, address string) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "address", runtime.ParamLocationPath, address) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } + if params.XDeveloperAuth != nil { + var headerParam2 string - operationPath := fmt.Sprintf("/v2/evm/accounts/%s", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } + headerParam2, err = runtime.StyleParamWithLocation("simple", false, "X-Developer-Auth", runtime.ParamLocationHeader, *params.XDeveloperAuth) + if err != nil { + return nil, err + } - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } + req.Header.Set("X-Developer-Auth", headerParam2) + } - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err } return req, nil } -// NewUpdateEvmAccountRequest calls the generic UpdateEvmAccount builder with application/json body -func NewUpdateEvmAccountRequest(server string, address string, params *UpdateEvmAccountParams, body UpdateEvmAccountJSONRequestBody) (*http.Request, error) { +// NewSignEvmTransactionWithEndUserAccountRequest calls the generic SignEvmTransactionWithEndUserAccount builder with application/json body +func NewSignEvmTransactionWithEndUserAccountRequest(server string, projectId string, userId string, params *SignEvmTransactionWithEndUserAccountParams, body SignEvmTransactionWithEndUserAccountJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewUpdateEvmAccountRequestWithBody(server, address, params, "application/json", bodyReader) + return NewSignEvmTransactionWithEndUserAccountRequestWithBody(server, projectId, userId, params, "application/json", bodyReader) } -// NewUpdateEvmAccountRequestWithBody generates requests for UpdateEvmAccount with any type of body -func NewUpdateEvmAccountRequestWithBody(server string, address string, params *UpdateEvmAccountParams, contentType string, body io.Reader) (*http.Request, error) { +// NewSignEvmTransactionWithEndUserAccountRequestWithBody generates requests for SignEvmTransactionWithEndUserAccount with any type of body +func NewSignEvmTransactionWithEndUserAccountRequestWithBody(server string, projectId string, userId string, params *SignEvmTransactionWithEndUserAccountParams, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "address", runtime.ParamLocationPath, address) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "projectId", runtime.ParamLocationPath, projectId) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "userId", runtime.ParamLocationPath, userId) if err != nil { return nil, err } @@ -11165,7 +11813,7 @@ func NewUpdateEvmAccountRequestWithBody(server string, address string, params *U return nil, err } - operationPath := fmt.Sprintf("/v2/evm/accounts/%s", pathParam0) + operationPath := fmt.Sprintf("/v2/embedded-wallet-api/projects/%s/end-users/%s/evm/sign/transaction", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -11175,7 +11823,7 @@ func NewUpdateEvmAccountRequestWithBody(server string, address string, params *U return nil, err } - req, err := http.NewRequest("PUT", queryURL.String(), body) + req, err := http.NewRequest("POST", queryURL.String(), body) if err != nil { return nil, err } @@ -11184,15 +11832,37 @@ func NewUpdateEvmAccountRequestWithBody(server string, address string, params *U if params != nil { - if params.XIdempotencyKey != nil { + if params.XWalletAuth != nil { var headerParam0 string - headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Idempotency-Key", runtime.ParamLocationHeader, *params.XIdempotencyKey) + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Wallet-Auth", runtime.ParamLocationHeader, *params.XWalletAuth) if err != nil { return nil, err } - req.Header.Set("X-Idempotency-Key", headerParam0) + req.Header.Set("X-Wallet-Auth", headerParam0) + } + + if params.XIdempotencyKey != nil { + var headerParam1 string + + headerParam1, err = runtime.StyleParamWithLocation("simple", false, "X-Idempotency-Key", runtime.ParamLocationHeader, *params.XIdempotencyKey) + if err != nil { + return nil, err + } + + req.Header.Set("X-Idempotency-Key", headerParam1) + } + + if params.XDeveloperAuth != nil { + var headerParam2 string + + headerParam2, err = runtime.StyleParamWithLocation("simple", false, "X-Developer-Auth", runtime.ParamLocationHeader, *params.XDeveloperAuth) + if err != nil { + return nil, err + } + + req.Header.Set("X-Developer-Auth", headerParam2) } } @@ -11200,24 +11870,31 @@ func NewUpdateEvmAccountRequestWithBody(server string, address string, params *U return req, nil } -// NewCreateEvmEip7702DelegationRequest calls the generic CreateEvmEip7702Delegation builder with application/json body -func NewCreateEvmEip7702DelegationRequest(server string, address string, params *CreateEvmEip7702DelegationParams, body CreateEvmEip7702DelegationJSONRequestBody) (*http.Request, error) { +// NewSignEvmTypedDataWithEndUserAccountRequest calls the generic SignEvmTypedDataWithEndUserAccount builder with application/json body +func NewSignEvmTypedDataWithEndUserAccountRequest(server string, projectId string, userId string, params *SignEvmTypedDataWithEndUserAccountParams, body SignEvmTypedDataWithEndUserAccountJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewCreateEvmEip7702DelegationRequestWithBody(server, address, params, "application/json", bodyReader) + return NewSignEvmTypedDataWithEndUserAccountRequestWithBody(server, projectId, userId, params, "application/json", bodyReader) } -// NewCreateEvmEip7702DelegationRequestWithBody generates requests for CreateEvmEip7702Delegation with any type of body -func NewCreateEvmEip7702DelegationRequestWithBody(server string, address string, params *CreateEvmEip7702DelegationParams, contentType string, body io.Reader) (*http.Request, error) { +// NewSignEvmTypedDataWithEndUserAccountRequestWithBody generates requests for SignEvmTypedDataWithEndUserAccount with any type of body +func NewSignEvmTypedDataWithEndUserAccountRequestWithBody(server string, projectId string, userId string, params *SignEvmTypedDataWithEndUserAccountParams, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "address", runtime.ParamLocationPath, address) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "projectId", runtime.ParamLocationPath, projectId) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "userId", runtime.ParamLocationPath, userId) if err != nil { return nil, err } @@ -11227,7 +11904,7 @@ func NewCreateEvmEip7702DelegationRequestWithBody(server string, address string, return nil, err } - operationPath := fmt.Sprintf("/v2/evm/accounts/%s/eip7702/delegation", pathParam0) + operationPath := fmt.Sprintf("/v2/embedded-wallet-api/projects/%s/end-users/%s/evm/sign/typed-data", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -11268,29 +11945,54 @@ func NewCreateEvmEip7702DelegationRequestWithBody(server string, address string, req.Header.Set("X-Idempotency-Key", headerParam1) } + if params.XDeveloperAuth != nil { + var headerParam2 string + + headerParam2, err = runtime.StyleParamWithLocation("simple", false, "X-Developer-Auth", runtime.ParamLocationHeader, *params.XDeveloperAuth) + if err != nil { + return nil, err + } + + req.Header.Set("X-Developer-Auth", headerParam2) + } + } return req, nil } -// NewExportEvmAccountRequest calls the generic ExportEvmAccount builder with application/json body -func NewExportEvmAccountRequest(server string, address string, params *ExportEvmAccountParams, body ExportEvmAccountJSONRequestBody) (*http.Request, error) { +// NewSendUserOperationWithEndUserAccountRequest calls the generic SendUserOperationWithEndUserAccount builder with application/json body +func NewSendUserOperationWithEndUserAccountRequest(server string, projectId string, userId string, address string, params *SendUserOperationWithEndUserAccountParams, body SendUserOperationWithEndUserAccountJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewExportEvmAccountRequestWithBody(server, address, params, "application/json", bodyReader) + return NewSendUserOperationWithEndUserAccountRequestWithBody(server, projectId, userId, address, params, "application/json", bodyReader) } -// NewExportEvmAccountRequestWithBody generates requests for ExportEvmAccount with any type of body -func NewExportEvmAccountRequestWithBody(server string, address string, params *ExportEvmAccountParams, contentType string, body io.Reader) (*http.Request, error) { +// NewSendUserOperationWithEndUserAccountRequestWithBody generates requests for SendUserOperationWithEndUserAccount with any type of body +func NewSendUserOperationWithEndUserAccountRequestWithBody(server string, projectId string, userId string, address string, params *SendUserOperationWithEndUserAccountParams, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "address", runtime.ParamLocationPath, address) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "projectId", runtime.ParamLocationPath, projectId) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "userId", runtime.ParamLocationPath, userId) + if err != nil { + return nil, err + } + + var pathParam2 string + + pathParam2, err = runtime.StyleParamWithLocation("simple", false, "address", runtime.ParamLocationPath, address) if err != nil { return nil, err } @@ -11300,7 +12002,7 @@ func NewExportEvmAccountRequestWithBody(server string, address string, params *E return nil, err } - operationPath := fmt.Sprintf("/v2/evm/accounts/%s/export", pathParam0) + operationPath := fmt.Sprintf("/v2/embedded-wallet-api/projects/%s/end-users/%s/evm/smart-accounts/%s/send", pathParam0, pathParam1, pathParam2) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -11319,26 +12021,37 @@ func NewExportEvmAccountRequestWithBody(server string, address string, params *E if params != nil { - if params.XWalletAuth != nil { + if params.XIdempotencyKey != nil { var headerParam0 string - headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Wallet-Auth", runtime.ParamLocationHeader, *params.XWalletAuth) + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Idempotency-Key", runtime.ParamLocationHeader, *params.XIdempotencyKey) if err != nil { return nil, err } - req.Header.Set("X-Wallet-Auth", headerParam0) + req.Header.Set("X-Idempotency-Key", headerParam0) } - if params.XIdempotencyKey != nil { + if params.XWalletAuth != nil { var headerParam1 string - headerParam1, err = runtime.StyleParamWithLocation("simple", false, "X-Idempotency-Key", runtime.ParamLocationHeader, *params.XIdempotencyKey) + headerParam1, err = runtime.StyleParamWithLocation("simple", false, "X-Wallet-Auth", runtime.ParamLocationHeader, *params.XWalletAuth) if err != nil { return nil, err } - req.Header.Set("X-Idempotency-Key", headerParam1) + req.Header.Set("X-Wallet-Auth", headerParam1) + } + + if params.XDeveloperAuth != nil { + var headerParam2 string + + headerParam2, err = runtime.StyleParamWithLocation("simple", false, "X-Developer-Auth", runtime.ParamLocationHeader, *params.XDeveloperAuth) + if err != nil { + return nil, err + } + + req.Header.Set("X-Developer-Auth", headerParam2) } } @@ -11346,24 +12059,38 @@ func NewExportEvmAccountRequestWithBody(server string, address string, params *E return req, nil } -// NewSendEvmTransactionRequest calls the generic SendEvmTransaction builder with application/json body -func NewSendEvmTransactionRequest(server string, address string, params *SendEvmTransactionParams, body SendEvmTransactionJSONRequestBody) (*http.Request, error) { +// NewRevokeSpendPermissionWithEndUserAccountRequest calls the generic RevokeSpendPermissionWithEndUserAccount builder with application/json body +func NewRevokeSpendPermissionWithEndUserAccountRequest(server string, projectId string, userId string, address string, params *RevokeSpendPermissionWithEndUserAccountParams, body RevokeSpendPermissionWithEndUserAccountJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewSendEvmTransactionRequestWithBody(server, address, params, "application/json", bodyReader) + return NewRevokeSpendPermissionWithEndUserAccountRequestWithBody(server, projectId, userId, address, params, "application/json", bodyReader) } -// NewSendEvmTransactionRequestWithBody generates requests for SendEvmTransaction with any type of body -func NewSendEvmTransactionRequestWithBody(server string, address string, params *SendEvmTransactionParams, contentType string, body io.Reader) (*http.Request, error) { +// NewRevokeSpendPermissionWithEndUserAccountRequestWithBody generates requests for RevokeSpendPermissionWithEndUserAccount with any type of body +func NewRevokeSpendPermissionWithEndUserAccountRequestWithBody(server string, projectId string, userId string, address string, params *RevokeSpendPermissionWithEndUserAccountParams, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "address", runtime.ParamLocationPath, address) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "projectId", runtime.ParamLocationPath, projectId) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "userId", runtime.ParamLocationPath, userId) + if err != nil { + return nil, err + } + + var pathParam2 string + + pathParam2, err = runtime.StyleParamWithLocation("simple", false, "address", runtime.ParamLocationPath, address) if err != nil { return nil, err } @@ -11373,7 +12100,7 @@ func NewSendEvmTransactionRequestWithBody(server string, address string, params return nil, err } - operationPath := fmt.Sprintf("/v2/evm/accounts/%s/send/transaction", pathParam0) + operationPath := fmt.Sprintf("/v2/embedded-wallet-api/projects/%s/end-users/%s/evm/smart-accounts/%s/spend-permissions/revoke", pathParam0, pathParam1, pathParam2) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -11419,24 +12146,45 @@ func NewSendEvmTransactionRequestWithBody(server string, address string, params return req, nil } -// NewSignEvmHashRequest calls the generic SignEvmHash builder with application/json body -func NewSignEvmHashRequest(server string, address string, params *SignEvmHashParams, body SignEvmHashJSONRequestBody) (*http.Request, error) { +// NewSendEvmAssetWithEndUserAccountRequest calls the generic SendEvmAssetWithEndUserAccount builder with application/json body +func NewSendEvmAssetWithEndUserAccountRequest(server string, projectId string, userId string, address BlockchainAddress, asset Asset, params *SendEvmAssetWithEndUserAccountParams, body SendEvmAssetWithEndUserAccountJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewSignEvmHashRequestWithBody(server, address, params, "application/json", bodyReader) + return NewSendEvmAssetWithEndUserAccountRequestWithBody(server, projectId, userId, address, asset, params, "application/json", bodyReader) } -// NewSignEvmHashRequestWithBody generates requests for SignEvmHash with any type of body -func NewSignEvmHashRequestWithBody(server string, address string, params *SignEvmHashParams, contentType string, body io.Reader) (*http.Request, error) { +// NewSendEvmAssetWithEndUserAccountRequestWithBody generates requests for SendEvmAssetWithEndUserAccount with any type of body +func NewSendEvmAssetWithEndUserAccountRequestWithBody(server string, projectId string, userId string, address BlockchainAddress, asset Asset, params *SendEvmAssetWithEndUserAccountParams, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "address", runtime.ParamLocationPath, address) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "projectId", runtime.ParamLocationPath, projectId) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "userId", runtime.ParamLocationPath, userId) + if err != nil { + return nil, err + } + + var pathParam2 string + + pathParam2, err = runtime.StyleParamWithLocation("simple", false, "address", runtime.ParamLocationPath, address) + if err != nil { + return nil, err + } + + var pathParam3 string + + pathParam3, err = runtime.StyleParamWithLocation("simple", false, "asset", runtime.ParamLocationPath, asset) if err != nil { return nil, err } @@ -11446,7 +12194,7 @@ func NewSignEvmHashRequestWithBody(server string, address string, params *SignEv return nil, err } - operationPath := fmt.Sprintf("/v2/evm/accounts/%s/sign", pathParam0) + operationPath := fmt.Sprintf("/v2/embedded-wallet-api/projects/%s/end-users/%s/evm/%s/send/%s", pathParam0, pathParam1, pathParam2, pathParam3) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -11487,29 +12235,47 @@ func NewSignEvmHashRequestWithBody(server string, address string, params *SignEv req.Header.Set("X-Idempotency-Key", headerParam1) } + if params.XDeveloperAuth != nil { + var headerParam2 string + + headerParam2, err = runtime.StyleParamWithLocation("simple", false, "X-Developer-Auth", runtime.ParamLocationHeader, *params.XDeveloperAuth) + if err != nil { + return nil, err + } + + req.Header.Set("X-Developer-Auth", headerParam2) + } + } return req, nil } -// NewSignEvmMessageRequest calls the generic SignEvmMessage builder with application/json body -func NewSignEvmMessageRequest(server string, address string, params *SignEvmMessageParams, body SignEvmMessageJSONRequestBody) (*http.Request, error) { +// NewSendSolanaTransactionWithEndUserAccountRequest calls the generic SendSolanaTransactionWithEndUserAccount builder with application/json body +func NewSendSolanaTransactionWithEndUserAccountRequest(server string, projectId string, userId string, params *SendSolanaTransactionWithEndUserAccountParams, body SendSolanaTransactionWithEndUserAccountJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewSignEvmMessageRequestWithBody(server, address, params, "application/json", bodyReader) + return NewSendSolanaTransactionWithEndUserAccountRequestWithBody(server, projectId, userId, params, "application/json", bodyReader) } -// NewSignEvmMessageRequestWithBody generates requests for SignEvmMessage with any type of body -func NewSignEvmMessageRequestWithBody(server string, address string, params *SignEvmMessageParams, contentType string, body io.Reader) (*http.Request, error) { +// NewSendSolanaTransactionWithEndUserAccountRequestWithBody generates requests for SendSolanaTransactionWithEndUserAccount with any type of body +func NewSendSolanaTransactionWithEndUserAccountRequestWithBody(server string, projectId string, userId string, params *SendSolanaTransactionWithEndUserAccountParams, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "address", runtime.ParamLocationPath, address) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "projectId", runtime.ParamLocationPath, projectId) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "userId", runtime.ParamLocationPath, userId) if err != nil { return nil, err } @@ -11519,7 +12285,7 @@ func NewSignEvmMessageRequestWithBody(server string, address string, params *Sig return nil, err } - operationPath := fmt.Sprintf("/v2/evm/accounts/%s/sign/message", pathParam0) + operationPath := fmt.Sprintf("/v2/embedded-wallet-api/projects/%s/end-users/%s/solana/send/transaction", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -11560,29 +12326,47 @@ func NewSignEvmMessageRequestWithBody(server string, address string, params *Sig req.Header.Set("X-Idempotency-Key", headerParam1) } + if params.XDeveloperAuth != nil { + var headerParam2 string + + headerParam2, err = runtime.StyleParamWithLocation("simple", false, "X-Developer-Auth", runtime.ParamLocationHeader, *params.XDeveloperAuth) + if err != nil { + return nil, err + } + + req.Header.Set("X-Developer-Auth", headerParam2) + } + } return req, nil } -// NewSignEvmTransactionRequest calls the generic SignEvmTransaction builder with application/json body -func NewSignEvmTransactionRequest(server string, address string, params *SignEvmTransactionParams, body SignEvmTransactionJSONRequestBody) (*http.Request, error) { +// NewSignSolanaHashWithEndUserAccountRequest calls the generic SignSolanaHashWithEndUserAccount builder with application/json body +func NewSignSolanaHashWithEndUserAccountRequest(server string, projectId string, userId string, params *SignSolanaHashWithEndUserAccountParams, body SignSolanaHashWithEndUserAccountJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewSignEvmTransactionRequestWithBody(server, address, params, "application/json", bodyReader) + return NewSignSolanaHashWithEndUserAccountRequestWithBody(server, projectId, userId, params, "application/json", bodyReader) } -// NewSignEvmTransactionRequestWithBody generates requests for SignEvmTransaction with any type of body -func NewSignEvmTransactionRequestWithBody(server string, address string, params *SignEvmTransactionParams, contentType string, body io.Reader) (*http.Request, error) { +// NewSignSolanaHashWithEndUserAccountRequestWithBody generates requests for SignSolanaHashWithEndUserAccount with any type of body +func NewSignSolanaHashWithEndUserAccountRequestWithBody(server string, projectId string, userId string, params *SignSolanaHashWithEndUserAccountParams, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "address", runtime.ParamLocationPath, address) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "projectId", runtime.ParamLocationPath, projectId) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "userId", runtime.ParamLocationPath, userId) if err != nil { return nil, err } @@ -11592,7 +12376,7 @@ func NewSignEvmTransactionRequestWithBody(server string, address string, params return nil, err } - operationPath := fmt.Sprintf("/v2/evm/accounts/%s/sign/transaction", pathParam0) + operationPath := fmt.Sprintf("/v2/embedded-wallet-api/projects/%s/end-users/%s/solana/sign", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -11633,39 +12417,57 @@ func NewSignEvmTransactionRequestWithBody(server string, address string, params req.Header.Set("X-Idempotency-Key", headerParam1) } + if params.XDeveloperAuth != nil { + var headerParam2 string + + headerParam2, err = runtime.StyleParamWithLocation("simple", false, "X-Developer-Auth", runtime.ParamLocationHeader, *params.XDeveloperAuth) + if err != nil { + return nil, err + } + + req.Header.Set("X-Developer-Auth", headerParam2) + } + } return req, nil } -// NewSignEvmTypedDataRequest calls the generic SignEvmTypedData builder with application/json body -func NewSignEvmTypedDataRequest(server string, address string, params *SignEvmTypedDataParams, body SignEvmTypedDataJSONRequestBody) (*http.Request, error) { +// NewSignSolanaMessageWithEndUserAccountRequest calls the generic SignSolanaMessageWithEndUserAccount builder with application/json body +func NewSignSolanaMessageWithEndUserAccountRequest(server string, projectId string, userId string, params *SignSolanaMessageWithEndUserAccountParams, body SignSolanaMessageWithEndUserAccountJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewSignEvmTypedDataRequestWithBody(server, address, params, "application/json", bodyReader) + return NewSignSolanaMessageWithEndUserAccountRequestWithBody(server, projectId, userId, params, "application/json", bodyReader) } -// NewSignEvmTypedDataRequestWithBody generates requests for SignEvmTypedData with any type of body -func NewSignEvmTypedDataRequestWithBody(server string, address string, params *SignEvmTypedDataParams, contentType string, body io.Reader) (*http.Request, error) { +// NewSignSolanaMessageWithEndUserAccountRequestWithBody generates requests for SignSolanaMessageWithEndUserAccount with any type of body +func NewSignSolanaMessageWithEndUserAccountRequestWithBody(server string, projectId string, userId string, params *SignSolanaMessageWithEndUserAccountParams, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "address", runtime.ParamLocationPath, address) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "projectId", runtime.ParamLocationPath, projectId) if err != nil { return nil, err } - serverURL, err := url.Parse(server) + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "userId", runtime.ParamLocationPath, userId) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/v2/evm/accounts/%s/sign/typed-data", pathParam0) + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v2/embedded-wallet-api/projects/%s/end-users/%s/solana/sign/message", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -11706,18 +12508,47 @@ func NewSignEvmTypedDataRequestWithBody(server string, address string, params *S req.Header.Set("X-Idempotency-Key", headerParam1) } + if params.XDeveloperAuth != nil { + var headerParam2 string + + headerParam2, err = runtime.StyleParamWithLocation("simple", false, "X-Developer-Auth", runtime.ParamLocationHeader, *params.XDeveloperAuth) + if err != nil { + return nil, err + } + + req.Header.Set("X-Developer-Auth", headerParam2) + } + } return req, nil } -// NewGetEvmEip7702DelegationOperationByIdRequest generates requests for GetEvmEip7702DelegationOperationById -func NewGetEvmEip7702DelegationOperationByIdRequest(server string, delegationOperationId openapi_types.UUID) (*http.Request, error) { +// NewSignSolanaTransactionWithEndUserAccountRequest calls the generic SignSolanaTransactionWithEndUserAccount builder with application/json body +func NewSignSolanaTransactionWithEndUserAccountRequest(server string, projectId string, userId string, params *SignSolanaTransactionWithEndUserAccountParams, body SignSolanaTransactionWithEndUserAccountJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewSignSolanaTransactionWithEndUserAccountRequestWithBody(server, projectId, userId, params, "application/json", bodyReader) +} + +// NewSignSolanaTransactionWithEndUserAccountRequestWithBody generates requests for SignSolanaTransactionWithEndUserAccount with any type of body +func NewSignSolanaTransactionWithEndUserAccountRequestWithBody(server string, projectId string, userId string, params *SignSolanaTransactionWithEndUserAccountParams, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "delegationOperationId", runtime.ParamLocationPath, delegationOperationId) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "projectId", runtime.ParamLocationPath, projectId) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "userId", runtime.ParamLocationPath, userId) if err != nil { return nil, err } @@ -11727,7 +12558,7 @@ func NewGetEvmEip7702DelegationOperationByIdRequest(server string, delegationOpe return nil, err } - operationPath := fmt.Sprintf("/v2/evm/eip7702/delegation-operations/%s", pathParam0) + operationPath := fmt.Sprintf("/v2/embedded-wallet-api/projects/%s/end-users/%s/solana/sign/transaction", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -11737,35 +12568,102 @@ func NewGetEvmEip7702DelegationOperationByIdRequest(server string, delegationOpe return nil, err } - req, err := http.NewRequest("GET", queryURL.String(), nil) + req, err := http.NewRequest("POST", queryURL.String(), body) if err != nil { return nil, err } + req.Header.Add("Content-Type", contentType) + + if params != nil { + + if params.XWalletAuth != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Wallet-Auth", runtime.ParamLocationHeader, *params.XWalletAuth) + if err != nil { + return nil, err + } + + req.Header.Set("X-Wallet-Auth", headerParam0) + } + + if params.XIdempotencyKey != nil { + var headerParam1 string + + headerParam1, err = runtime.StyleParamWithLocation("simple", false, "X-Idempotency-Key", runtime.ParamLocationHeader, *params.XIdempotencyKey) + if err != nil { + return nil, err + } + + req.Header.Set("X-Idempotency-Key", headerParam1) + } + + if params.XDeveloperAuth != nil { + var headerParam2 string + + headerParam2, err = runtime.StyleParamWithLocation("simple", false, "X-Developer-Auth", runtime.ParamLocationHeader, *params.XDeveloperAuth) + if err != nil { + return nil, err + } + + req.Header.Set("X-Developer-Auth", headerParam2) + } + + } + return req, nil } -// NewRequestEvmFaucetRequest calls the generic RequestEvmFaucet builder with application/json body -func NewRequestEvmFaucetRequest(server string, body RequestEvmFaucetJSONRequestBody) (*http.Request, error) { +// NewSendSolanaAssetWithEndUserAccountRequest calls the generic SendSolanaAssetWithEndUserAccount builder with application/json body +func NewSendSolanaAssetWithEndUserAccountRequest(server string, projectId string, userId string, address BlockchainAddress, asset Asset, params *SendSolanaAssetWithEndUserAccountParams, body SendSolanaAssetWithEndUserAccountJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewRequestEvmFaucetRequestWithBody(server, "application/json", bodyReader) + return NewSendSolanaAssetWithEndUserAccountRequestWithBody(server, projectId, userId, address, asset, params, "application/json", bodyReader) } -// NewRequestEvmFaucetRequestWithBody generates requests for RequestEvmFaucet with any type of body -func NewRequestEvmFaucetRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { +// NewSendSolanaAssetWithEndUserAccountRequestWithBody generates requests for SendSolanaAssetWithEndUserAccount with any type of body +func NewSendSolanaAssetWithEndUserAccountRequestWithBody(server string, projectId string, userId string, address BlockchainAddress, asset Asset, params *SendSolanaAssetWithEndUserAccountParams, contentType string, body io.Reader) (*http.Request, error) { var err error + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "projectId", runtime.ParamLocationPath, projectId) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "userId", runtime.ParamLocationPath, userId) + if err != nil { + return nil, err + } + + var pathParam2 string + + pathParam2, err = runtime.StyleParamWithLocation("simple", false, "address", runtime.ParamLocationPath, address) + if err != nil { + return nil, err + } + + var pathParam3 string + + pathParam3, err = runtime.StyleParamWithLocation("simple", false, "asset", runtime.ParamLocationPath, asset) + if err != nil { + return nil, err + } + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/v2/evm/faucet") + operationPath := fmt.Sprintf("/v2/embedded-wallet-api/projects/%s/end-users/%s/solana/%s/send/%s", pathParam0, pathParam1, pathParam2, pathParam3) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -11782,11 +12680,48 @@ func NewRequestEvmFaucetRequestWithBody(server string, contentType string, body req.Header.Add("Content-Type", contentType) + if params != nil { + + if params.XWalletAuth != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Wallet-Auth", runtime.ParamLocationHeader, *params.XWalletAuth) + if err != nil { + return nil, err + } + + req.Header.Set("X-Wallet-Auth", headerParam0) + } + + if params.XIdempotencyKey != nil { + var headerParam1 string + + headerParam1, err = runtime.StyleParamWithLocation("simple", false, "X-Idempotency-Key", runtime.ParamLocationHeader, *params.XIdempotencyKey) + if err != nil { + return nil, err + } + + req.Header.Set("X-Idempotency-Key", headerParam1) + } + + if params.XDeveloperAuth != nil { + var headerParam2 string + + headerParam2, err = runtime.StyleParamWithLocation("simple", false, "X-Developer-Auth", runtime.ParamLocationHeader, *params.XDeveloperAuth) + if err != nil { + return nil, err + } + + req.Header.Set("X-Developer-Auth", headerParam2) + } + + } + return req, nil } -// NewListEvmSmartAccountsRequest generates requests for ListEvmSmartAccounts -func NewListEvmSmartAccountsRequest(server string, params *ListEvmSmartAccountsParams) (*http.Request, error) { +// NewListEndUsersRequest generates requests for ListEndUsers +func NewListEndUsersRequest(server string, params *ListEndUsersParams) (*http.Request, error) { var err error serverURL, err := url.Parse(server) @@ -11794,7 +12729,7 @@ func NewListEvmSmartAccountsRequest(server string, params *ListEvmSmartAccountsP return nil, err } - operationPath := fmt.Sprintf("/v2/evm/smart-accounts") + operationPath := fmt.Sprintf("/v2/end-users") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -11839,6 +12774,22 @@ func NewListEvmSmartAccountsRequest(server string, params *ListEvmSmartAccountsP } + if params.Sort != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", false, "sort", runtime.ParamLocationQuery, *params.Sort); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + queryURL.RawQuery = queryValues.Encode() } @@ -11850,19 +12801,19 @@ func NewListEvmSmartAccountsRequest(server string, params *ListEvmSmartAccountsP return req, nil } -// NewCreateEvmSmartAccountRequest calls the generic CreateEvmSmartAccount builder with application/json body -func NewCreateEvmSmartAccountRequest(server string, params *CreateEvmSmartAccountParams, body CreateEvmSmartAccountJSONRequestBody) (*http.Request, error) { +// NewCreateEndUserRequest calls the generic CreateEndUser builder with application/json body +func NewCreateEndUserRequest(server string, params *CreateEndUserParams, body CreateEndUserJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewCreateEvmSmartAccountRequestWithBody(server, params, "application/json", bodyReader) + return NewCreateEndUserRequestWithBody(server, params, "application/json", bodyReader) } -// NewCreateEvmSmartAccountRequestWithBody generates requests for CreateEvmSmartAccount with any type of body -func NewCreateEvmSmartAccountRequestWithBody(server string, params *CreateEvmSmartAccountParams, contentType string, body io.Reader) (*http.Request, error) { +// NewCreateEndUserRequestWithBody generates requests for CreateEndUser with any type of body +func NewCreateEndUserRequestWithBody(server string, params *CreateEndUserParams, contentType string, body io.Reader) (*http.Request, error) { var err error serverURL, err := url.Parse(server) @@ -11870,7 +12821,7 @@ func NewCreateEvmSmartAccountRequestWithBody(server string, params *CreateEvmSma return nil, err } - operationPath := fmt.Sprintf("/v2/evm/smart-accounts") + operationPath := fmt.Sprintf("/v2/end-users") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -11889,73 +12840,54 @@ func NewCreateEvmSmartAccountRequestWithBody(server string, params *CreateEvmSma if params != nil { - if params.XIdempotencyKey != nil { + if params.XWalletAuth != nil { var headerParam0 string - headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Idempotency-Key", runtime.ParamLocationHeader, *params.XIdempotencyKey) + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Wallet-Auth", runtime.ParamLocationHeader, *params.XWalletAuth) if err != nil { return nil, err } - req.Header.Set("X-Idempotency-Key", headerParam0) + req.Header.Set("X-Wallet-Auth", headerParam0) } - } - - return req, nil -} - -// NewGetEvmSmartAccountByNameRequest generates requests for GetEvmSmartAccountByName -func NewGetEvmSmartAccountByNameRequest(server string, name string) (*http.Request, error) { - var err error - - var pathParam0 string + if params.XIdempotencyKey != nil { + var headerParam1 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "name", runtime.ParamLocationPath, name) - if err != nil { - return nil, err - } + headerParam1, err = runtime.StyleParamWithLocation("simple", false, "X-Idempotency-Key", runtime.ParamLocationHeader, *params.XIdempotencyKey) + if err != nil { + return nil, err + } - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } + req.Header.Set("X-Idempotency-Key", headerParam1) + } - operationPath := fmt.Sprintf("/v2/evm/smart-accounts/by-name/%s", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath } - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } + return req, nil +} - req, err := http.NewRequest("GET", queryURL.String(), nil) +// NewValidateEndUserAccessTokenRequest calls the generic ValidateEndUserAccessToken builder with application/json body +func NewValidateEndUserAccessTokenRequest(server string, body ValidateEndUserAccessTokenJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) if err != nil { return nil, err } - - return req, nil + bodyReader = bytes.NewReader(buf) + return NewValidateEndUserAccessTokenRequestWithBody(server, "application/json", bodyReader) } -// NewGetEvmSmartAccountRequest generates requests for GetEvmSmartAccount -func NewGetEvmSmartAccountRequest(server string, address string) (*http.Request, error) { +// NewValidateEndUserAccessTokenRequestWithBody generates requests for ValidateEndUserAccessToken with any type of body +func NewValidateEndUserAccessTokenRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "address", runtime.ParamLocationPath, address) - if err != nil { - return nil, err - } - serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/v2/evm/smart-accounts/%s", pathParam0) + operationPath := fmt.Sprintf("/v2/end-users/auth/validate-token") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -11965,42 +12897,37 @@ func NewGetEvmSmartAccountRequest(server string, address string) (*http.Request, return nil, err } - req, err := http.NewRequest("GET", queryURL.String(), nil) + req, err := http.NewRequest("POST", queryURL.String(), body) if err != nil { return nil, err } + req.Header.Add("Content-Type", contentType) + return req, nil } -// NewUpdateEvmSmartAccountRequest calls the generic UpdateEvmSmartAccount builder with application/json body -func NewUpdateEvmSmartAccountRequest(server string, address string, body UpdateEvmSmartAccountJSONRequestBody) (*http.Request, error) { +// NewImportEndUserRequest calls the generic ImportEndUser builder with application/json body +func NewImportEndUserRequest(server string, params *ImportEndUserParams, body ImportEndUserJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewUpdateEvmSmartAccountRequestWithBody(server, address, "application/json", bodyReader) + return NewImportEndUserRequestWithBody(server, params, "application/json", bodyReader) } -// NewUpdateEvmSmartAccountRequestWithBody generates requests for UpdateEvmSmartAccount with any type of body -func NewUpdateEvmSmartAccountRequestWithBody(server string, address string, contentType string, body io.Reader) (*http.Request, error) { +// NewImportEndUserRequestWithBody generates requests for ImportEndUser with any type of body +func NewImportEndUserRequestWithBody(server string, params *ImportEndUserParams, contentType string, body io.Reader) (*http.Request, error) { var err error - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "address", runtime.ParamLocationPath, address) - if err != nil { - return nil, err - } - serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/v2/evm/smart-accounts/%s", pathParam0) + operationPath := fmt.Sprintf("/v2/end-users/import") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -12010,61 +12937,14 @@ func NewUpdateEvmSmartAccountRequestWithBody(server string, address string, cont return nil, err } - req, err := http.NewRequest("PUT", queryURL.String(), body) + req, err := http.NewRequest("POST", queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) - return req, nil -} - -// NewCreateSpendPermissionRequest calls the generic CreateSpendPermission builder with application/json body -func NewCreateSpendPermissionRequest(server string, address string, params *CreateSpendPermissionParams, body CreateSpendPermissionJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewCreateSpendPermissionRequestWithBody(server, address, params, "application/json", bodyReader) -} - -// NewCreateSpendPermissionRequestWithBody generates requests for CreateSpendPermission with any type of body -func NewCreateSpendPermissionRequestWithBody(server string, address string, params *CreateSpendPermissionParams, contentType string, body io.Reader) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "address", runtime.ParamLocationPath, address) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/v2/evm/smart-accounts/%s/spend-permissions", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - if params != nil { + if params != nil { if params.XWalletAuth != nil { var headerParam0 string @@ -12093,13 +12973,13 @@ func NewCreateSpendPermissionRequestWithBody(server string, address string, para return req, nil } -// NewListSpendPermissionsRequest generates requests for ListSpendPermissions -func NewListSpendPermissionsRequest(server string, address string, params *ListSpendPermissionsParams) (*http.Request, error) { +// NewGetEndUserRequest generates requests for GetEndUser +func NewGetEndUserRequest(server string, userId string) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "address", runtime.ParamLocationPath, address) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "userId", runtime.ParamLocationPath, userId) if err != nil { return nil, err } @@ -12109,7 +12989,7 @@ func NewListSpendPermissionsRequest(server string, address string, params *ListS return nil, err } - operationPath := fmt.Sprintf("/v2/evm/smart-accounts/%s/spend-permissions/list", pathParam0) + operationPath := fmt.Sprintf("/v2/end-users/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -12119,44 +12999,6 @@ func NewListSpendPermissionsRequest(server string, address string, params *ListS return nil, err } - if params != nil { - queryValues := queryURL.Query() - - if params.PageSize != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "pageSize", runtime.ParamLocationQuery, *params.PageSize); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.PageToken != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "pageToken", runtime.ParamLocationQuery, *params.PageToken); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - } - req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err @@ -12165,24 +13007,24 @@ func NewListSpendPermissionsRequest(server string, address string, params *ListS return req, nil } -// NewRevokeSpendPermissionRequest calls the generic RevokeSpendPermission builder with application/json body -func NewRevokeSpendPermissionRequest(server string, address string, params *RevokeSpendPermissionParams, body RevokeSpendPermissionJSONRequestBody) (*http.Request, error) { +// NewAddEndUserEvmAccountRequest calls the generic AddEndUserEvmAccount builder with application/json body +func NewAddEndUserEvmAccountRequest(server string, userId string, params *AddEndUserEvmAccountParams, body AddEndUserEvmAccountJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewRevokeSpendPermissionRequestWithBody(server, address, params, "application/json", bodyReader) + return NewAddEndUserEvmAccountRequestWithBody(server, userId, params, "application/json", bodyReader) } -// NewRevokeSpendPermissionRequestWithBody generates requests for RevokeSpendPermission with any type of body -func NewRevokeSpendPermissionRequestWithBody(server string, address string, params *RevokeSpendPermissionParams, contentType string, body io.Reader) (*http.Request, error) { +// NewAddEndUserEvmAccountRequestWithBody generates requests for AddEndUserEvmAccount with any type of body +func NewAddEndUserEvmAccountRequestWithBody(server string, userId string, params *AddEndUserEvmAccountParams, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "address", runtime.ParamLocationPath, address) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "userId", runtime.ParamLocationPath, userId) if err != nil { return nil, err } @@ -12192,7 +13034,7 @@ func NewRevokeSpendPermissionRequestWithBody(server string, address string, para return nil, err } - operationPath := fmt.Sprintf("/v2/evm/smart-accounts/%s/spend-permissions/revoke", pathParam0) + operationPath := fmt.Sprintf("/v2/end-users/%s/evm", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -12238,24 +13080,24 @@ func NewRevokeSpendPermissionRequestWithBody(server string, address string, para return req, nil } -// NewPrepareUserOperationRequest calls the generic PrepareUserOperation builder with application/json body -func NewPrepareUserOperationRequest(server string, address string, body PrepareUserOperationJSONRequestBody) (*http.Request, error) { +// NewAddEndUserEvmSmartAccountRequest calls the generic AddEndUserEvmSmartAccount builder with application/json body +func NewAddEndUserEvmSmartAccountRequest(server string, userId string, params *AddEndUserEvmSmartAccountParams, body AddEndUserEvmSmartAccountJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewPrepareUserOperationRequestWithBody(server, address, "application/json", bodyReader) + return NewAddEndUserEvmSmartAccountRequestWithBody(server, userId, params, "application/json", bodyReader) } -// NewPrepareUserOperationRequestWithBody generates requests for PrepareUserOperation with any type of body -func NewPrepareUserOperationRequestWithBody(server string, address string, contentType string, body io.Reader) (*http.Request, error) { +// NewAddEndUserEvmSmartAccountRequestWithBody generates requests for AddEndUserEvmSmartAccount with any type of body +func NewAddEndUserEvmSmartAccountRequestWithBody(server string, userId string, params *AddEndUserEvmSmartAccountParams, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "address", runtime.ParamLocationPath, address) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "userId", runtime.ParamLocationPath, userId) if err != nil { return nil, err } @@ -12265,7 +13107,7 @@ func NewPrepareUserOperationRequestWithBody(server string, address string, conte return nil, err } - operationPath := fmt.Sprintf("/v2/evm/smart-accounts/%s/user-operations", pathParam0) + operationPath := fmt.Sprintf("/v2/end-users/%s/evm-smart-account", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -12282,27 +13124,53 @@ func NewPrepareUserOperationRequestWithBody(server string, address string, conte req.Header.Add("Content-Type", contentType) + if params != nil { + + if params.XWalletAuth != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Wallet-Auth", runtime.ParamLocationHeader, *params.XWalletAuth) + if err != nil { + return nil, err + } + + req.Header.Set("X-Wallet-Auth", headerParam0) + } + + if params.XIdempotencyKey != nil { + var headerParam1 string + + headerParam1, err = runtime.StyleParamWithLocation("simple", false, "X-Idempotency-Key", runtime.ParamLocationHeader, *params.XIdempotencyKey) + if err != nil { + return nil, err + } + + req.Header.Set("X-Idempotency-Key", headerParam1) + } + + } + return req, nil } -// NewPrepareAndSendUserOperationRequest calls the generic PrepareAndSendUserOperation builder with application/json body -func NewPrepareAndSendUserOperationRequest(server string, address string, params *PrepareAndSendUserOperationParams, body PrepareAndSendUserOperationJSONRequestBody) (*http.Request, error) { +// NewAddEndUserSolanaAccountRequest calls the generic AddEndUserSolanaAccount builder with application/json body +func NewAddEndUserSolanaAccountRequest(server string, userId string, params *AddEndUserSolanaAccountParams, body AddEndUserSolanaAccountJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewPrepareAndSendUserOperationRequestWithBody(server, address, params, "application/json", bodyReader) + return NewAddEndUserSolanaAccountRequestWithBody(server, userId, params, "application/json", bodyReader) } -// NewPrepareAndSendUserOperationRequestWithBody generates requests for PrepareAndSendUserOperation with any type of body -func NewPrepareAndSendUserOperationRequestWithBody(server string, address string, params *PrepareAndSendUserOperationParams, contentType string, body io.Reader) (*http.Request, error) { +// NewAddEndUserSolanaAccountRequestWithBody generates requests for AddEndUserSolanaAccount with any type of body +func NewAddEndUserSolanaAccountRequestWithBody(server string, userId string, params *AddEndUserSolanaAccountParams, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "address", runtime.ParamLocationPath, address) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "userId", runtime.ParamLocationPath, userId) if err != nil { return nil, err } @@ -12312,7 +13180,7 @@ func NewPrepareAndSendUserOperationRequestWithBody(server string, address string return nil, err } - operationPath := fmt.Sprintf("/v2/evm/smart-accounts/%s/user-operations/prepare-and-send", pathParam0) + operationPath := fmt.Sprintf("/v2/end-users/%s/solana", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -12331,26 +13199,26 @@ func NewPrepareAndSendUserOperationRequestWithBody(server string, address string if params != nil { - if params.XIdempotencyKey != nil { + if params.XWalletAuth != nil { var headerParam0 string - headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Idempotency-Key", runtime.ParamLocationHeader, *params.XIdempotencyKey) + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Wallet-Auth", runtime.ParamLocationHeader, *params.XWalletAuth) if err != nil { return nil, err } - req.Header.Set("X-Idempotency-Key", headerParam0) + req.Header.Set("X-Wallet-Auth", headerParam0) } - if params.XWalletAuth != nil { + if params.XIdempotencyKey != nil { var headerParam1 string - headerParam1, err = runtime.StyleParamWithLocation("simple", false, "X-Wallet-Auth", runtime.ParamLocationHeader, *params.XWalletAuth) + headerParam1, err = runtime.StyleParamWithLocation("simple", false, "X-Idempotency-Key", runtime.ParamLocationHeader, *params.XIdempotencyKey) if err != nil { return nil, err } - req.Header.Set("X-Wallet-Auth", headerParam1) + req.Header.Set("X-Idempotency-Key", headerParam1) } } @@ -12358,30 +13226,16 @@ func NewPrepareAndSendUserOperationRequestWithBody(server string, address string return req, nil } -// NewGetUserOperationRequest generates requests for GetUserOperation -func NewGetUserOperationRequest(server string, address string, userOpHash string) (*http.Request, error) { +// NewListEvmAccountsRequest generates requests for ListEvmAccounts +func NewListEvmAccountsRequest(server string, params *ListEvmAccountsParams) (*http.Request, error) { var err error - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "address", runtime.ParamLocationPath, address) - if err != nil { - return nil, err - } - - var pathParam1 string - - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "userOpHash", runtime.ParamLocationPath, userOpHash) - if err != nil { - return nil, err - } - serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/v2/evm/smart-accounts/%s/user-operations/%s", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/v2/evm/accounts") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -12391,6 +13245,44 @@ func NewGetUserOperationRequest(server string, address string, userOpHash string return nil, err } + if params != nil { + queryValues := queryURL.Query() + + if params.PageSize != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "pageSize", runtime.ParamLocationQuery, *params.PageSize); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.PageToken != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "pageToken", runtime.ParamLocationQuery, *params.PageToken); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err @@ -12399,41 +13291,27 @@ func NewGetUserOperationRequest(server string, address string, userOpHash string return req, nil } -// NewSendUserOperationRequest calls the generic SendUserOperation builder with application/json body -func NewSendUserOperationRequest(server string, address string, userOpHash string, body SendUserOperationJSONRequestBody) (*http.Request, error) { +// NewCreateEvmAccountRequest calls the generic CreateEvmAccount builder with application/json body +func NewCreateEvmAccountRequest(server string, params *CreateEvmAccountParams, body CreateEvmAccountJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewSendUserOperationRequestWithBody(server, address, userOpHash, "application/json", bodyReader) + return NewCreateEvmAccountRequestWithBody(server, params, "application/json", bodyReader) } -// NewSendUserOperationRequestWithBody generates requests for SendUserOperation with any type of body -func NewSendUserOperationRequestWithBody(server string, address string, userOpHash string, contentType string, body io.Reader) (*http.Request, error) { +// NewCreateEvmAccountRequestWithBody generates requests for CreateEvmAccount with any type of body +func NewCreateEvmAccountRequestWithBody(server string, params *CreateEvmAccountParams, contentType string, body io.Reader) (*http.Request, error) { var err error - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "address", runtime.ParamLocationPath, address) - if err != nil { - return nil, err - } - - var pathParam1 string - - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "userOpHash", runtime.ParamLocationPath, userOpHash) - if err != nil { - return nil, err - } - serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/v2/evm/smart-accounts/%s/user-operations/%s/send", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/v2/evm/accounts") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -12450,30 +13328,97 @@ func NewSendUserOperationRequestWithBody(server string, address string, userOpHa req.Header.Add("Content-Type", contentType) - return req, nil -} + if params != nil { -// NewCreateEvmSwapQuoteRequest calls the generic CreateEvmSwapQuote builder with application/json body -func NewCreateEvmSwapQuoteRequest(server string, params *CreateEvmSwapQuoteParams, body CreateEvmSwapQuoteJSONRequestBody) (*http.Request, error) { + if params.XWalletAuth != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Wallet-Auth", runtime.ParamLocationHeader, *params.XWalletAuth) + if err != nil { + return nil, err + } + + req.Header.Set("X-Wallet-Auth", headerParam0) + } + + if params.XIdempotencyKey != nil { + var headerParam1 string + + headerParam1, err = runtime.StyleParamWithLocation("simple", false, "X-Idempotency-Key", runtime.ParamLocationHeader, *params.XIdempotencyKey) + if err != nil { + return nil, err + } + + req.Header.Set("X-Idempotency-Key", headerParam1) + } + + } + + return req, nil +} + +// NewGetEvmAccountByNameRequest generates requests for GetEvmAccountByName +func NewGetEvmAccountByNameRequest(server string, name string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "name", runtime.ParamLocationPath, name) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v2/evm/accounts/by-name/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewExportEvmAccountByNameRequest calls the generic ExportEvmAccountByName builder with application/json body +func NewExportEvmAccountByNameRequest(server string, name string, params *ExportEvmAccountByNameParams, body ExportEvmAccountByNameJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewCreateEvmSwapQuoteRequestWithBody(server, params, "application/json", bodyReader) + return NewExportEvmAccountByNameRequestWithBody(server, name, params, "application/json", bodyReader) } -// NewCreateEvmSwapQuoteRequestWithBody generates requests for CreateEvmSwapQuote with any type of body -func NewCreateEvmSwapQuoteRequestWithBody(server string, params *CreateEvmSwapQuoteParams, contentType string, body io.Reader) (*http.Request, error) { +// NewExportEvmAccountByNameRequestWithBody generates requests for ExportEvmAccountByName with any type of body +func NewExportEvmAccountByNameRequestWithBody(server string, name string, params *ExportEvmAccountByNameParams, contentType string, body io.Reader) (*http.Request, error) { var err error + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "name", runtime.ParamLocationPath, name) + if err != nil { + return nil, err + } + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/v2/evm/swaps") + operationPath := fmt.Sprintf("/v2/evm/accounts/export/by-name/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -12492,15 +13437,26 @@ func NewCreateEvmSwapQuoteRequestWithBody(server string, params *CreateEvmSwapQu if params != nil { - if params.XIdempotencyKey != nil { + if params.XWalletAuth != nil { var headerParam0 string - headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Idempotency-Key", runtime.ParamLocationHeader, *params.XIdempotencyKey) + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Wallet-Auth", runtime.ParamLocationHeader, *params.XWalletAuth) if err != nil { return nil, err } - req.Header.Set("X-Idempotency-Key", headerParam0) + req.Header.Set("X-Wallet-Auth", headerParam0) + } + + if params.XIdempotencyKey != nil { + var headerParam1 string + + headerParam1, err = runtime.StyleParamWithLocation("simple", false, "X-Idempotency-Key", runtime.ParamLocationHeader, *params.XIdempotencyKey) + if err != nil { + return nil, err + } + + req.Header.Set("X-Idempotency-Key", headerParam1) } } @@ -12508,8 +13464,19 @@ func NewCreateEvmSwapQuoteRequestWithBody(server string, params *CreateEvmSwapQu return req, nil } -// NewGetEvmSwapPriceRequest generates requests for GetEvmSwapPrice -func NewGetEvmSwapPriceRequest(server string, params *GetEvmSwapPriceParams) (*http.Request, error) { +// NewImportEvmAccountRequest calls the generic ImportEvmAccount builder with application/json body +func NewImportEvmAccountRequest(server string, params *ImportEvmAccountParams, body ImportEvmAccountJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewImportEvmAccountRequestWithBody(server, params, "application/json", bodyReader) +} + +// NewImportEvmAccountRequestWithBody generates requests for ImportEvmAccount with any type of body +func NewImportEvmAccountRequestWithBody(server string, params *ImportEvmAccountParams, contentType string, body io.Reader) (*http.Request, error) { var err error serverURL, err := url.Parse(server) @@ -12517,7 +13484,7 @@ func NewGetEvmSwapPriceRequest(server string, params *GetEvmSwapPriceParams) (*h return nil, err } - operationPath := fmt.Sprintf("/v2/evm/swaps/quote") + operationPath := fmt.Sprintf("/v2/evm/accounts/import") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -12527,142 +13494,49 @@ func NewGetEvmSwapPriceRequest(server string, params *GetEvmSwapPriceParams) (*h return nil, err } - if params != nil { - queryValues := queryURL.Query() - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "network", runtime.ParamLocationQuery, params.Network); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "toToken", runtime.ParamLocationQuery, params.ToToken); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "fromToken", runtime.ParamLocationQuery, params.FromToken); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "fromAmount", runtime.ParamLocationQuery, params.FromAmount); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "taker", runtime.ParamLocationQuery, params.Taker); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - if params.SignerAddress != nil { + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "signerAddress", runtime.ParamLocationQuery, *params.SignerAddress); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } + req.Header.Add("Content-Type", contentType) - } + if params != nil { - if params.GasPrice != nil { + if params.XWalletAuth != nil { + var headerParam0 string - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "gasPrice", runtime.ParamLocationQuery, *params.GasPrice); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Wallet-Auth", runtime.ParamLocationHeader, *params.XWalletAuth) + if err != nil { return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } } + req.Header.Set("X-Wallet-Auth", headerParam0) } - if params.SlippageBps != nil { + if params.XIdempotencyKey != nil { + var headerParam1 string - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "slippageBps", runtime.ParamLocationQuery, *params.SlippageBps); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + headerParam1, err = runtime.StyleParamWithLocation("simple", false, "X-Idempotency-Key", runtime.ParamLocationHeader, *params.XIdempotencyKey) + if err != nil { return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } } + req.Header.Set("X-Idempotency-Key", headerParam1) } - queryURL.RawQuery = queryValues.Encode() - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err } return req, nil } -// NewListEvmTokenBalancesRequest generates requests for ListEvmTokenBalances -func NewListEvmTokenBalancesRequest(server string, network ListEvmTokenBalancesNetwork, address string, params *ListEvmTokenBalancesParams) (*http.Request, error) { +// NewGetEvmAccountRequest generates requests for GetEvmAccount +func NewGetEvmAccountRequest(server string, address string) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "network", runtime.ParamLocationPath, network) - if err != nil { - return nil, err - } - - var pathParam1 string - - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "address", runtime.ParamLocationPath, address) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "address", runtime.ParamLocationPath, address) if err != nil { return nil, err } @@ -12672,7 +13546,7 @@ func NewListEvmTokenBalancesRequest(server string, network ListEvmTokenBalancesN return nil, err } - operationPath := fmt.Sprintf("/v2/evm/token-balances/%s/%s", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/v2/evm/accounts/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -12682,73 +13556,42 @@ func NewListEvmTokenBalancesRequest(server string, network ListEvmTokenBalancesN return nil, err } - if params != nil { - queryValues := queryURL.Query() - - if params.PageSize != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "pageSize", runtime.ParamLocationQuery, *params.PageSize); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.PageToken != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "pageToken", runtime.ParamLocationQuery, *params.PageToken); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } return req, nil } -// NewGetOnrampUserLimitsRequest calls the generic GetOnrampUserLimits builder with application/json body -func NewGetOnrampUserLimitsRequest(server string, body GetOnrampUserLimitsJSONRequestBody) (*http.Request, error) { +// NewUpdateEvmAccountRequest calls the generic UpdateEvmAccount builder with application/json body +func NewUpdateEvmAccountRequest(server string, address string, params *UpdateEvmAccountParams, body UpdateEvmAccountJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewGetOnrampUserLimitsRequestWithBody(server, "application/json", bodyReader) + return NewUpdateEvmAccountRequestWithBody(server, address, params, "application/json", bodyReader) } -// NewGetOnrampUserLimitsRequestWithBody generates requests for GetOnrampUserLimits with any type of body -func NewGetOnrampUserLimitsRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { +// NewUpdateEvmAccountRequestWithBody generates requests for UpdateEvmAccount with any type of body +func NewUpdateEvmAccountRequestWithBody(server string, address string, params *UpdateEvmAccountParams, contentType string, body io.Reader) (*http.Request, error) { var err error + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "address", runtime.ParamLocationPath, address) + if err != nil { + return nil, err + } + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/v2/onramp/limits") + operationPath := fmt.Sprintf("/v2/evm/accounts/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -12758,37 +13601,59 @@ func NewGetOnrampUserLimitsRequestWithBody(server string, contentType string, bo return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), body) + req, err := http.NewRequest("PUT", queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) + if params != nil { + + if params.XIdempotencyKey != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Idempotency-Key", runtime.ParamLocationHeader, *params.XIdempotencyKey) + if err != nil { + return nil, err + } + + req.Header.Set("X-Idempotency-Key", headerParam0) + } + + } + return req, nil } -// NewCreateOnrampOrderRequest calls the generic CreateOnrampOrder builder with application/json body -func NewCreateOnrampOrderRequest(server string, body CreateOnrampOrderJSONRequestBody) (*http.Request, error) { +// NewCreateEvmEip7702DelegationRequest calls the generic CreateEvmEip7702Delegation builder with application/json body +func NewCreateEvmEip7702DelegationRequest(server string, address string, params *CreateEvmEip7702DelegationParams, body CreateEvmEip7702DelegationJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewCreateOnrampOrderRequestWithBody(server, "application/json", bodyReader) + return NewCreateEvmEip7702DelegationRequestWithBody(server, address, params, "application/json", bodyReader) } -// NewCreateOnrampOrderRequestWithBody generates requests for CreateOnrampOrder with any type of body -func NewCreateOnrampOrderRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { +// NewCreateEvmEip7702DelegationRequestWithBody generates requests for CreateEvmEip7702Delegation with any type of body +func NewCreateEvmEip7702DelegationRequestWithBody(server string, address string, params *CreateEvmEip7702DelegationParams, contentType string, body io.Reader) (*http.Request, error) { var err error + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "address", runtime.ParamLocationPath, address) + if err != nil { + return nil, err + } + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/v2/onramp/orders") + operationPath := fmt.Sprintf("/v2/evm/accounts/%s/eip7702/delegation", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -12805,64 +13670,63 @@ func NewCreateOnrampOrderRequestWithBody(server string, contentType string, body req.Header.Add("Content-Type", contentType) - return req, nil -} + if params != nil { -// NewGetOnrampOrderByIdRequest generates requests for GetOnrampOrderById -func NewGetOnrampOrderByIdRequest(server string, orderId string) (*http.Request, error) { - var err error + if params.XWalletAuth != nil { + var headerParam0 string - var pathParam0 string + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Wallet-Auth", runtime.ParamLocationHeader, *params.XWalletAuth) + if err != nil { + return nil, err + } - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "orderId", runtime.ParamLocationPath, orderId) - if err != nil { - return nil, err - } + req.Header.Set("X-Wallet-Auth", headerParam0) + } - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } + if params.XIdempotencyKey != nil { + var headerParam1 string - operationPath := fmt.Sprintf("/v2/onramp/orders/%s", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } + headerParam1, err = runtime.StyleParamWithLocation("simple", false, "X-Idempotency-Key", runtime.ParamLocationHeader, *params.XIdempotencyKey) + if err != nil { + return nil, err + } - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } + req.Header.Set("X-Idempotency-Key", headerParam1) + } - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err } return req, nil } -// NewCreateOnrampSessionRequest calls the generic CreateOnrampSession builder with application/json body -func NewCreateOnrampSessionRequest(server string, body CreateOnrampSessionJSONRequestBody) (*http.Request, error) { +// NewExportEvmAccountRequest calls the generic ExportEvmAccount builder with application/json body +func NewExportEvmAccountRequest(server string, address string, params *ExportEvmAccountParams, body ExportEvmAccountJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewCreateOnrampSessionRequestWithBody(server, "application/json", bodyReader) + return NewExportEvmAccountRequestWithBody(server, address, params, "application/json", bodyReader) } -// NewCreateOnrampSessionRequestWithBody generates requests for CreateOnrampSession with any type of body -func NewCreateOnrampSessionRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { +// NewExportEvmAccountRequestWithBody generates requests for ExportEvmAccount with any type of body +func NewExportEvmAccountRequestWithBody(server string, address string, params *ExportEvmAccountParams, contentType string, body io.Reader) (*http.Request, error) { var err error + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "address", runtime.ParamLocationPath, address) + if err != nil { + return nil, err + } + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/v2/onramp/sessions") + operationPath := fmt.Sprintf("/v2/evm/accounts/%s/export", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -12879,111 +13743,63 @@ func NewCreateOnrampSessionRequestWithBody(server string, contentType string, bo req.Header.Add("Content-Type", contentType) - return req, nil -} - -// NewListPoliciesRequest generates requests for ListPolicies -func NewListPoliciesRequest(server string, params *ListPoliciesParams) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/v2/policy-engine/policies") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - if params != nil { - queryValues := queryURL.Query() - - if params.PageSize != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "pageSize", runtime.ParamLocationQuery, *params.PageSize); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - if params.PageToken != nil { + if params.XWalletAuth != nil { + var headerParam0 string - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "pageToken", runtime.ParamLocationQuery, *params.PageToken); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Wallet-Auth", runtime.ParamLocationHeader, *params.XWalletAuth) + if err != nil { return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } } + req.Header.Set("X-Wallet-Auth", headerParam0) } - if params.Scope != nil { + if params.XIdempotencyKey != nil { + var headerParam1 string - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "scope", runtime.ParamLocationQuery, *params.Scope); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + headerParam1, err = runtime.StyleParamWithLocation("simple", false, "X-Idempotency-Key", runtime.ParamLocationHeader, *params.XIdempotencyKey) + if err != nil { return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } } + req.Header.Set("X-Idempotency-Key", headerParam1) } - queryURL.RawQuery = queryValues.Encode() - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err } return req, nil } -// NewCreatePolicyRequest calls the generic CreatePolicy builder with application/json body -func NewCreatePolicyRequest(server string, params *CreatePolicyParams, body CreatePolicyJSONRequestBody) (*http.Request, error) { +// NewSendEvmTransactionRequest calls the generic SendEvmTransaction builder with application/json body +func NewSendEvmTransactionRequest(server string, address string, params *SendEvmTransactionParams, body SendEvmTransactionJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewCreatePolicyRequestWithBody(server, params, "application/json", bodyReader) + return NewSendEvmTransactionRequestWithBody(server, address, params, "application/json", bodyReader) } -// NewCreatePolicyRequestWithBody generates requests for CreatePolicy with any type of body -func NewCreatePolicyRequestWithBody(server string, params *CreatePolicyParams, contentType string, body io.Reader) (*http.Request, error) { +// NewSendEvmTransactionRequestWithBody generates requests for SendEvmTransaction with any type of body +func NewSendEvmTransactionRequestWithBody(server string, address string, params *SendEvmTransactionParams, contentType string, body io.Reader) (*http.Request, error) { var err error + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "address", runtime.ParamLocationPath, address) + if err != nil { + return nil, err + } + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/v2/policy-engine/policies") + operationPath := fmt.Sprintf("/v2/evm/accounts/%s/send/transaction", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -13002,29 +13818,51 @@ func NewCreatePolicyRequestWithBody(server string, params *CreatePolicyParams, c if params != nil { - if params.XIdempotencyKey != nil { + if params.XWalletAuth != nil { var headerParam0 string - headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Idempotency-Key", runtime.ParamLocationHeader, *params.XIdempotencyKey) + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Wallet-Auth", runtime.ParamLocationHeader, *params.XWalletAuth) if err != nil { return nil, err } - req.Header.Set("X-Idempotency-Key", headerParam0) + req.Header.Set("X-Wallet-Auth", headerParam0) } - } - + if params.XIdempotencyKey != nil { + var headerParam1 string + + headerParam1, err = runtime.StyleParamWithLocation("simple", false, "X-Idempotency-Key", runtime.ParamLocationHeader, *params.XIdempotencyKey) + if err != nil { + return nil, err + } + + req.Header.Set("X-Idempotency-Key", headerParam1) + } + + } + return req, nil } -// NewDeletePolicyRequest generates requests for DeletePolicy -func NewDeletePolicyRequest(server string, policyId string, params *DeletePolicyParams) (*http.Request, error) { +// NewSignEvmHashRequest calls the generic SignEvmHash builder with application/json body +func NewSignEvmHashRequest(server string, address string, params *SignEvmHashParams, body SignEvmHashJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewSignEvmHashRequestWithBody(server, address, params, "application/json", bodyReader) +} + +// NewSignEvmHashRequestWithBody generates requests for SignEvmHash with any type of body +func NewSignEvmHashRequestWithBody(server string, address string, params *SignEvmHashParams, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "policyId", runtime.ParamLocationPath, policyId) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "address", runtime.ParamLocationPath, address) if err != nil { return nil, err } @@ -13034,7 +13872,7 @@ func NewDeletePolicyRequest(server string, policyId string, params *DeletePolicy return nil, err } - operationPath := fmt.Sprintf("/v2/policy-engine/policies/%s", pathParam0) + operationPath := fmt.Sprintf("/v2/evm/accounts/%s/sign", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -13044,81 +13882,60 @@ func NewDeletePolicyRequest(server string, policyId string, params *DeletePolicy return nil, err } - req, err := http.NewRequest("DELETE", queryURL.String(), nil) + req, err := http.NewRequest("POST", queryURL.String(), body) if err != nil { return nil, err } + req.Header.Add("Content-Type", contentType) + if params != nil { - if params.XIdempotencyKey != nil { + if params.XWalletAuth != nil { var headerParam0 string - headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Idempotency-Key", runtime.ParamLocationHeader, *params.XIdempotencyKey) + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Wallet-Auth", runtime.ParamLocationHeader, *params.XWalletAuth) if err != nil { return nil, err } - req.Header.Set("X-Idempotency-Key", headerParam0) + req.Header.Set("X-Wallet-Auth", headerParam0) } - } - - return req, nil -} - -// NewGetPolicyByIdRequest generates requests for GetPolicyById -func NewGetPolicyByIdRequest(server string, policyId string) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "policyId", runtime.ParamLocationPath, policyId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } + if params.XIdempotencyKey != nil { + var headerParam1 string - operationPath := fmt.Sprintf("/v2/policy-engine/policies/%s", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } + headerParam1, err = runtime.StyleParamWithLocation("simple", false, "X-Idempotency-Key", runtime.ParamLocationHeader, *params.XIdempotencyKey) + if err != nil { + return nil, err + } - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } + req.Header.Set("X-Idempotency-Key", headerParam1) + } - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err } return req, nil } -// NewUpdatePolicyRequest calls the generic UpdatePolicy builder with application/json body -func NewUpdatePolicyRequest(server string, policyId string, params *UpdatePolicyParams, body UpdatePolicyJSONRequestBody) (*http.Request, error) { +// NewSignEvmMessageRequest calls the generic SignEvmMessage builder with application/json body +func NewSignEvmMessageRequest(server string, address string, params *SignEvmMessageParams, body SignEvmMessageJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewUpdatePolicyRequestWithBody(server, policyId, params, "application/json", bodyReader) + return NewSignEvmMessageRequestWithBody(server, address, params, "application/json", bodyReader) } -// NewUpdatePolicyRequestWithBody generates requests for UpdatePolicy with any type of body -func NewUpdatePolicyRequestWithBody(server string, policyId string, params *UpdatePolicyParams, contentType string, body io.Reader) (*http.Request, error) { +// NewSignEvmMessageRequestWithBody generates requests for SignEvmMessage with any type of body +func NewSignEvmMessageRequestWithBody(server string, address string, params *SignEvmMessageParams, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "policyId", runtime.ParamLocationPath, policyId) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "address", runtime.ParamLocationPath, address) if err != nil { return nil, err } @@ -13128,7 +13945,7 @@ func NewUpdatePolicyRequestWithBody(server string, policyId string, params *Upda return nil, err } - operationPath := fmt.Sprintf("/v2/policy-engine/policies/%s", pathParam0) + operationPath := fmt.Sprintf("/v2/evm/accounts/%s/sign/message", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -13138,7 +13955,7 @@ func NewUpdatePolicyRequestWithBody(server string, policyId string, params *Upda return nil, err } - req, err := http.NewRequest("PUT", queryURL.String(), body) + req, err := http.NewRequest("POST", queryURL.String(), body) if err != nil { return nil, err } @@ -13147,15 +13964,26 @@ func NewUpdatePolicyRequestWithBody(server string, policyId string, params *Upda if params != nil { - if params.XIdempotencyKey != nil { + if params.XWalletAuth != nil { var headerParam0 string - headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Idempotency-Key", runtime.ParamLocationHeader, *params.XIdempotencyKey) + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Wallet-Auth", runtime.ParamLocationHeader, *params.XWalletAuth) if err != nil { return nil, err } - req.Header.Set("X-Idempotency-Key", headerParam0) + req.Header.Set("X-Wallet-Auth", headerParam0) + } + + if params.XIdempotencyKey != nil { + var headerParam1 string + + headerParam1, err = runtime.StyleParamWithLocation("simple", false, "X-Idempotency-Key", runtime.ParamLocationHeader, *params.XIdempotencyKey) + if err != nil { + return nil, err + } + + req.Header.Set("X-Idempotency-Key", headerParam1) } } @@ -13163,16 +13991,34 @@ func NewUpdatePolicyRequestWithBody(server string, policyId string, params *Upda return req, nil } -// NewListSolanaAccountsRequest generates requests for ListSolanaAccounts -func NewListSolanaAccountsRequest(server string, params *ListSolanaAccountsParams) (*http.Request, error) { +// NewSignEvmTransactionRequest calls the generic SignEvmTransaction builder with application/json body +func NewSignEvmTransactionRequest(server string, address string, params *SignEvmTransactionParams, body SignEvmTransactionJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewSignEvmTransactionRequestWithBody(server, address, params, "application/json", bodyReader) +} + +// NewSignEvmTransactionRequestWithBody generates requests for SignEvmTransaction with any type of body +func NewSignEvmTransactionRequestWithBody(server string, address string, params *SignEvmTransactionParams, contentType string, body io.Reader) (*http.Request, error) { var err error + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "address", runtime.ParamLocationPath, address) + if err != nil { + return nil, err + } + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/v2/solana/accounts") + operationPath := fmt.Sprintf("/v2/evm/accounts/%s/sign/transaction", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -13182,73 +14028,70 @@ func NewListSolanaAccountsRequest(server string, params *ListSolanaAccountsParam return nil, err } + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + if params != nil { - queryValues := queryURL.Query() - if params.PageSize != nil { + if params.XWalletAuth != nil { + var headerParam0 string - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "pageSize", runtime.ParamLocationQuery, *params.PageSize); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Wallet-Auth", runtime.ParamLocationHeader, *params.XWalletAuth) + if err != nil { return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } } + req.Header.Set("X-Wallet-Auth", headerParam0) } - if params.PageToken != nil { + if params.XIdempotencyKey != nil { + var headerParam1 string - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "pageToken", runtime.ParamLocationQuery, *params.PageToken); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + headerParam1, err = runtime.StyleParamWithLocation("simple", false, "X-Idempotency-Key", runtime.ParamLocationHeader, *params.XIdempotencyKey) + if err != nil { return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } } + req.Header.Set("X-Idempotency-Key", headerParam1) } - queryURL.RawQuery = queryValues.Encode() - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err } return req, nil } -// NewCreateSolanaAccountRequest calls the generic CreateSolanaAccount builder with application/json body -func NewCreateSolanaAccountRequest(server string, params *CreateSolanaAccountParams, body CreateSolanaAccountJSONRequestBody) (*http.Request, error) { +// NewSignEvmTypedDataRequest calls the generic SignEvmTypedData builder with application/json body +func NewSignEvmTypedDataRequest(server string, address string, params *SignEvmTypedDataParams, body SignEvmTypedDataJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewCreateSolanaAccountRequestWithBody(server, params, "application/json", bodyReader) + return NewSignEvmTypedDataRequestWithBody(server, address, params, "application/json", bodyReader) } -// NewCreateSolanaAccountRequestWithBody generates requests for CreateSolanaAccount with any type of body -func NewCreateSolanaAccountRequestWithBody(server string, params *CreateSolanaAccountParams, contentType string, body io.Reader) (*http.Request, error) { +// NewSignEvmTypedDataRequestWithBody generates requests for SignEvmTypedData with any type of body +func NewSignEvmTypedDataRequestWithBody(server string, address string, params *SignEvmTypedDataParams, contentType string, body io.Reader) (*http.Request, error) { var err error + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "address", runtime.ParamLocationPath, address) + if err != nil { + return nil, err + } + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/v2/solana/accounts") + operationPath := fmt.Sprintf("/v2/evm/accounts/%s/sign/typed-data", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -13294,13 +14137,13 @@ func NewCreateSolanaAccountRequestWithBody(server string, params *CreateSolanaAc return req, nil } -// NewGetSolanaAccountByNameRequest generates requests for GetSolanaAccountByName -func NewGetSolanaAccountByNameRequest(server string, name string) (*http.Request, error) { +// NewGetEvmEip7702DelegationOperationByIdRequest generates requests for GetEvmEip7702DelegationOperationById +func NewGetEvmEip7702DelegationOperationByIdRequest(server string, delegationOperationId openapi_types.UUID) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "name", runtime.ParamLocationPath, name) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "delegationOperationId", runtime.ParamLocationPath, delegationOperationId) if err != nil { return nil, err } @@ -13310,7 +14153,7 @@ func NewGetSolanaAccountByNameRequest(server string, name string) (*http.Request return nil, err } - operationPath := fmt.Sprintf("/v2/solana/accounts/by-name/%s", pathParam0) + operationPath := fmt.Sprintf("/v2/evm/eip7702/delegation-operations/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -13328,34 +14171,27 @@ func NewGetSolanaAccountByNameRequest(server string, name string) (*http.Request return req, nil } -// NewExportSolanaAccountByNameRequest calls the generic ExportSolanaAccountByName builder with application/json body -func NewExportSolanaAccountByNameRequest(server string, name string, params *ExportSolanaAccountByNameParams, body ExportSolanaAccountByNameJSONRequestBody) (*http.Request, error) { +// NewRequestEvmFaucetRequest calls the generic RequestEvmFaucet builder with application/json body +func NewRequestEvmFaucetRequest(server string, body RequestEvmFaucetJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewExportSolanaAccountByNameRequestWithBody(server, name, params, "application/json", bodyReader) + return NewRequestEvmFaucetRequestWithBody(server, "application/json", bodyReader) } -// NewExportSolanaAccountByNameRequestWithBody generates requests for ExportSolanaAccountByName with any type of body -func NewExportSolanaAccountByNameRequestWithBody(server string, name string, params *ExportSolanaAccountByNameParams, contentType string, body io.Reader) (*http.Request, error) { +// NewRequestEvmFaucetRequestWithBody generates requests for RequestEvmFaucet with any type of body +func NewRequestEvmFaucetRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "name", runtime.ParamLocationPath, name) - if err != nil { - return nil, err - } - serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/v2/solana/accounts/export/by-name/%s", pathParam0) + operationPath := fmt.Sprintf("/v2/evm/faucet") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -13372,48 +14208,87 @@ func NewExportSolanaAccountByNameRequestWithBody(server string, name string, par req.Header.Add("Content-Type", contentType) - if params != nil { + return req, nil +} - if params.XWalletAuth != nil { - var headerParam0 string +// NewListEvmSmartAccountsRequest generates requests for ListEvmSmartAccounts +func NewListEvmSmartAccountsRequest(server string, params *ListEvmSmartAccountsParams) (*http.Request, error) { + var err error - headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Wallet-Auth", runtime.ParamLocationHeader, *params.XWalletAuth) - if err != nil { - return nil, err - } + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } - req.Header.Set("X-Wallet-Auth", headerParam0) - } + operationPath := fmt.Sprintf("/v2/evm/smart-accounts") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } - if params.XIdempotencyKey != nil { - var headerParam1 string + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } - headerParam1, err = runtime.StyleParamWithLocation("simple", false, "X-Idempotency-Key", runtime.ParamLocationHeader, *params.XIdempotencyKey) - if err != nil { + if params != nil { + queryValues := queryURL.Query() + + if params.PageSize != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "pageSize", runtime.ParamLocationQuery, *params.PageSize); err != nil { return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.PageToken != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "pageToken", runtime.ParamLocationQuery, *params.PageToken); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } } - req.Header.Set("X-Idempotency-Key", headerParam1) } + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err } return req, nil } -// NewImportSolanaAccountRequest calls the generic ImportSolanaAccount builder with application/json body -func NewImportSolanaAccountRequest(server string, params *ImportSolanaAccountParams, body ImportSolanaAccountJSONRequestBody) (*http.Request, error) { +// NewCreateEvmSmartAccountRequest calls the generic CreateEvmSmartAccount builder with application/json body +func NewCreateEvmSmartAccountRequest(server string, params *CreateEvmSmartAccountParams, body CreateEvmSmartAccountJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewImportSolanaAccountRequestWithBody(server, params, "application/json", bodyReader) + return NewCreateEvmSmartAccountRequestWithBody(server, params, "application/json", bodyReader) } -// NewImportSolanaAccountRequestWithBody generates requests for ImportSolanaAccount with any type of body -func NewImportSolanaAccountRequestWithBody(server string, params *ImportSolanaAccountParams, contentType string, body io.Reader) (*http.Request, error) { +// NewCreateEvmSmartAccountRequestWithBody generates requests for CreateEvmSmartAccount with any type of body +func NewCreateEvmSmartAccountRequestWithBody(server string, params *CreateEvmSmartAccountParams, contentType string, body io.Reader) (*http.Request, error) { var err error serverURL, err := url.Parse(server) @@ -13421,7 +14296,7 @@ func NewImportSolanaAccountRequestWithBody(server string, params *ImportSolanaAc return nil, err } - operationPath := fmt.Sprintf("/v2/solana/accounts/import") + operationPath := fmt.Sprintf("/v2/evm/smart-accounts") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -13440,26 +14315,15 @@ func NewImportSolanaAccountRequestWithBody(server string, params *ImportSolanaAc if params != nil { - if params.XWalletAuth != nil { - var headerParam0 string - - headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Wallet-Auth", runtime.ParamLocationHeader, *params.XWalletAuth) - if err != nil { - return nil, err - } - - req.Header.Set("X-Wallet-Auth", headerParam0) - } - if params.XIdempotencyKey != nil { - var headerParam1 string + var headerParam0 string - headerParam1, err = runtime.StyleParamWithLocation("simple", false, "X-Idempotency-Key", runtime.ParamLocationHeader, *params.XIdempotencyKey) + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Idempotency-Key", runtime.ParamLocationHeader, *params.XIdempotencyKey) if err != nil { return nil, err } - req.Header.Set("X-Idempotency-Key", headerParam1) + req.Header.Set("X-Idempotency-Key", headerParam0) } } @@ -13467,27 +14331,23 @@ func NewImportSolanaAccountRequestWithBody(server string, params *ImportSolanaAc return req, nil } -// NewSendSolanaTransactionRequest calls the generic SendSolanaTransaction builder with application/json body -func NewSendSolanaTransactionRequest(server string, params *SendSolanaTransactionParams, body SendSolanaTransactionJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) +// NewGetEvmSmartAccountByNameRequest generates requests for GetEvmSmartAccountByName +func NewGetEvmSmartAccountByNameRequest(server string, name string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "name", runtime.ParamLocationPath, name) if err != nil { return nil, err } - bodyReader = bytes.NewReader(buf) - return NewSendSolanaTransactionRequestWithBody(server, params, "application/json", bodyReader) -} - -// NewSendSolanaTransactionRequestWithBody generates requests for SendSolanaTransaction with any type of body -func NewSendSolanaTransactionRequestWithBody(server string, params *SendSolanaTransactionParams, contentType string, body io.Reader) (*http.Request, error) { - var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/v2/solana/accounts/send/transaction") + operationPath := fmt.Sprintf("/v2/evm/smart-accounts/by-name/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -13497,44 +14357,16 @@ func NewSendSolanaTransactionRequestWithBody(server string, params *SendSolanaTr return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), body) + req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } - req.Header.Add("Content-Type", contentType) - - if params != nil { - - if params.XWalletAuth != nil { - var headerParam0 string - - headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Wallet-Auth", runtime.ParamLocationHeader, *params.XWalletAuth) - if err != nil { - return nil, err - } - - req.Header.Set("X-Wallet-Auth", headerParam0) - } - - if params.XIdempotencyKey != nil { - var headerParam1 string - - headerParam1, err = runtime.StyleParamWithLocation("simple", false, "X-Idempotency-Key", runtime.ParamLocationHeader, *params.XIdempotencyKey) - if err != nil { - return nil, err - } - - req.Header.Set("X-Idempotency-Key", headerParam1) - } - - } - return req, nil } -// NewGetSolanaAccountRequest generates requests for GetSolanaAccount -func NewGetSolanaAccountRequest(server string, address string) (*http.Request, error) { +// NewGetEvmSmartAccountRequest generates requests for GetEvmSmartAccount +func NewGetEvmSmartAccountRequest(server string, address string) (*http.Request, error) { var err error var pathParam0 string @@ -13549,7 +14381,7 @@ func NewGetSolanaAccountRequest(server string, address string) (*http.Request, e return nil, err } - operationPath := fmt.Sprintf("/v2/solana/accounts/%s", pathParam0) + operationPath := fmt.Sprintf("/v2/evm/smart-accounts/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -13567,19 +14399,19 @@ func NewGetSolanaAccountRequest(server string, address string) (*http.Request, e return req, nil } -// NewUpdateSolanaAccountRequest calls the generic UpdateSolanaAccount builder with application/json body -func NewUpdateSolanaAccountRequest(server string, address string, params *UpdateSolanaAccountParams, body UpdateSolanaAccountJSONRequestBody) (*http.Request, error) { +// NewUpdateEvmSmartAccountRequest calls the generic UpdateEvmSmartAccount builder with application/json body +func NewUpdateEvmSmartAccountRequest(server string, address string, body UpdateEvmSmartAccountJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewUpdateSolanaAccountRequestWithBody(server, address, params, "application/json", bodyReader) + return NewUpdateEvmSmartAccountRequestWithBody(server, address, "application/json", bodyReader) } -// NewUpdateSolanaAccountRequestWithBody generates requests for UpdateSolanaAccount with any type of body -func NewUpdateSolanaAccountRequestWithBody(server string, address string, params *UpdateSolanaAccountParams, contentType string, body io.Reader) (*http.Request, error) { +// NewUpdateEvmSmartAccountRequestWithBody generates requests for UpdateEvmSmartAccount with any type of body +func NewUpdateEvmSmartAccountRequestWithBody(server string, address string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -13594,7 +14426,7 @@ func NewUpdateSolanaAccountRequestWithBody(server string, address string, params return nil, err } - operationPath := fmt.Sprintf("/v2/solana/accounts/%s", pathParam0) + operationPath := fmt.Sprintf("/v2/evm/smart-accounts/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -13611,37 +14443,22 @@ func NewUpdateSolanaAccountRequestWithBody(server string, address string, params req.Header.Add("Content-Type", contentType) - if params != nil { - - if params.XIdempotencyKey != nil { - var headerParam0 string - - headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Idempotency-Key", runtime.ParamLocationHeader, *params.XIdempotencyKey) - if err != nil { - return nil, err - } - - req.Header.Set("X-Idempotency-Key", headerParam0) - } - - } - return req, nil } -// NewExportSolanaAccountRequest calls the generic ExportSolanaAccount builder with application/json body -func NewExportSolanaAccountRequest(server string, address string, params *ExportSolanaAccountParams, body ExportSolanaAccountJSONRequestBody) (*http.Request, error) { +// NewCreateSpendPermissionRequest calls the generic CreateSpendPermission builder with application/json body +func NewCreateSpendPermissionRequest(server string, address string, params *CreateSpendPermissionParams, body CreateSpendPermissionJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewExportSolanaAccountRequestWithBody(server, address, params, "application/json", bodyReader) + return NewCreateSpendPermissionRequestWithBody(server, address, params, "application/json", bodyReader) } -// NewExportSolanaAccountRequestWithBody generates requests for ExportSolanaAccount with any type of body -func NewExportSolanaAccountRequestWithBody(server string, address string, params *ExportSolanaAccountParams, contentType string, body io.Reader) (*http.Request, error) { +// NewCreateSpendPermissionRequestWithBody generates requests for CreateSpendPermission with any type of body +func NewCreateSpendPermissionRequestWithBody(server string, address string, params *CreateSpendPermissionParams, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -13656,7 +14473,7 @@ func NewExportSolanaAccountRequestWithBody(server string, address string, params return nil, err } - operationPath := fmt.Sprintf("/v2/solana/accounts/%s/export", pathParam0) + operationPath := fmt.Sprintf("/v2/evm/smart-accounts/%s/spend-permissions", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -13702,19 +14519,8 @@ func NewExportSolanaAccountRequestWithBody(server string, address string, params return req, nil } -// NewSignSolanaMessageRequest calls the generic SignSolanaMessage builder with application/json body -func NewSignSolanaMessageRequest(server string, address string, params *SignSolanaMessageParams, body SignSolanaMessageJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewSignSolanaMessageRequestWithBody(server, address, params, "application/json", bodyReader) -} - -// NewSignSolanaMessageRequestWithBody generates requests for SignSolanaMessage with any type of body -func NewSignSolanaMessageRequestWithBody(server string, address string, params *SignSolanaMessageParams, contentType string, body io.Reader) (*http.Request, error) { +// NewListSpendPermissionsRequest generates requests for ListSpendPermissions +func NewListSpendPermissionsRequest(server string, address string, params *ListSpendPermissionsParams) (*http.Request, error) { var err error var pathParam0 string @@ -13729,7 +14535,7 @@ func NewSignSolanaMessageRequestWithBody(server string, address string, params * return nil, err } - operationPath := fmt.Sprintf("/v2/solana/accounts/%s/sign/message", pathParam0) + operationPath := fmt.Sprintf("/v2/evm/smart-accounts/%s/spend-permissions/list", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -13739,55 +14545,65 @@ func NewSignSolanaMessageRequestWithBody(server string, address string, params * return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - if params != nil { + queryValues := queryURL.Query() - if params.XWalletAuth != nil { - var headerParam0 string + if params.PageSize != nil { - headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Wallet-Auth", runtime.ParamLocationHeader, *params.XWalletAuth) - if err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "pageSize", runtime.ParamLocationQuery, *params.PageSize); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } } - req.Header.Set("X-Wallet-Auth", headerParam0) } - if params.XIdempotencyKey != nil { - var headerParam1 string + if params.PageToken != nil { - headerParam1, err = runtime.StyleParamWithLocation("simple", false, "X-Idempotency-Key", runtime.ParamLocationHeader, *params.XIdempotencyKey) - if err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "pageToken", runtime.ParamLocationQuery, *params.PageToken); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } } - req.Header.Set("X-Idempotency-Key", headerParam1) } + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err } return req, nil } -// NewSignSolanaTransactionRequest calls the generic SignSolanaTransaction builder with application/json body -func NewSignSolanaTransactionRequest(server string, address string, params *SignSolanaTransactionParams, body SignSolanaTransactionJSONRequestBody) (*http.Request, error) { +// NewRevokeSpendPermissionRequest calls the generic RevokeSpendPermission builder with application/json body +func NewRevokeSpendPermissionRequest(server string, address string, params *RevokeSpendPermissionParams, body RevokeSpendPermissionJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewSignSolanaTransactionRequestWithBody(server, address, params, "application/json", bodyReader) + return NewRevokeSpendPermissionRequestWithBody(server, address, params, "application/json", bodyReader) } -// NewSignSolanaTransactionRequestWithBody generates requests for SignSolanaTransaction with any type of body -func NewSignSolanaTransactionRequestWithBody(server string, address string, params *SignSolanaTransactionParams, contentType string, body io.Reader) (*http.Request, error) { +// NewRevokeSpendPermissionRequestWithBody generates requests for RevokeSpendPermission with any type of body +func NewRevokeSpendPermissionRequestWithBody(server string, address string, params *RevokeSpendPermissionParams, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -13802,7 +14618,7 @@ func NewSignSolanaTransactionRequestWithBody(server string, address string, para return nil, err } - operationPath := fmt.Sprintf("/v2/solana/accounts/%s/sign/transaction", pathParam0) + operationPath := fmt.Sprintf("/v2/evm/smart-accounts/%s/spend-permissions/revoke", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -13848,27 +14664,34 @@ func NewSignSolanaTransactionRequestWithBody(server string, address string, para return req, nil } -// NewRequestSolanaFaucetRequest calls the generic RequestSolanaFaucet builder with application/json body -func NewRequestSolanaFaucetRequest(server string, body RequestSolanaFaucetJSONRequestBody) (*http.Request, error) { +// NewPrepareUserOperationRequest calls the generic PrepareUserOperation builder with application/json body +func NewPrepareUserOperationRequest(server string, address string, body PrepareUserOperationJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewRequestSolanaFaucetRequestWithBody(server, "application/json", bodyReader) + return NewPrepareUserOperationRequestWithBody(server, address, "application/json", bodyReader) } -// NewRequestSolanaFaucetRequestWithBody generates requests for RequestSolanaFaucet with any type of body -func NewRequestSolanaFaucetRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { +// NewPrepareUserOperationRequestWithBody generates requests for PrepareUserOperation with any type of body +func NewPrepareUserOperationRequestWithBody(server string, address string, contentType string, body io.Reader) (*http.Request, error) { var err error + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "address", runtime.ParamLocationPath, address) + if err != nil { + return nil, err + } + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/v2/solana/faucet") + operationPath := fmt.Sprintf("/v2/evm/smart-accounts/%s/user-operations", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -13888,20 +14711,24 @@ func NewRequestSolanaFaucetRequestWithBody(server string, contentType string, bo return req, nil } -// NewListSolanaTokenBalancesRequest generates requests for ListSolanaTokenBalances -func NewListSolanaTokenBalancesRequest(server string, network ListSolanaTokenBalancesNetwork, address string, params *ListSolanaTokenBalancesParams) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "network", runtime.ParamLocationPath, network) +// NewPrepareAndSendUserOperationRequest calls the generic PrepareAndSendUserOperation builder with application/json body +func NewPrepareAndSendUserOperationRequest(server string, address string, params *PrepareAndSendUserOperationParams, body PrepareAndSendUserOperationJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) if err != nil { return nil, err } + bodyReader = bytes.NewReader(buf) + return NewPrepareAndSendUserOperationRequestWithBody(server, address, params, "application/json", bodyReader) +} - var pathParam1 string +// NewPrepareAndSendUserOperationRequestWithBody generates requests for PrepareAndSendUserOperation with any type of body +func NewPrepareAndSendUserOperationRequestWithBody(server string, address string, params *PrepareAndSendUserOperationParams, contentType string, body io.Reader) (*http.Request, error) { + var err error - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "address", runtime.ParamLocationPath, address) + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "address", runtime.ParamLocationPath, address) if err != nil { return nil, err } @@ -13911,7 +14738,7 @@ func NewListSolanaTokenBalancesRequest(server string, network ListSolanaTokenBal return nil, err } - operationPath := fmt.Sprintf("/v2/solana/token-balances/%s/%s", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/v2/evm/smart-accounts/%s/user-operations/prepare-and-send", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -13921,73 +14748,66 @@ func NewListSolanaTokenBalancesRequest(server string, network ListSolanaTokenBal return nil, err } + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + if params != nil { - queryValues := queryURL.Query() - if params.PageSize != nil { + if params.XIdempotencyKey != nil { + var headerParam0 string - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "pageSize", runtime.ParamLocationQuery, *params.PageSize); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Idempotency-Key", runtime.ParamLocationHeader, *params.XIdempotencyKey) + if err != nil { return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } } + req.Header.Set("X-Idempotency-Key", headerParam0) } - if params.PageToken != nil { + if params.XWalletAuth != nil { + var headerParam1 string - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "pageToken", runtime.ParamLocationQuery, *params.PageToken); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + headerParam1, err = runtime.StyleParamWithLocation("simple", false, "X-Wallet-Auth", runtime.ParamLocationHeader, *params.XWalletAuth) + if err != nil { return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } } + req.Header.Set("X-Wallet-Auth", headerParam1) } - queryURL.RawQuery = queryValues.Encode() } - req, err := http.NewRequest("GET", queryURL.String(), nil) + return req, nil +} + +// NewGetUserOperationRequest generates requests for GetUserOperation +func NewGetUserOperationRequest(server string, address string, userOpHash string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "address", runtime.ParamLocationPath, address) if err != nil { return nil, err } - return req, nil -} + var pathParam1 string -// NewSettleX402PaymentRequest calls the generic SettleX402Payment builder with application/json body -func NewSettleX402PaymentRequest(server string, body SettleX402PaymentJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "userOpHash", runtime.ParamLocationPath, userOpHash) if err != nil { return nil, err } - bodyReader = bytes.NewReader(buf) - return NewSettleX402PaymentRequestWithBody(server, "application/json", bodyReader) -} - -// NewSettleX402PaymentRequestWithBody generates requests for SettleX402Payment with any type of body -func NewSettleX402PaymentRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/v2/x402/settle") + operationPath := fmt.Sprintf("/v2/evm/smart-accounts/%s/user-operations/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -13997,26 +14817,49 @@ func NewSettleX402PaymentRequestWithBody(server string, contentType string, body return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), body) + req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } - req.Header.Add("Content-Type", contentType) - return req, nil } -// NewSupportedX402PaymentKindsRequest generates requests for SupportedX402PaymentKinds -func NewSupportedX402PaymentKindsRequest(server string) (*http.Request, error) { +// NewSendUserOperationRequest calls the generic SendUserOperation builder with application/json body +func NewSendUserOperationRequest(server string, address string, userOpHash string, body SendUserOperationJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewSendUserOperationRequestWithBody(server, address, userOpHash, "application/json", bodyReader) +} + +// NewSendUserOperationRequestWithBody generates requests for SendUserOperation with any type of body +func NewSendUserOperationRequestWithBody(server string, address string, userOpHash string, contentType string, body io.Reader) (*http.Request, error) { var err error + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "address", runtime.ParamLocationPath, address) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "userOpHash", runtime.ParamLocationPath, userOpHash) + if err != nil { + return nil, err + } + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/v2/x402/supported") + operationPath := fmt.Sprintf("/v2/evm/smart-accounts/%s/user-operations/%s/send", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -14026,27 +14869,29 @@ func NewSupportedX402PaymentKindsRequest(server string) (*http.Request, error) { return nil, err } - req, err := http.NewRequest("GET", queryURL.String(), nil) + req, err := http.NewRequest("POST", queryURL.String(), body) if err != nil { return nil, err } + req.Header.Add("Content-Type", contentType) + return req, nil } -// NewVerifyX402PaymentRequest calls the generic VerifyX402Payment builder with application/json body -func NewVerifyX402PaymentRequest(server string, body VerifyX402PaymentJSONRequestBody) (*http.Request, error) { +// NewCreateEvmSwapQuoteRequest calls the generic CreateEvmSwapQuote builder with application/json body +func NewCreateEvmSwapQuoteRequest(server string, params *CreateEvmSwapQuoteParams, body CreateEvmSwapQuoteJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewVerifyX402PaymentRequestWithBody(server, "application/json", bodyReader) + return NewCreateEvmSwapQuoteRequestWithBody(server, params, "application/json", bodyReader) } -// NewVerifyX402PaymentRequestWithBody generates requests for VerifyX402Payment with any type of body -func NewVerifyX402PaymentRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { +// NewCreateEvmSwapQuoteRequestWithBody generates requests for CreateEvmSwapQuote with any type of body +func NewCreateEvmSwapQuoteRequestWithBody(server string, params *CreateEvmSwapQuoteParams, contentType string, body io.Reader) (*http.Request, error) { var err error serverURL, err := url.Parse(server) @@ -14054,7 +14899,7 @@ func NewVerifyX402PaymentRequestWithBody(server string, contentType string, body return nil, err } - operationPath := fmt.Sprintf("/v2/x402/verify") + operationPath := fmt.Sprintf("/v2/evm/swaps") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -14071,3568 +14916,7110 @@ func NewVerifyX402PaymentRequestWithBody(server string, contentType string, body req.Header.Add("Content-Type", contentType) - return req, nil -} + if params != nil { -func (c *CDPClient) applyEditors(ctx context.Context, req *http.Request, additionalEditors []RequestEditorFn) error { - for _, r := range c.RequestEditors { - if err := r(ctx, req); err != nil { - return err - } - } - for _, r := range additionalEditors { - if err := r(ctx, req); err != nil { - return err + if params.XIdempotencyKey != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Idempotency-Key", runtime.ParamLocationHeader, *params.XIdempotencyKey) + if err != nil { + return nil, err + } + + req.Header.Set("X-Idempotency-Key", headerParam0) } + } - return nil -} -// ClientWithResponses builds on ClientInterface to offer response payloads -type ClientWithResponses struct { - ClientInterface + return req, nil } -// NewClientWithResponses creates a new ClientWithResponses, which wraps -// Client with return type handling -func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error) { - client, err := NewClient(server, opts...) +// NewGetEvmSwapPriceRequest generates requests for GetEvmSwapPrice +func NewGetEvmSwapPriceRequest(server string, params *GetEvmSwapPriceParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) if err != nil { return nil, err } - return &ClientWithResponses{client}, nil -} -// WithBaseURL overrides the baseURL. -func WithBaseURL(baseURL string) ClientOption { - return func(c *CDPClient) error { - newBaseURL, err := url.Parse(baseURL) - if err != nil { - return err - } - c.Server = newBaseURL.String() - return nil + operationPath := fmt.Sprintf("/v2/evm/swaps/quote") + if operationPath[0] == '/' { + operationPath = "." + operationPath } -} -// ClientWithResponsesInterface is the interface specification for the client with responses above. -type ClientWithResponsesInterface interface { - // ListDataTokenBalancesWithResponse request - ListDataTokenBalancesWithResponse(ctx context.Context, network ListEvmTokenBalancesNetwork, address string, params *ListDataTokenBalancesParams, reqEditors ...RequestEditorFn) (*ListDataTokenBalancesResponse, error) + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } - // ListTokensForAccountWithResponse request - ListTokensForAccountWithResponse(ctx context.Context, network ListTokensForAccountParamsNetwork, address string, reqEditors ...RequestEditorFn) (*ListTokensForAccountResponse, error) + if params != nil { + queryValues := queryURL.Query() - // GetSQLGrammarWithResponse request - GetSQLGrammarWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetSQLGrammarResponse, error) + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "network", runtime.ParamLocationQuery, params.Network); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } - // RunSQLQueryWithBodyWithResponse request with any body - RunSQLQueryWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RunSQLQueryResponse, error) + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "toToken", runtime.ParamLocationQuery, params.ToToken); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } - RunSQLQueryWithResponse(ctx context.Context, body RunSQLQueryJSONRequestBody, reqEditors ...RequestEditorFn) (*RunSQLQueryResponse, error) + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "fromToken", runtime.ParamLocationQuery, params.FromToken); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } - // ListWebhookSubscriptionsWithResponse request - ListWebhookSubscriptionsWithResponse(ctx context.Context, params *ListWebhookSubscriptionsParams, reqEditors ...RequestEditorFn) (*ListWebhookSubscriptionsResponse, error) + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "fromAmount", runtime.ParamLocationQuery, params.FromAmount); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } - // CreateWebhookSubscriptionWithBodyWithResponse request with any body - CreateWebhookSubscriptionWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateWebhookSubscriptionResponse, error) + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "taker", runtime.ParamLocationQuery, params.Taker); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } - CreateWebhookSubscriptionWithResponse(ctx context.Context, body CreateWebhookSubscriptionJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateWebhookSubscriptionResponse, error) + if params.SignerAddress != nil { - // DeleteWebhookSubscriptionWithResponse request - DeleteWebhookSubscriptionWithResponse(ctx context.Context, subscriptionId openapi_types.UUID, reqEditors ...RequestEditorFn) (*DeleteWebhookSubscriptionResponse, error) + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "signerAddress", runtime.ParamLocationQuery, *params.SignerAddress); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } - // GetWebhookSubscriptionWithResponse request - GetWebhookSubscriptionWithResponse(ctx context.Context, subscriptionId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetWebhookSubscriptionResponse, error) + } - // UpdateWebhookSubscriptionWithBodyWithResponse request with any body - UpdateWebhookSubscriptionWithBodyWithResponse(ctx context.Context, subscriptionId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateWebhookSubscriptionResponse, error) + if params.GasPrice != nil { - UpdateWebhookSubscriptionWithResponse(ctx context.Context, subscriptionId openapi_types.UUID, body UpdateWebhookSubscriptionJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateWebhookSubscriptionResponse, error) + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "gasPrice", runtime.ParamLocationQuery, *params.GasPrice); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } - // ListEndUsersWithResponse request - ListEndUsersWithResponse(ctx context.Context, params *ListEndUsersParams, reqEditors ...RequestEditorFn) (*ListEndUsersResponse, error) + } - // CreateEndUserWithBodyWithResponse request with any body - CreateEndUserWithBodyWithResponse(ctx context.Context, params *CreateEndUserParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateEndUserResponse, error) + if params.SlippageBps != nil { - CreateEndUserWithResponse(ctx context.Context, params *CreateEndUserParams, body CreateEndUserJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateEndUserResponse, error) + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "slippageBps", runtime.ParamLocationQuery, *params.SlippageBps); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } - // ValidateEndUserAccessTokenWithBodyWithResponse request with any body - ValidateEndUserAccessTokenWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ValidateEndUserAccessTokenResponse, error) + } - ValidateEndUserAccessTokenWithResponse(ctx context.Context, body ValidateEndUserAccessTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*ValidateEndUserAccessTokenResponse, error) + queryURL.RawQuery = queryValues.Encode() + } - // ImportEndUserWithBodyWithResponse request with any body - ImportEndUserWithBodyWithResponse(ctx context.Context, params *ImportEndUserParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ImportEndUserResponse, error) + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } - ImportEndUserWithResponse(ctx context.Context, params *ImportEndUserParams, body ImportEndUserJSONRequestBody, reqEditors ...RequestEditorFn) (*ImportEndUserResponse, error) + return req, nil +} - // GetEndUserWithResponse request - GetEndUserWithResponse(ctx context.Context, userId string, reqEditors ...RequestEditorFn) (*GetEndUserResponse, error) +// NewListEvmTokenBalancesRequest generates requests for ListEvmTokenBalances +func NewListEvmTokenBalancesRequest(server string, network ListEvmTokenBalancesNetwork, address string, params *ListEvmTokenBalancesParams) (*http.Request, error) { + var err error - // AddEndUserEvmAccountWithBodyWithResponse request with any body - AddEndUserEvmAccountWithBodyWithResponse(ctx context.Context, userId string, params *AddEndUserEvmAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AddEndUserEvmAccountResponse, error) + var pathParam0 string - AddEndUserEvmAccountWithResponse(ctx context.Context, userId string, params *AddEndUserEvmAccountParams, body AddEndUserEvmAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*AddEndUserEvmAccountResponse, error) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "network", runtime.ParamLocationPath, network) + if err != nil { + return nil, err + } - // AddEndUserEvmSmartAccountWithBodyWithResponse request with any body - AddEndUserEvmSmartAccountWithBodyWithResponse(ctx context.Context, userId string, params *AddEndUserEvmSmartAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AddEndUserEvmSmartAccountResponse, error) + var pathParam1 string - AddEndUserEvmSmartAccountWithResponse(ctx context.Context, userId string, params *AddEndUserEvmSmartAccountParams, body AddEndUserEvmSmartAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*AddEndUserEvmSmartAccountResponse, error) + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "address", runtime.ParamLocationPath, address) + if err != nil { + return nil, err + } - // AddEndUserSolanaAccountWithBodyWithResponse request with any body - AddEndUserSolanaAccountWithBodyWithResponse(ctx context.Context, userId string, params *AddEndUserSolanaAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AddEndUserSolanaAccountResponse, error) + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } - AddEndUserSolanaAccountWithResponse(ctx context.Context, userId string, params *AddEndUserSolanaAccountParams, body AddEndUserSolanaAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*AddEndUserSolanaAccountResponse, error) + operationPath := fmt.Sprintf("/v2/evm/token-balances/%s/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } - // ListEvmAccountsWithResponse request - ListEvmAccountsWithResponse(ctx context.Context, params *ListEvmAccountsParams, reqEditors ...RequestEditorFn) (*ListEvmAccountsResponse, error) + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } - // CreateEvmAccountWithBodyWithResponse request with any body - CreateEvmAccountWithBodyWithResponse(ctx context.Context, params *CreateEvmAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateEvmAccountResponse, error) + if params != nil { + queryValues := queryURL.Query() - CreateEvmAccountWithResponse(ctx context.Context, params *CreateEvmAccountParams, body CreateEvmAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateEvmAccountResponse, error) + if params.PageSize != nil { - // GetEvmAccountByNameWithResponse request - GetEvmAccountByNameWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*GetEvmAccountByNameResponse, error) + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "pageSize", runtime.ParamLocationQuery, *params.PageSize); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } - // ExportEvmAccountByNameWithBodyWithResponse request with any body - ExportEvmAccountByNameWithBodyWithResponse(ctx context.Context, name string, params *ExportEvmAccountByNameParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ExportEvmAccountByNameResponse, error) + } - ExportEvmAccountByNameWithResponse(ctx context.Context, name string, params *ExportEvmAccountByNameParams, body ExportEvmAccountByNameJSONRequestBody, reqEditors ...RequestEditorFn) (*ExportEvmAccountByNameResponse, error) + if params.PageToken != nil { - // ImportEvmAccountWithBodyWithResponse request with any body - ImportEvmAccountWithBodyWithResponse(ctx context.Context, params *ImportEvmAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ImportEvmAccountResponse, error) + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "pageToken", runtime.ParamLocationQuery, *params.PageToken); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } - ImportEvmAccountWithResponse(ctx context.Context, params *ImportEvmAccountParams, body ImportEvmAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*ImportEvmAccountResponse, error) + } - // GetEvmAccountWithResponse request - GetEvmAccountWithResponse(ctx context.Context, address string, reqEditors ...RequestEditorFn) (*GetEvmAccountResponse, error) + queryURL.RawQuery = queryValues.Encode() + } - // UpdateEvmAccountWithBodyWithResponse request with any body - UpdateEvmAccountWithBodyWithResponse(ctx context.Context, address string, params *UpdateEvmAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateEvmAccountResponse, error) + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } - UpdateEvmAccountWithResponse(ctx context.Context, address string, params *UpdateEvmAccountParams, body UpdateEvmAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateEvmAccountResponse, error) + return req, nil +} - // CreateEvmEip7702DelegationWithBodyWithResponse request with any body - CreateEvmEip7702DelegationWithBodyWithResponse(ctx context.Context, address string, params *CreateEvmEip7702DelegationParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateEvmEip7702DelegationResponse, error) +// NewGetOnrampUserLimitsRequest calls the generic GetOnrampUserLimits builder with application/json body +func NewGetOnrampUserLimitsRequest(server string, body GetOnrampUserLimitsJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewGetOnrampUserLimitsRequestWithBody(server, "application/json", bodyReader) +} - CreateEvmEip7702DelegationWithResponse(ctx context.Context, address string, params *CreateEvmEip7702DelegationParams, body CreateEvmEip7702DelegationJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateEvmEip7702DelegationResponse, error) +// NewGetOnrampUserLimitsRequestWithBody generates requests for GetOnrampUserLimits with any type of body +func NewGetOnrampUserLimitsRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error - // ExportEvmAccountWithBodyWithResponse request with any body - ExportEvmAccountWithBodyWithResponse(ctx context.Context, address string, params *ExportEvmAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ExportEvmAccountResponse, error) + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } - ExportEvmAccountWithResponse(ctx context.Context, address string, params *ExportEvmAccountParams, body ExportEvmAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*ExportEvmAccountResponse, error) + operationPath := fmt.Sprintf("/v2/onramp/limits") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } - // SendEvmTransactionWithBodyWithResponse request with any body - SendEvmTransactionWithBodyWithResponse(ctx context.Context, address string, params *SendEvmTransactionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SendEvmTransactionResponse, error) + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } - SendEvmTransactionWithResponse(ctx context.Context, address string, params *SendEvmTransactionParams, body SendEvmTransactionJSONRequestBody, reqEditors ...RequestEditorFn) (*SendEvmTransactionResponse, error) + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } - // SignEvmHashWithBodyWithResponse request with any body - SignEvmHashWithBodyWithResponse(ctx context.Context, address string, params *SignEvmHashParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SignEvmHashResponse, error) + req.Header.Add("Content-Type", contentType) - SignEvmHashWithResponse(ctx context.Context, address string, params *SignEvmHashParams, body SignEvmHashJSONRequestBody, reqEditors ...RequestEditorFn) (*SignEvmHashResponse, error) + return req, nil +} - // SignEvmMessageWithBodyWithResponse request with any body - SignEvmMessageWithBodyWithResponse(ctx context.Context, address string, params *SignEvmMessageParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SignEvmMessageResponse, error) +// NewCreateOnrampOrderRequest calls the generic CreateOnrampOrder builder with application/json body +func NewCreateOnrampOrderRequest(server string, body CreateOnrampOrderJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewCreateOnrampOrderRequestWithBody(server, "application/json", bodyReader) +} - SignEvmMessageWithResponse(ctx context.Context, address string, params *SignEvmMessageParams, body SignEvmMessageJSONRequestBody, reqEditors ...RequestEditorFn) (*SignEvmMessageResponse, error) +// NewCreateOnrampOrderRequestWithBody generates requests for CreateOnrampOrder with any type of body +func NewCreateOnrampOrderRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error - // SignEvmTransactionWithBodyWithResponse request with any body - SignEvmTransactionWithBodyWithResponse(ctx context.Context, address string, params *SignEvmTransactionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SignEvmTransactionResponse, error) + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } - SignEvmTransactionWithResponse(ctx context.Context, address string, params *SignEvmTransactionParams, body SignEvmTransactionJSONRequestBody, reqEditors ...RequestEditorFn) (*SignEvmTransactionResponse, error) + operationPath := fmt.Sprintf("/v2/onramp/orders") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } - // SignEvmTypedDataWithBodyWithResponse request with any body - SignEvmTypedDataWithBodyWithResponse(ctx context.Context, address string, params *SignEvmTypedDataParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SignEvmTypedDataResponse, error) + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } - SignEvmTypedDataWithResponse(ctx context.Context, address string, params *SignEvmTypedDataParams, body SignEvmTypedDataJSONRequestBody, reqEditors ...RequestEditorFn) (*SignEvmTypedDataResponse, error) + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } - // GetEvmEip7702DelegationOperationByIdWithResponse request - GetEvmEip7702DelegationOperationByIdWithResponse(ctx context.Context, delegationOperationId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetEvmEip7702DelegationOperationByIdResponse, error) + req.Header.Add("Content-Type", contentType) - // RequestEvmFaucetWithBodyWithResponse request with any body - RequestEvmFaucetWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RequestEvmFaucetResponse, error) + return req, nil +} - RequestEvmFaucetWithResponse(ctx context.Context, body RequestEvmFaucetJSONRequestBody, reqEditors ...RequestEditorFn) (*RequestEvmFaucetResponse, error) +// NewGetOnrampOrderByIdRequest generates requests for GetOnrampOrderById +func NewGetOnrampOrderByIdRequest(server string, orderId string) (*http.Request, error) { + var err error - // ListEvmSmartAccountsWithResponse request - ListEvmSmartAccountsWithResponse(ctx context.Context, params *ListEvmSmartAccountsParams, reqEditors ...RequestEditorFn) (*ListEvmSmartAccountsResponse, error) + var pathParam0 string - // CreateEvmSmartAccountWithBodyWithResponse request with any body - CreateEvmSmartAccountWithBodyWithResponse(ctx context.Context, params *CreateEvmSmartAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateEvmSmartAccountResponse, error) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "orderId", runtime.ParamLocationPath, orderId) + if err != nil { + return nil, err + } - CreateEvmSmartAccountWithResponse(ctx context.Context, params *CreateEvmSmartAccountParams, body CreateEvmSmartAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateEvmSmartAccountResponse, error) + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } - // GetEvmSmartAccountByNameWithResponse request - GetEvmSmartAccountByNameWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*GetEvmSmartAccountByNameResponse, error) + operationPath := fmt.Sprintf("/v2/onramp/orders/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } - // GetEvmSmartAccountWithResponse request - GetEvmSmartAccountWithResponse(ctx context.Context, address string, reqEditors ...RequestEditorFn) (*GetEvmSmartAccountResponse, error) + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } - // UpdateEvmSmartAccountWithBodyWithResponse request with any body - UpdateEvmSmartAccountWithBodyWithResponse(ctx context.Context, address string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateEvmSmartAccountResponse, error) + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } - UpdateEvmSmartAccountWithResponse(ctx context.Context, address string, body UpdateEvmSmartAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateEvmSmartAccountResponse, error) + return req, nil +} - // CreateSpendPermissionWithBodyWithResponse request with any body - CreateSpendPermissionWithBodyWithResponse(ctx context.Context, address string, params *CreateSpendPermissionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateSpendPermissionResponse, error) +// NewCreateOnrampSessionRequest calls the generic CreateOnrampSession builder with application/json body +func NewCreateOnrampSessionRequest(server string, body CreateOnrampSessionJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewCreateOnrampSessionRequestWithBody(server, "application/json", bodyReader) +} - CreateSpendPermissionWithResponse(ctx context.Context, address string, params *CreateSpendPermissionParams, body CreateSpendPermissionJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateSpendPermissionResponse, error) +// NewCreateOnrampSessionRequestWithBody generates requests for CreateOnrampSession with any type of body +func NewCreateOnrampSessionRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error - // ListSpendPermissionsWithResponse request - ListSpendPermissionsWithResponse(ctx context.Context, address string, params *ListSpendPermissionsParams, reqEditors ...RequestEditorFn) (*ListSpendPermissionsResponse, error) + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } - // RevokeSpendPermissionWithBodyWithResponse request with any body - RevokeSpendPermissionWithBodyWithResponse(ctx context.Context, address string, params *RevokeSpendPermissionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RevokeSpendPermissionResponse, error) + operationPath := fmt.Sprintf("/v2/onramp/sessions") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } - RevokeSpendPermissionWithResponse(ctx context.Context, address string, params *RevokeSpendPermissionParams, body RevokeSpendPermissionJSONRequestBody, reqEditors ...RequestEditorFn) (*RevokeSpendPermissionResponse, error) + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } - // PrepareUserOperationWithBodyWithResponse request with any body - PrepareUserOperationWithBodyWithResponse(ctx context.Context, address string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PrepareUserOperationResponse, error) + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } - PrepareUserOperationWithResponse(ctx context.Context, address string, body PrepareUserOperationJSONRequestBody, reqEditors ...RequestEditorFn) (*PrepareUserOperationResponse, error) + req.Header.Add("Content-Type", contentType) - // PrepareAndSendUserOperationWithBodyWithResponse request with any body - PrepareAndSendUserOperationWithBodyWithResponse(ctx context.Context, address string, params *PrepareAndSendUserOperationParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PrepareAndSendUserOperationResponse, error) + return req, nil +} - PrepareAndSendUserOperationWithResponse(ctx context.Context, address string, params *PrepareAndSendUserOperationParams, body PrepareAndSendUserOperationJSONRequestBody, reqEditors ...RequestEditorFn) (*PrepareAndSendUserOperationResponse, error) +// NewListPoliciesRequest generates requests for ListPolicies +func NewListPoliciesRequest(server string, params *ListPoliciesParams) (*http.Request, error) { + var err error - // GetUserOperationWithResponse request - GetUserOperationWithResponse(ctx context.Context, address string, userOpHash string, reqEditors ...RequestEditorFn) (*GetUserOperationResponse, error) + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } - // SendUserOperationWithBodyWithResponse request with any body - SendUserOperationWithBodyWithResponse(ctx context.Context, address string, userOpHash string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SendUserOperationResponse, error) + operationPath := fmt.Sprintf("/v2/policy-engine/policies") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } - SendUserOperationWithResponse(ctx context.Context, address string, userOpHash string, body SendUserOperationJSONRequestBody, reqEditors ...RequestEditorFn) (*SendUserOperationResponse, error) + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } - // CreateEvmSwapQuoteWithBodyWithResponse request with any body - CreateEvmSwapQuoteWithBodyWithResponse(ctx context.Context, params *CreateEvmSwapQuoteParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateEvmSwapQuoteResponse, error) + if params != nil { + queryValues := queryURL.Query() - CreateEvmSwapQuoteWithResponse(ctx context.Context, params *CreateEvmSwapQuoteParams, body CreateEvmSwapQuoteJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateEvmSwapQuoteResponse, error) + if params.PageSize != nil { - // GetEvmSwapPriceWithResponse request - GetEvmSwapPriceWithResponse(ctx context.Context, params *GetEvmSwapPriceParams, reqEditors ...RequestEditorFn) (*GetEvmSwapPriceResponse, error) + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "pageSize", runtime.ParamLocationQuery, *params.PageSize); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } - // ListEvmTokenBalancesWithResponse request - ListEvmTokenBalancesWithResponse(ctx context.Context, network ListEvmTokenBalancesNetwork, address string, params *ListEvmTokenBalancesParams, reqEditors ...RequestEditorFn) (*ListEvmTokenBalancesResponse, error) + } - // GetOnrampUserLimitsWithBodyWithResponse request with any body - GetOnrampUserLimitsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*GetOnrampUserLimitsResponse, error) + if params.PageToken != nil { - GetOnrampUserLimitsWithResponse(ctx context.Context, body GetOnrampUserLimitsJSONRequestBody, reqEditors ...RequestEditorFn) (*GetOnrampUserLimitsResponse, error) + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "pageToken", runtime.ParamLocationQuery, *params.PageToken); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } - // CreateOnrampOrderWithBodyWithResponse request with any body - CreateOnrampOrderWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateOnrampOrderResponse, error) + } - CreateOnrampOrderWithResponse(ctx context.Context, body CreateOnrampOrderJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateOnrampOrderResponse, error) + if params.Scope != nil { - // GetOnrampOrderByIdWithResponse request - GetOnrampOrderByIdWithResponse(ctx context.Context, orderId string, reqEditors ...RequestEditorFn) (*GetOnrampOrderByIdResponse, error) + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "scope", runtime.ParamLocationQuery, *params.Scope); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } - // CreateOnrampSessionWithBodyWithResponse request with any body - CreateOnrampSessionWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateOnrampSessionResponse, error) + } - CreateOnrampSessionWithResponse(ctx context.Context, body CreateOnrampSessionJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateOnrampSessionResponse, error) + queryURL.RawQuery = queryValues.Encode() + } - // ListPoliciesWithResponse request - ListPoliciesWithResponse(ctx context.Context, params *ListPoliciesParams, reqEditors ...RequestEditorFn) (*ListPoliciesResponse, error) + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } - // CreatePolicyWithBodyWithResponse request with any body - CreatePolicyWithBodyWithResponse(ctx context.Context, params *CreatePolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreatePolicyResponse, error) + return req, nil +} - CreatePolicyWithResponse(ctx context.Context, params *CreatePolicyParams, body CreatePolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*CreatePolicyResponse, error) +// NewCreatePolicyRequest calls the generic CreatePolicy builder with application/json body +func NewCreatePolicyRequest(server string, params *CreatePolicyParams, body CreatePolicyJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewCreatePolicyRequestWithBody(server, params, "application/json", bodyReader) +} - // DeletePolicyWithResponse request - DeletePolicyWithResponse(ctx context.Context, policyId string, params *DeletePolicyParams, reqEditors ...RequestEditorFn) (*DeletePolicyResponse, error) +// NewCreatePolicyRequestWithBody generates requests for CreatePolicy with any type of body +func NewCreatePolicyRequestWithBody(server string, params *CreatePolicyParams, contentType string, body io.Reader) (*http.Request, error) { + var err error - // GetPolicyByIdWithResponse request - GetPolicyByIdWithResponse(ctx context.Context, policyId string, reqEditors ...RequestEditorFn) (*GetPolicyByIdResponse, error) + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } - // UpdatePolicyWithBodyWithResponse request with any body - UpdatePolicyWithBodyWithResponse(ctx context.Context, policyId string, params *UpdatePolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdatePolicyResponse, error) + operationPath := fmt.Sprintf("/v2/policy-engine/policies") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } - UpdatePolicyWithResponse(ctx context.Context, policyId string, params *UpdatePolicyParams, body UpdatePolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdatePolicyResponse, error) + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } - // ListSolanaAccountsWithResponse request - ListSolanaAccountsWithResponse(ctx context.Context, params *ListSolanaAccountsParams, reqEditors ...RequestEditorFn) (*ListSolanaAccountsResponse, error) + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } - // CreateSolanaAccountWithBodyWithResponse request with any body - CreateSolanaAccountWithBodyWithResponse(ctx context.Context, params *CreateSolanaAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateSolanaAccountResponse, error) + req.Header.Add("Content-Type", contentType) - CreateSolanaAccountWithResponse(ctx context.Context, params *CreateSolanaAccountParams, body CreateSolanaAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateSolanaAccountResponse, error) + if params != nil { - // GetSolanaAccountByNameWithResponse request - GetSolanaAccountByNameWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*GetSolanaAccountByNameResponse, error) + if params.XIdempotencyKey != nil { + var headerParam0 string - // ExportSolanaAccountByNameWithBodyWithResponse request with any body - ExportSolanaAccountByNameWithBodyWithResponse(ctx context.Context, name string, params *ExportSolanaAccountByNameParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ExportSolanaAccountByNameResponse, error) + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Idempotency-Key", runtime.ParamLocationHeader, *params.XIdempotencyKey) + if err != nil { + return nil, err + } - ExportSolanaAccountByNameWithResponse(ctx context.Context, name string, params *ExportSolanaAccountByNameParams, body ExportSolanaAccountByNameJSONRequestBody, reqEditors ...RequestEditorFn) (*ExportSolanaAccountByNameResponse, error) + req.Header.Set("X-Idempotency-Key", headerParam0) + } - // ImportSolanaAccountWithBodyWithResponse request with any body - ImportSolanaAccountWithBodyWithResponse(ctx context.Context, params *ImportSolanaAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ImportSolanaAccountResponse, error) + } - ImportSolanaAccountWithResponse(ctx context.Context, params *ImportSolanaAccountParams, body ImportSolanaAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*ImportSolanaAccountResponse, error) + return req, nil +} - // SendSolanaTransactionWithBodyWithResponse request with any body - SendSolanaTransactionWithBodyWithResponse(ctx context.Context, params *SendSolanaTransactionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SendSolanaTransactionResponse, error) +// NewDeletePolicyRequest generates requests for DeletePolicy +func NewDeletePolicyRequest(server string, policyId string, params *DeletePolicyParams) (*http.Request, error) { + var err error - SendSolanaTransactionWithResponse(ctx context.Context, params *SendSolanaTransactionParams, body SendSolanaTransactionJSONRequestBody, reqEditors ...RequestEditorFn) (*SendSolanaTransactionResponse, error) + var pathParam0 string - // GetSolanaAccountWithResponse request - GetSolanaAccountWithResponse(ctx context.Context, address string, reqEditors ...RequestEditorFn) (*GetSolanaAccountResponse, error) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "policyId", runtime.ParamLocationPath, policyId) + if err != nil { + return nil, err + } - // UpdateSolanaAccountWithBodyWithResponse request with any body - UpdateSolanaAccountWithBodyWithResponse(ctx context.Context, address string, params *UpdateSolanaAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateSolanaAccountResponse, error) - - UpdateSolanaAccountWithResponse(ctx context.Context, address string, params *UpdateSolanaAccountParams, body UpdateSolanaAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateSolanaAccountResponse, error) - - // ExportSolanaAccountWithBodyWithResponse request with any body - ExportSolanaAccountWithBodyWithResponse(ctx context.Context, address string, params *ExportSolanaAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ExportSolanaAccountResponse, error) - - ExportSolanaAccountWithResponse(ctx context.Context, address string, params *ExportSolanaAccountParams, body ExportSolanaAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*ExportSolanaAccountResponse, error) + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } - // SignSolanaMessageWithBodyWithResponse request with any body - SignSolanaMessageWithBodyWithResponse(ctx context.Context, address string, params *SignSolanaMessageParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SignSolanaMessageResponse, error) + operationPath := fmt.Sprintf("/v2/policy-engine/policies/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } - SignSolanaMessageWithResponse(ctx context.Context, address string, params *SignSolanaMessageParams, body SignSolanaMessageJSONRequestBody, reqEditors ...RequestEditorFn) (*SignSolanaMessageResponse, error) + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } - // SignSolanaTransactionWithBodyWithResponse request with any body - SignSolanaTransactionWithBodyWithResponse(ctx context.Context, address string, params *SignSolanaTransactionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SignSolanaTransactionResponse, error) + req, err := http.NewRequest("DELETE", queryURL.String(), nil) + if err != nil { + return nil, err + } - SignSolanaTransactionWithResponse(ctx context.Context, address string, params *SignSolanaTransactionParams, body SignSolanaTransactionJSONRequestBody, reqEditors ...RequestEditorFn) (*SignSolanaTransactionResponse, error) + if params != nil { - // RequestSolanaFaucetWithBodyWithResponse request with any body - RequestSolanaFaucetWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RequestSolanaFaucetResponse, error) + if params.XIdempotencyKey != nil { + var headerParam0 string - RequestSolanaFaucetWithResponse(ctx context.Context, body RequestSolanaFaucetJSONRequestBody, reqEditors ...RequestEditorFn) (*RequestSolanaFaucetResponse, error) + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Idempotency-Key", runtime.ParamLocationHeader, *params.XIdempotencyKey) + if err != nil { + return nil, err + } - // ListSolanaTokenBalancesWithResponse request - ListSolanaTokenBalancesWithResponse(ctx context.Context, network ListSolanaTokenBalancesNetwork, address string, params *ListSolanaTokenBalancesParams, reqEditors ...RequestEditorFn) (*ListSolanaTokenBalancesResponse, error) + req.Header.Set("X-Idempotency-Key", headerParam0) + } - // SettleX402PaymentWithBodyWithResponse request with any body - SettleX402PaymentWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SettleX402PaymentResponse, error) + } - SettleX402PaymentWithResponse(ctx context.Context, body SettleX402PaymentJSONRequestBody, reqEditors ...RequestEditorFn) (*SettleX402PaymentResponse, error) + return req, nil +} - // SupportedX402PaymentKindsWithResponse request - SupportedX402PaymentKindsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*SupportedX402PaymentKindsResponse, error) +// NewGetPolicyByIdRequest generates requests for GetPolicyById +func NewGetPolicyByIdRequest(server string, policyId string) (*http.Request, error) { + var err error - // VerifyX402PaymentWithBodyWithResponse request with any body - VerifyX402PaymentWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*VerifyX402PaymentResponse, error) + var pathParam0 string - VerifyX402PaymentWithResponse(ctx context.Context, body VerifyX402PaymentJSONRequestBody, reqEditors ...RequestEditorFn) (*VerifyX402PaymentResponse, error) -} + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "policyId", runtime.ParamLocationPath, policyId) + if err != nil { + return nil, err + } -type ListDataTokenBalancesResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - // Balances The list of EVM token balances. - Balances []TokenBalance `json:"balances"` + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } - // NextPageToken The token for the next page of items, if any. - NextPageToken *string `json:"nextPageToken,omitempty"` + operationPath := fmt.Sprintf("/v2/policy-engine/policies/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath } - JSON400 *Error - JSON404 *Error - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError -} -// Status returns HTTPResponse.Status -func (r ListDataTokenBalancesResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err } - return http.StatusText(0) -} -// StatusCode returns HTTPResponse.StatusCode -func (r ListDataTokenBalancesResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err } - return 0 -} -type ListTokensForAccountResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *AccountTokenAddressesResponse - JSON400 *Error - JSON401 *UnauthorizedError - JSON429 *Error - JSON500 *InternalServerError + return req, nil } -// Status returns HTTPResponse.Status -func (r ListTokensForAccountResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// NewUpdatePolicyRequest calls the generic UpdatePolicy builder with application/json body +func NewUpdatePolicyRequest(server string, policyId string, params *UpdatePolicyParams, body UpdatePolicyJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err } - return http.StatusText(0) + bodyReader = bytes.NewReader(buf) + return NewUpdatePolicyRequestWithBody(server, policyId, params, "application/json", bodyReader) } -// StatusCode returns HTTPResponse.StatusCode -func (r ListTokensForAccountResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} +// NewUpdatePolicyRequestWithBody generates requests for UpdatePolicy with any type of body +func NewUpdatePolicyRequestWithBody(server string, policyId string, params *UpdatePolicyParams, contentType string, body io.Reader) (*http.Request, error) { + var err error -type GetSQLGrammarResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *string - JSON401 *UnauthorizedError - JSON429 *Error - JSON500 *InternalServerError - JSON504 *TimedOutError -} + var pathParam0 string -// Status returns HTTPResponse.Status -func (r GetSQLGrammarResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "policyId", runtime.ParamLocationPath, policyId) + if err != nil { + return nil, err } - return http.StatusText(0) -} -// StatusCode returns HTTPResponse.StatusCode -func (r GetSQLGrammarResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode + serverURL, err := url.Parse(server) + if err != nil { + return nil, err } - return 0 -} -type RunSQLQueryResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *OnchainDataResult - JSON400 *InvalidSQLQueryError - JSON401 *UnauthorizedError - JSON408 *Error - JSON429 *Error - JSON499 *ClientClosedRequestError - JSON500 *InternalServerError - JSON504 *TimedOutError -} + operationPath := fmt.Sprintf("/v2/policy-engine/policies/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } -// Status returns HTTPResponse.Status -func (r RunSQLQueryResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err } - return http.StatusText(0) -} -// StatusCode returns HTTPResponse.StatusCode -func (r RunSQLQueryResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode + req, err := http.NewRequest("PUT", queryURL.String(), body) + if err != nil { + return nil, err } - return 0 -} -type ListWebhookSubscriptionsResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *WebhookSubscriptionListResponse - JSON400 *Error - JSON401 *UnauthorizedError - JSON429 *Error - JSON500 *InternalServerError -} + req.Header.Add("Content-Type", contentType) -// Status returns HTTPResponse.Status -func (r ListWebhookSubscriptionsResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} + if params != nil { -// StatusCode returns HTTPResponse.StatusCode -func (r ListWebhookSubscriptionsResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} + if params.XIdempotencyKey != nil { + var headerParam0 string -type CreateWebhookSubscriptionResponse struct { - Body []byte - HTTPResponse *http.Response - JSON201 *WebhookSubscriptionResponse - JSON400 *Error - JSON401 *UnauthorizedError - JSON429 *Error - JSON500 *InternalServerError -} + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Idempotency-Key", runtime.ParamLocationHeader, *params.XIdempotencyKey) + if err != nil { + return nil, err + } -// Status returns HTTPResponse.Status -func (r CreateWebhookSubscriptionResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} + req.Header.Set("X-Idempotency-Key", headerParam0) + } -// StatusCode returns HTTPResponse.StatusCode -func (r CreateWebhookSubscriptionResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode } - return 0 + + return req, nil } -type DeleteWebhookSubscriptionResponse struct { - Body []byte - HTTPResponse *http.Response - JSON401 *UnauthorizedError - JSON404 *Error - JSON429 *Error - JSON500 *InternalServerError -} +// NewListSolanaAccountsRequest generates requests for ListSolanaAccounts +func NewListSolanaAccountsRequest(server string, params *ListSolanaAccountsParams) (*http.Request, error) { + var err error -// Status returns HTTPResponse.Status -func (r DeleteWebhookSubscriptionResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status + serverURL, err := url.Parse(server) + if err != nil { + return nil, err } - return http.StatusText(0) -} -// StatusCode returns HTTPResponse.StatusCode -func (r DeleteWebhookSubscriptionResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode + operationPath := fmt.Sprintf("/v2/solana/accounts") + if operationPath[0] == '/' { + operationPath = "." + operationPath } - return 0 -} -type GetWebhookSubscriptionResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *WebhookSubscriptionResponse - JSON401 *UnauthorizedError - JSON404 *Error - JSON429 *Error - JSON500 *InternalServerError -} + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } -// Status returns HTTPResponse.Status -func (r GetWebhookSubscriptionResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status + if params != nil { + queryValues := queryURL.Query() + + if params.PageSize != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "pageSize", runtime.ParamLocationQuery, *params.PageSize); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.PageToken != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "pageToken", runtime.ParamLocationQuery, *params.PageToken); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() } - return http.StatusText(0) -} -// StatusCode returns HTTPResponse.StatusCode -func (r GetWebhookSubscriptionResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err } - return 0 -} -type UpdateWebhookSubscriptionResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *WebhookSubscriptionResponse - JSON400 *Error - JSON401 *UnauthorizedError - JSON404 *Error - JSON429 *Error - JSON500 *InternalServerError + return req, nil } -// Status returns HTTPResponse.Status -func (r UpdateWebhookSubscriptionResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// NewCreateSolanaAccountRequest calls the generic CreateSolanaAccount builder with application/json body +func NewCreateSolanaAccountRequest(server string, params *CreateSolanaAccountParams, body CreateSolanaAccountJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err } - return http.StatusText(0) + bodyReader = bytes.NewReader(buf) + return NewCreateSolanaAccountRequestWithBody(server, params, "application/json", bodyReader) } -// StatusCode returns HTTPResponse.StatusCode -func (r UpdateWebhookSubscriptionResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// NewCreateSolanaAccountRequestWithBody generates requests for CreateSolanaAccount with any type of body +func NewCreateSolanaAccountRequestWithBody(server string, params *CreateSolanaAccountParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err } - return 0 -} -type ListEndUsersResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - // EndUsers The list of end users. - EndUsers []EndUser `json:"endUsers"` + operationPath := fmt.Sprintf("/v2/solana/accounts") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } - // NextPageToken The token for the next page of items, if any. - NextPageToken *string `json:"nextPageToken,omitempty"` + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err } - JSON400 *Error - JSON401 *UnauthorizedError - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError -} -// Status returns HTTPResponse.Status -func (r ListEndUsersResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err } - return http.StatusText(0) -} -// StatusCode returns HTTPResponse.StatusCode -func (r ListEndUsersResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode + req.Header.Add("Content-Type", contentType) + + if params != nil { + + if params.XWalletAuth != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Wallet-Auth", runtime.ParamLocationHeader, *params.XWalletAuth) + if err != nil { + return nil, err + } + + req.Header.Set("X-Wallet-Auth", headerParam0) + } + + if params.XIdempotencyKey != nil { + var headerParam1 string + + headerParam1, err = runtime.StyleParamWithLocation("simple", false, "X-Idempotency-Key", runtime.ParamLocationHeader, *params.XIdempotencyKey) + if err != nil { + return nil, err + } + + req.Header.Set("X-Idempotency-Key", headerParam1) + } + } - return 0 -} -type CreateEndUserResponse struct { - Body []byte - HTTPResponse *http.Response - JSON201 *EndUser - JSON400 *Error - JSON401 *Error - JSON402 *PaymentMethodRequiredError - JSON422 *IdempotencyError - JSON500 *InternalServerError + return req, nil } -// Status returns HTTPResponse.Status -func (r CreateEndUserResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// NewGetSolanaAccountByNameRequest generates requests for GetSolanaAccountByName +func NewGetSolanaAccountByNameRequest(server string, name string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "name", runtime.ParamLocationPath, name) + if err != nil { + return nil, err } - return http.StatusText(0) -} -// StatusCode returns HTTPResponse.StatusCode -func (r CreateEndUserResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode + serverURL, err := url.Parse(server) + if err != nil { + return nil, err } - return 0 -} -type ValidateEndUserAccessTokenResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *EndUser - JSON400 *Error - JSON401 *Error - JSON404 *Error - JSON500 *InternalServerError -} + operationPath := fmt.Sprintf("/v2/solana/accounts/by-name/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } -// Status returns HTTPResponse.Status -func (r ValidateEndUserAccessTokenResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err } - return http.StatusText(0) -} -// StatusCode returns HTTPResponse.StatusCode -func (r ValidateEndUserAccessTokenResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err } - return 0 + + return req, nil } -type ImportEndUserResponse struct { - Body []byte - HTTPResponse *http.Response - JSON201 *EndUser - JSON400 *Error - JSON401 *Error - JSON402 *PaymentMethodRequiredError - JSON409 *Error - JSON422 *IdempotencyError - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError -} - -// Status returns HTTPResponse.Status -func (r ImportEndUserResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// NewExportSolanaAccountByNameRequest calls the generic ExportSolanaAccountByName builder with application/json body +func NewExportSolanaAccountByNameRequest(server string, name string, params *ExportSolanaAccountByNameParams, body ExportSolanaAccountByNameJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err } - return http.StatusText(0) + bodyReader = bytes.NewReader(buf) + return NewExportSolanaAccountByNameRequestWithBody(server, name, params, "application/json", bodyReader) } -// StatusCode returns HTTPResponse.StatusCode -func (r ImportEndUserResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} +// NewExportSolanaAccountByNameRequestWithBody generates requests for ExportSolanaAccountByName with any type of body +func NewExportSolanaAccountByNameRequestWithBody(server string, name string, params *ExportSolanaAccountByNameParams, contentType string, body io.Reader) (*http.Request, error) { + var err error -type GetEndUserResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *EndUser - JSON404 *Error - JSON500 *InternalServerError -} + var pathParam0 string -// Status returns HTTPResponse.Status -func (r GetEndUserResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "name", runtime.ParamLocationPath, name) + if err != nil { + return nil, err } - return http.StatusText(0) -} -// StatusCode returns HTTPResponse.StatusCode -func (r GetEndUserResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode + serverURL, err := url.Parse(server) + if err != nil { + return nil, err } - return 0 -} -type AddEndUserEvmAccountResponse struct { - Body []byte - HTTPResponse *http.Response - JSON201 *struct { - // EvmAccount Information about an EVM account associated with an end user. - EvmAccount EndUserEvmAccount `json:"evmAccount"` + operationPath := fmt.Sprintf("/v2/solana/accounts/export/by-name/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath } - JSON400 *Error - JSON401 *Error - JSON402 *PaymentMethodRequiredError - JSON404 *Error - JSON422 *IdempotencyError - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError -} -// Status returns HTTPResponse.Status -func (r AddEndUserEvmAccountResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err } - return http.StatusText(0) -} -// StatusCode returns HTTPResponse.StatusCode -func (r AddEndUserEvmAccountResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err } - return 0 -} -type AddEndUserEvmSmartAccountResponse struct { - Body []byte - HTTPResponse *http.Response - JSON201 *struct { - // EvmSmartAccount Information about an EVM smart account associated with an end user. - EvmSmartAccount EndUserEvmSmartAccount `json:"evmSmartAccount"` + req.Header.Add("Content-Type", contentType) + + if params != nil { + + if params.XWalletAuth != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Wallet-Auth", runtime.ParamLocationHeader, *params.XWalletAuth) + if err != nil { + return nil, err + } + + req.Header.Set("X-Wallet-Auth", headerParam0) + } + + if params.XIdempotencyKey != nil { + var headerParam1 string + + headerParam1, err = runtime.StyleParamWithLocation("simple", false, "X-Idempotency-Key", runtime.ParamLocationHeader, *params.XIdempotencyKey) + if err != nil { + return nil, err + } + + req.Header.Set("X-Idempotency-Key", headerParam1) + } + } - JSON400 *Error - JSON401 *Error - JSON402 *PaymentMethodRequiredError - JSON404 *Error - JSON422 *IdempotencyError - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError + + return req, nil } -// Status returns HTTPResponse.Status -func (r AddEndUserEvmSmartAccountResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// NewImportSolanaAccountRequest calls the generic ImportSolanaAccount builder with application/json body +func NewImportSolanaAccountRequest(server string, params *ImportSolanaAccountParams, body ImportSolanaAccountJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err } - return http.StatusText(0) + bodyReader = bytes.NewReader(buf) + return NewImportSolanaAccountRequestWithBody(server, params, "application/json", bodyReader) } -// StatusCode returns HTTPResponse.StatusCode -func (r AddEndUserEvmSmartAccountResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// NewImportSolanaAccountRequestWithBody generates requests for ImportSolanaAccount with any type of body +func NewImportSolanaAccountRequestWithBody(server string, params *ImportSolanaAccountParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err } - return 0 -} -type AddEndUserSolanaAccountResponse struct { - Body []byte - HTTPResponse *http.Response - JSON201 *struct { - // SolanaAccount Information about a Solana account associated with an end user. - SolanaAccount EndUserSolanaAccount `json:"solanaAccount"` + operationPath := fmt.Sprintf("/v2/solana/accounts/import") + if operationPath[0] == '/' { + operationPath = "." + operationPath } - JSON400 *Error - JSON401 *Error - JSON402 *PaymentMethodRequiredError - JSON404 *Error - JSON422 *IdempotencyError - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError -} -// Status returns HTTPResponse.Status -func (r AddEndUserSolanaAccountResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err } - return http.StatusText(0) -} -// StatusCode returns HTTPResponse.StatusCode -func (r AddEndUserSolanaAccountResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err } - return 0 -} -type ListEvmAccountsResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - // Accounts The list of EVM accounts. - Accounts []EvmAccount `json:"accounts"` + req.Header.Add("Content-Type", contentType) + + if params != nil { + + if params.XWalletAuth != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Wallet-Auth", runtime.ParamLocationHeader, *params.XWalletAuth) + if err != nil { + return nil, err + } + + req.Header.Set("X-Wallet-Auth", headerParam0) + } + + if params.XIdempotencyKey != nil { + var headerParam1 string + + headerParam1, err = runtime.StyleParamWithLocation("simple", false, "X-Idempotency-Key", runtime.ParamLocationHeader, *params.XIdempotencyKey) + if err != nil { + return nil, err + } + + req.Header.Set("X-Idempotency-Key", headerParam1) + } - // NextPageToken The token for the next page of items, if any. - NextPageToken *string `json:"nextPageToken,omitempty"` } - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError + + return req, nil } -// Status returns HTTPResponse.Status -func (r ListEvmAccountsResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// NewSendSolanaTransactionRequest calls the generic SendSolanaTransaction builder with application/json body +func NewSendSolanaTransactionRequest(server string, params *SendSolanaTransactionParams, body SendSolanaTransactionJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err } - return http.StatusText(0) + bodyReader = bytes.NewReader(buf) + return NewSendSolanaTransactionRequestWithBody(server, params, "application/json", bodyReader) } -// StatusCode returns HTTPResponse.StatusCode -func (r ListEvmAccountsResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type CreateEvmAccountResponse struct { - Body []byte - HTTPResponse *http.Response - JSON201 *EvmAccount - JSON400 *Error - JSON401 *Error - JSON402 *PaymentMethodRequiredError - JSON409 *Error - JSON422 *IdempotencyError - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError -} +// NewSendSolanaTransactionRequestWithBody generates requests for SendSolanaTransaction with any type of body +func NewSendSolanaTransactionRequestWithBody(server string, params *SendSolanaTransactionParams, contentType string, body io.Reader) (*http.Request, error) { + var err error -// Status returns HTTPResponse.Status -func (r CreateEvmAccountResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status + serverURL, err := url.Parse(server) + if err != nil { + return nil, err } - return http.StatusText(0) -} -// StatusCode returns HTTPResponse.StatusCode -func (r CreateEvmAccountResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode + operationPath := fmt.Sprintf("/v2/solana/accounts/send/transaction") + if operationPath[0] == '/' { + operationPath = "." + operationPath } - return 0 -} - -type GetEvmAccountByNameResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *EvmAccount - JSON400 *Error - JSON404 *Error - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError -} -// Status returns HTTPResponse.Status -func (r GetEvmAccountByNameResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err } - return http.StatusText(0) -} -// StatusCode returns HTTPResponse.StatusCode -func (r GetEvmAccountByNameResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err } - return 0 -} -type ExportEvmAccountByNameResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - // EncryptedPrivateKey The base64-encoded, encrypted private key of the EVM account which is a 32 byte raw private key. The private key is encrypted in transport using the exportEncryptionKey in the request. - EncryptedPrivateKey string `json:"encryptedPrivateKey"` - } - JSON400 *Error - JSON401 *Error - JSON402 *PaymentMethodRequiredError - JSON404 *Error - JSON422 *IdempotencyError - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError -} + req.Header.Add("Content-Type", contentType) -// Status returns HTTPResponse.Status -func (r ExportEvmAccountByNameResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} + if params != nil { + + if params.XWalletAuth != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Wallet-Auth", runtime.ParamLocationHeader, *params.XWalletAuth) + if err != nil { + return nil, err + } + + req.Header.Set("X-Wallet-Auth", headerParam0) + } + + if params.XIdempotencyKey != nil { + var headerParam1 string + + headerParam1, err = runtime.StyleParamWithLocation("simple", false, "X-Idempotency-Key", runtime.ParamLocationHeader, *params.XIdempotencyKey) + if err != nil { + return nil, err + } + + req.Header.Set("X-Idempotency-Key", headerParam1) + } -// StatusCode returns HTTPResponse.StatusCode -func (r ExportEvmAccountByNameResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode } - return 0 -} -type ImportEvmAccountResponse struct { - Body []byte - HTTPResponse *http.Response - JSON201 *EvmAccount - JSON400 *Error - JSON401 *Error - JSON402 *PaymentMethodRequiredError - JSON409 *Error - JSON422 *IdempotencyError - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError + return req, nil } -// Status returns HTTPResponse.Status -func (r ImportEvmAccountResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// NewGetSolanaAccountRequest generates requests for GetSolanaAccount +func NewGetSolanaAccountRequest(server string, address string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "address", runtime.ParamLocationPath, address) + if err != nil { + return nil, err } - return http.StatusText(0) -} -// StatusCode returns HTTPResponse.StatusCode -func (r ImportEvmAccountResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode + serverURL, err := url.Parse(server) + if err != nil { + return nil, err } - return 0 -} -type GetEvmAccountResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *EvmAccount - JSON400 *Error - JSON404 *Error - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError -} + operationPath := fmt.Sprintf("/v2/solana/accounts/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } -// Status returns HTTPResponse.Status -func (r GetEvmAccountResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err } - return http.StatusText(0) -} -// StatusCode returns HTTPResponse.StatusCode -func (r GetEvmAccountResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err } - return 0 -} -type UpdateEvmAccountResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *EvmAccount - JSON400 *Error - JSON404 *Error - JSON409 *AlreadyExistsError - JSON422 *IdempotencyError - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError + return req, nil } -// Status returns HTTPResponse.Status -func (r UpdateEvmAccountResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// NewUpdateSolanaAccountRequest calls the generic UpdateSolanaAccount builder with application/json body +func NewUpdateSolanaAccountRequest(server string, address string, params *UpdateSolanaAccountParams, body UpdateSolanaAccountJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err } - return http.StatusText(0) + bodyReader = bytes.NewReader(buf) + return NewUpdateSolanaAccountRequestWithBody(server, address, params, "application/json", bodyReader) } -// StatusCode returns HTTPResponse.StatusCode -func (r UpdateEvmAccountResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// NewUpdateSolanaAccountRequestWithBody generates requests for UpdateSolanaAccount with any type of body +func NewUpdateSolanaAccountRequestWithBody(server string, address string, params *UpdateSolanaAccountParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "address", runtime.ParamLocationPath, address) + if err != nil { + return nil, err } - return 0 -} -type CreateEvmEip7702DelegationResponse struct { - Body []byte - HTTPResponse *http.Response - JSON201 *struct { - // DelegationOperationId The unique identifier for the delegation operation. Use this to poll the operation status. - DelegationOperationId openapi_types.UUID `json:"delegationOperationId"` + serverURL, err := url.Parse(server) + if err != nil { + return nil, err } - JSON400 *Error - JSON401 *UnauthorizedError - JSON402 *PaymentMethodRequiredError - JSON404 *Error - JSON409 *Error - JSON422 *IdempotencyError - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError -} -// Status returns HTTPResponse.Status -func (r CreateEvmEip7702DelegationResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status + operationPath := fmt.Sprintf("/v2/solana/accounts/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath } - return http.StatusText(0) -} -// StatusCode returns HTTPResponse.StatusCode -func (r CreateEvmEip7702DelegationResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err } - return 0 -} -type ExportEvmAccountResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - // EncryptedPrivateKey The base64-encoded, encrypted private key of the EVM account which is a 32 byte raw private key. The private key is encrypted in transport using the exportEncryptionKey in the request. - EncryptedPrivateKey string `json:"encryptedPrivateKey"` + req, err := http.NewRequest("PUT", queryURL.String(), body) + if err != nil { + return nil, err } - JSON400 *Error - JSON401 *Error - JSON402 *PaymentMethodRequiredError - JSON404 *Error - JSON422 *IdempotencyError - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError -} -// Status returns HTTPResponse.Status -func (r ExportEvmAccountResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} + req.Header.Add("Content-Type", contentType) + + if params != nil { + + if params.XIdempotencyKey != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Idempotency-Key", runtime.ParamLocationHeader, *params.XIdempotencyKey) + if err != nil { + return nil, err + } + + req.Header.Set("X-Idempotency-Key", headerParam0) + } -// StatusCode returns HTTPResponse.StatusCode -func (r ExportEvmAccountResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode } - return 0 + + return req, nil } -type SendEvmTransactionResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - // TransactionHash The hash of the transaction, as a 0x-prefixed hex string. - TransactionHash string `json:"transactionHash"` +// NewExportSolanaAccountRequest calls the generic ExportSolanaAccount builder with application/json body +func NewExportSolanaAccountRequest(server string, address string, params *ExportSolanaAccountParams, body ExportSolanaAccountJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err } - JSON400 *Error - JSON401 *Error - JSON402 *PaymentMethodRequiredError - JSON403 *Error - JSON404 *Error - JSON409 *AlreadyExistsError - JSON422 *IdempotencyError - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError + bodyReader = bytes.NewReader(buf) + return NewExportSolanaAccountRequestWithBody(server, address, params, "application/json", bodyReader) } -// Status returns HTTPResponse.Status -func (r SendEvmTransactionResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// NewExportSolanaAccountRequestWithBody generates requests for ExportSolanaAccount with any type of body +func NewExportSolanaAccountRequestWithBody(server string, address string, params *ExportSolanaAccountParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "address", runtime.ParamLocationPath, address) + if err != nil { + return nil, err } - return http.StatusText(0) -} -// StatusCode returns HTTPResponse.StatusCode -func (r SendEvmTransactionResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode + serverURL, err := url.Parse(server) + if err != nil { + return nil, err } - return 0 -} -type SignEvmHashResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - // Signature The signature of the hash, as a 0x-prefixed hex string. - Signature string `json:"signature"` + operationPath := fmt.Sprintf("/v2/solana/accounts/%s/export", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath } - JSON400 *Error - JSON402 *PaymentMethodRequiredError - JSON404 *Error - JSON409 *AlreadyExistsError - JSON422 *IdempotencyError - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError -} -// Status returns HTTPResponse.Status -func (r SignEvmHashResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err } - return http.StatusText(0) -} -// StatusCode returns HTTPResponse.StatusCode -func (r SignEvmHashResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err } - return 0 -} -type SignEvmMessageResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - // Signature The signature of the message, as a 0x-prefixed hex string. - Signature string `json:"signature"` + req.Header.Add("Content-Type", contentType) + + if params != nil { + + if params.XWalletAuth != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Wallet-Auth", runtime.ParamLocationHeader, *params.XWalletAuth) + if err != nil { + return nil, err + } + + req.Header.Set("X-Wallet-Auth", headerParam0) + } + + if params.XIdempotencyKey != nil { + var headerParam1 string + + headerParam1, err = runtime.StyleParamWithLocation("simple", false, "X-Idempotency-Key", runtime.ParamLocationHeader, *params.XIdempotencyKey) + if err != nil { + return nil, err + } + + req.Header.Set("X-Idempotency-Key", headerParam1) + } + } - JSON401 *Error - JSON402 *PaymentMethodRequiredError - JSON404 *Error - JSON409 *AlreadyExistsError - JSON422 *IdempotencyError - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError + + return req, nil } -// Status returns HTTPResponse.Status -func (r SignEvmMessageResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// NewSignSolanaMessageRequest calls the generic SignSolanaMessage builder with application/json body +func NewSignSolanaMessageRequest(server string, address string, params *SignSolanaMessageParams, body SignSolanaMessageJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err } - return http.StatusText(0) + bodyReader = bytes.NewReader(buf) + return NewSignSolanaMessageRequestWithBody(server, address, params, "application/json", bodyReader) } -// StatusCode returns HTTPResponse.StatusCode -func (r SignEvmMessageResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// NewSignSolanaMessageRequestWithBody generates requests for SignSolanaMessage with any type of body +func NewSignSolanaMessageRequestWithBody(server string, address string, params *SignSolanaMessageParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "address", runtime.ParamLocationPath, address) + if err != nil { + return nil, err } - return 0 -} -type SignEvmTransactionResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - // SignedTransaction The RLP-encoded signed transaction, as a 0x-prefixed hex string. - SignedTransaction string `json:"signedTransaction"` + serverURL, err := url.Parse(server) + if err != nil { + return nil, err } - JSON400 *Error - JSON401 *Error - JSON402 *PaymentMethodRequiredError - JSON403 *Error - JSON404 *Error - JSON409 *AlreadyExistsError - JSON422 *IdempotencyError - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError -} -// Status returns HTTPResponse.Status -func (r SignEvmTransactionResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status + operationPath := fmt.Sprintf("/v2/solana/accounts/%s/sign/message", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath } - return http.StatusText(0) -} -// StatusCode returns HTTPResponse.StatusCode -func (r SignEvmTransactionResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err } - return 0 -} -type SignEvmTypedDataResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - // Signature The signature of the typed data, as a 0x-prefixed hex string. - Signature string `json:"signature"` + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err } - JSON400 *Error - JSON401 *Error - JSON402 *PaymentMethodRequiredError - JSON404 *Error - JSON422 *IdempotencyError - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError -} -// Status returns HTTPResponse.Status -func (r SignEvmTypedDataResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status + req.Header.Add("Content-Type", contentType) + + if params != nil { + + if params.XWalletAuth != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Wallet-Auth", runtime.ParamLocationHeader, *params.XWalletAuth) + if err != nil { + return nil, err + } + + req.Header.Set("X-Wallet-Auth", headerParam0) + } + + if params.XIdempotencyKey != nil { + var headerParam1 string + + headerParam1, err = runtime.StyleParamWithLocation("simple", false, "X-Idempotency-Key", runtime.ParamLocationHeader, *params.XIdempotencyKey) + if err != nil { + return nil, err + } + + req.Header.Set("X-Idempotency-Key", headerParam1) + } + } - return http.StatusText(0) + + return req, nil } -// StatusCode returns HTTPResponse.StatusCode -func (r SignEvmTypedDataResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// NewSignSolanaTransactionRequest calls the generic SignSolanaTransaction builder with application/json body +func NewSignSolanaTransactionRequest(server string, address string, params *SignSolanaTransactionParams, body SignSolanaTransactionJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err } - return 0 + bodyReader = bytes.NewReader(buf) + return NewSignSolanaTransactionRequestWithBody(server, address, params, "application/json", bodyReader) } -type GetEvmEip7702DelegationOperationByIdResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *EvmEip7702DelegationOperation - JSON400 *Error - JSON404 *Error - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError -} +// NewSignSolanaTransactionRequestWithBody generates requests for SignSolanaTransaction with any type of body +func NewSignSolanaTransactionRequestWithBody(server string, address string, params *SignSolanaTransactionParams, contentType string, body io.Reader) (*http.Request, error) { + var err error -// Status returns HTTPResponse.Status -func (r GetEvmEip7702DelegationOperationByIdResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "address", runtime.ParamLocationPath, address) + if err != nil { + return nil, err } - return http.StatusText(0) -} -// StatusCode returns HTTPResponse.StatusCode -func (r GetEvmEip7702DelegationOperationByIdResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode + serverURL, err := url.Parse(server) + if err != nil { + return nil, err } - return 0 -} -type RequestEvmFaucetResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - // TransactionHash The hash of the transaction that requested the funds. - // **Note:** In rare cases, when gas conditions are unusually high, the transaction may not confirm, and the system may issue a replacement transaction to complete the faucet request. In these rare cases, the `transactionHash` will be out of sync with the actual faucet transaction that was confirmed onchain. - TransactionHash string `json:"transactionHash"` + operationPath := fmt.Sprintf("/v2/solana/accounts/%s/sign/transaction", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath } - JSON400 *Error - JSON403 *Error - JSON429 *Error - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError -} -// Status returns HTTPResponse.Status -func (r RequestEvmFaucetResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err } - return http.StatusText(0) -} -// StatusCode returns HTTPResponse.StatusCode -func (r RequestEvmFaucetResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err } - return 0 -} -type ListEvmSmartAccountsResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - // Accounts The list of Smart Accounts. - Accounts []EvmSmartAccount `json:"accounts"` + req.Header.Add("Content-Type", contentType) - // NextPageToken The token for the next page of items, if any. - NextPageToken *string `json:"nextPageToken,omitempty"` - } - JSON400 *Error - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError -} + if params != nil { -// Status returns HTTPResponse.Status -func (r ListEvmSmartAccountsResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} + if params.XWalletAuth != nil { + var headerParam0 string -// StatusCode returns HTTPResponse.StatusCode -func (r ListEvmSmartAccountsResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Wallet-Auth", runtime.ParamLocationHeader, *params.XWalletAuth) + if err != nil { + return nil, err + } -type CreateEvmSmartAccountResponse struct { - Body []byte - HTTPResponse *http.Response - JSON201 *EvmSmartAccount - JSON400 *Error - JSON402 *PaymentMethodRequiredError - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError -} + req.Header.Set("X-Wallet-Auth", headerParam0) + } -// Status returns HTTPResponse.Status -func (r CreateEvmSmartAccountResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} + if params.XIdempotencyKey != nil { + var headerParam1 string -// StatusCode returns HTTPResponse.StatusCode -func (r CreateEvmSmartAccountResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} + headerParam1, err = runtime.StyleParamWithLocation("simple", false, "X-Idempotency-Key", runtime.ParamLocationHeader, *params.XIdempotencyKey) + if err != nil { + return nil, err + } -type GetEvmSmartAccountByNameResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *EvmSmartAccount - JSON400 *Error - JSON404 *Error - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError -} + req.Header.Set("X-Idempotency-Key", headerParam1) + } -// Status returns HTTPResponse.Status -func (r GetEvmSmartAccountByNameResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status } - return http.StatusText(0) + + return req, nil } -// StatusCode returns HTTPResponse.StatusCode -func (r GetEvmSmartAccountByNameResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// NewRequestSolanaFaucetRequest calls the generic RequestSolanaFaucet builder with application/json body +func NewRequestSolanaFaucetRequest(server string, body RequestSolanaFaucetJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err } - return 0 + bodyReader = bytes.NewReader(buf) + return NewRequestSolanaFaucetRequestWithBody(server, "application/json", bodyReader) } -type GetEvmSmartAccountResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *EvmSmartAccount - JSON400 *Error - JSON404 *Error - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError -} +// NewRequestSolanaFaucetRequestWithBody generates requests for RequestSolanaFaucet with any type of body +func NewRequestSolanaFaucetRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error -// Status returns HTTPResponse.Status -func (r GetEvmSmartAccountResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status + serverURL, err := url.Parse(server) + if err != nil { + return nil, err } - return http.StatusText(0) -} -// StatusCode returns HTTPResponse.StatusCode -func (r GetEvmSmartAccountResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode + operationPath := fmt.Sprintf("/v2/solana/faucet") + if operationPath[0] == '/' { + operationPath = "." + operationPath } - return 0 -} -type UpdateEvmSmartAccountResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *EvmSmartAccount - JSON400 *Error - JSON404 *Error - JSON409 *AlreadyExistsError - JSON422 *IdempotencyError - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError -} - -// Status returns HTTPResponse.Status -func (r UpdateEvmSmartAccountResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err } - return http.StatusText(0) -} -// StatusCode returns HTTPResponse.StatusCode -func (r UpdateEvmSmartAccountResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err } - return 0 -} -type CreateSpendPermissionResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *EvmUserOperation - JSON400 *Error - JSON404 *Error - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError -} + req.Header.Add("Content-Type", contentType) -// Status returns HTTPResponse.Status -func (r CreateSpendPermissionResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) + return req, nil } -// StatusCode returns HTTPResponse.StatusCode -func (r CreateSpendPermissionResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// NewListSolanaTokenBalancesRequest generates requests for ListSolanaTokenBalances +func NewListSolanaTokenBalancesRequest(server string, network ListSolanaTokenBalancesNetwork, address string, params *ListSolanaTokenBalancesParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "network", runtime.ParamLocationPath, network) + if err != nil { + return nil, err } - return 0 -} -type ListSpendPermissionsResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - // NextPageToken The token for the next page of items, if any. - NextPageToken *string `json:"nextPageToken,omitempty"` + var pathParam1 string - // SpendPermissions The spend permissions for the smart account. - SpendPermissions []SpendPermissionResponseObject `json:"spendPermissions"` + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "address", runtime.ParamLocationPath, address) + if err != nil { + return nil, err } - JSON400 *Error - JSON404 *Error - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError -} -// Status returns HTTPResponse.Status -func (r ListSpendPermissionsResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status + serverURL, err := url.Parse(server) + if err != nil { + return nil, err } - return http.StatusText(0) -} -// StatusCode returns HTTPResponse.StatusCode -func (r ListSpendPermissionsResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode + operationPath := fmt.Sprintf("/v2/solana/token-balances/%s/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath } - return 0 -} -type RevokeSpendPermissionResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *EvmUserOperation - JSON400 *Error - JSON404 *Error - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError -} + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } -// Status returns HTTPResponse.Status -func (r RevokeSpendPermissionResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status + if params != nil { + queryValues := queryURL.Query() + + if params.PageSize != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "pageSize", runtime.ParamLocationQuery, *params.PageSize); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.PageToken != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "pageToken", runtime.ParamLocationQuery, *params.PageToken); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() } - return http.StatusText(0) -} -// StatusCode returns HTTPResponse.StatusCode -func (r RevokeSpendPermissionResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err } - return 0 -} -type PrepareUserOperationResponse struct { - Body []byte - HTTPResponse *http.Response - JSON201 *EvmUserOperation - JSON400 *Error - JSON403 *Error - JSON404 *Error - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError + return req, nil } -// Status returns HTTPResponse.Status -func (r PrepareUserOperationResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// NewSettleX402PaymentRequest calls the generic SettleX402Payment builder with application/json body +func NewSettleX402PaymentRequest(server string, body SettleX402PaymentJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err } - return http.StatusText(0) + bodyReader = bytes.NewReader(buf) + return NewSettleX402PaymentRequestWithBody(server, "application/json", bodyReader) } -// StatusCode returns HTTPResponse.StatusCode -func (r PrepareUserOperationResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// NewSettleX402PaymentRequestWithBody generates requests for SettleX402Payment with any type of body +func NewSettleX402PaymentRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err } - return 0 -} -type PrepareAndSendUserOperationResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *EvmUserOperation - JSON400 *Error - JSON401 *UnauthorizedError - JSON402 *PaymentMethodRequiredError - JSON403 *Error - JSON404 *Error - JSON429 *Error - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError -} + operationPath := fmt.Sprintf("/v2/x402/settle") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } -// Status returns HTTPResponse.Status -func (r PrepareAndSendUserOperationResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err } - return http.StatusText(0) -} -// StatusCode returns HTTPResponse.StatusCode -func (r PrepareAndSendUserOperationResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err } - return 0 -} -type GetUserOperationResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *EvmUserOperation - JSON400 *Error - JSON404 *Error - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError -} + req.Header.Add("Content-Type", contentType) -// Status returns HTTPResponse.Status -func (r GetUserOperationResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) + return req, nil } -// StatusCode returns HTTPResponse.StatusCode -func (r GetUserOperationResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// NewSupportedX402PaymentKindsRequest generates requests for SupportedX402PaymentKinds +func NewSupportedX402PaymentKindsRequest(server string) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err } - return 0 -} -type SendUserOperationResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *EvmUserOperation - JSON400 *Error - JSON402 *PaymentMethodRequiredError - JSON403 *Error - JSON404 *Error - JSON429 *Error - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError -} + operationPath := fmt.Sprintf("/v2/x402/supported") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } -// Status returns HTTPResponse.Status -func (r SendUserOperationResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err } - return http.StatusText(0) -} -// StatusCode returns HTTPResponse.StatusCode -func (r SendUserOperationResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err } - return 0 -} -type CreateEvmSwapQuoteResponse struct { - Body []byte - HTTPResponse *http.Response - JSON201 *CreateSwapQuoteResponseWrapper - JSON400 *Error - JSON403 *Error - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError + return req, nil } -// Status returns HTTPResponse.Status -func (r CreateEvmSwapQuoteResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// NewVerifyX402PaymentRequest calls the generic VerifyX402Payment builder with application/json body +func NewVerifyX402PaymentRequest(server string, body VerifyX402PaymentJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err } - return http.StatusText(0) + bodyReader = bytes.NewReader(buf) + return NewVerifyX402PaymentRequestWithBody(server, "application/json", bodyReader) } -// StatusCode returns HTTPResponse.StatusCode -func (r CreateEvmSwapQuoteResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// NewVerifyX402PaymentRequestWithBody generates requests for VerifyX402Payment with any type of body +func NewVerifyX402PaymentRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err } - return 0 -} -type GetEvmSwapPriceResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *GetSwapPriceResponseWrapper - JSON400 *Error - JSON403 *Error - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError -} + operationPath := fmt.Sprintf("/v2/x402/verify") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } -// Status returns HTTPResponse.Status -func (r GetEvmSwapPriceResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err } - return http.StatusText(0) -} -// StatusCode returns HTTPResponse.StatusCode -func (r GetEvmSwapPriceResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err } - return 0 -} -type ListEvmTokenBalancesResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - // Balances The list of EVM token balances. - Balances []TokenBalance `json:"balances"` + req.Header.Add("Content-Type", contentType) - // NextPageToken The token for the next page of items, if any. - NextPageToken *string `json:"nextPageToken,omitempty"` - } - JSON400 *Error - JSON404 *Error - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError + return req, nil } -// Status returns HTTPResponse.Status -func (r ListEvmTokenBalancesResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +func (c *CDPClient) applyEditors(ctx context.Context, req *http.Request, additionalEditors []RequestEditorFn) error { + for _, r := range c.RequestEditors { + if err := r(ctx, req); err != nil { + return err + } } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r ListEvmTokenBalancesResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode + for _, r := range additionalEditors { + if err := r(ctx, req); err != nil { + return err + } } - return 0 + return nil } -type GetOnrampUserLimitsResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - // Limits The list of limits applicable to the user. - Limits []OnrampUserLimit `json:"limits"` - } - JSON400 *Error - JSON401 *UnauthorizedError - JSON429 *RateLimitExceeded - JSON500 *InternalServerError +// ClientWithResponses builds on ClientInterface to offer response payloads +type ClientWithResponses struct { + ClientInterface } -// Status returns HTTPResponse.Status -func (r GetOnrampUserLimitsResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// NewClientWithResponses creates a new ClientWithResponses, which wraps +// Client with return type handling +func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error) { + client, err := NewClient(server, opts...) + if err != nil { + return nil, err } - return http.StatusText(0) + return &ClientWithResponses{client}, nil } -// StatusCode returns HTTPResponse.StatusCode -func (r GetOnrampUserLimitsResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// WithBaseURL overrides the baseURL. +func WithBaseURL(baseURL string) ClientOption { + return func(c *CDPClient) error { + newBaseURL, err := url.Parse(baseURL) + if err != nil { + return err + } + c.Server = newBaseURL.String() + return nil } - return 0 } -type CreateOnrampOrderResponse struct { - Body []byte - HTTPResponse *http.Response - JSON201 *struct { - // Order An Onramp order. - Order OnrampOrder `json:"order"` +// ClientWithResponsesInterface is the interface specification for the client with responses above. +type ClientWithResponsesInterface interface { + // ListDataTokenBalancesWithResponse request + ListDataTokenBalancesWithResponse(ctx context.Context, network ListEvmTokenBalancesNetwork, address string, params *ListDataTokenBalancesParams, reqEditors ...RequestEditorFn) (*ListDataTokenBalancesResponse, error) - // PaymentLink A payment link to pay for an order. - // - // Please refer to the [Onramp docs](https://docs.cdp.coinbase.com/onramp-&-offramp/onramp-apis/onramp-overview) for details on how to integrate with the different payment link types. - PaymentLink *OnrampPaymentLink `json:"paymentLink,omitempty"` - } - JSON400 *Error - JSON401 *UnauthorizedError - JSON429 *RateLimitExceeded - JSON500 *InternalServerError -} + // ListTokensForAccountWithResponse request + ListTokensForAccountWithResponse(ctx context.Context, network ListTokensForAccountParamsNetwork, address string, reqEditors ...RequestEditorFn) (*ListTokensForAccountResponse, error) -// Status returns HTTPResponse.Status -func (r CreateOnrampOrderResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} + // GetSQLGrammarWithResponse request + GetSQLGrammarWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetSQLGrammarResponse, error) -// StatusCode returns HTTPResponse.StatusCode -func (r CreateOnrampOrderResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} + // RunSQLQueryWithBodyWithResponse request with any body + RunSQLQueryWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RunSQLQueryResponse, error) -type GetOnrampOrderByIdResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - // Order An Onramp order. - Order OnrampOrder `json:"order"` - } - JSON401 *UnauthorizedError - JSON404 *Error - JSON429 *RateLimitExceeded -} + RunSQLQueryWithResponse(ctx context.Context, body RunSQLQueryJSONRequestBody, reqEditors ...RequestEditorFn) (*RunSQLQueryResponse, error) -// Status returns HTTPResponse.Status -func (r GetOnrampOrderByIdResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} + // ListWebhookSubscriptionsWithResponse request + ListWebhookSubscriptionsWithResponse(ctx context.Context, params *ListWebhookSubscriptionsParams, reqEditors ...RequestEditorFn) (*ListWebhookSubscriptionsResponse, error) -// StatusCode returns HTTPResponse.StatusCode -func (r GetOnrampOrderByIdResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} + // CreateWebhookSubscriptionWithBodyWithResponse request with any body + CreateWebhookSubscriptionWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateWebhookSubscriptionResponse, error) -type CreateOnrampSessionResponse struct { - Body []byte - HTTPResponse *http.Response - JSON201 *struct { - // Quote Quote information with pricing details for the crypto purchase. - Quote *OnrampQuote `json:"quote,omitempty"` + CreateWebhookSubscriptionWithResponse(ctx context.Context, body CreateWebhookSubscriptionJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateWebhookSubscriptionResponse, error) - // Session An onramp session containing a ready-to-use onramp URL. - Session OnrampSession `json:"session"` - } - JSON400 *Error - JSON401 *UnauthorizedError - JSON429 *RateLimitExceeded - JSON500 *InternalServerError -} + // DeleteWebhookSubscriptionWithResponse request + DeleteWebhookSubscriptionWithResponse(ctx context.Context, subscriptionId openapi_types.UUID, reqEditors ...RequestEditorFn) (*DeleteWebhookSubscriptionResponse, error) -// Status returns HTTPResponse.Status -func (r CreateOnrampSessionResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} + // GetWebhookSubscriptionWithResponse request + GetWebhookSubscriptionWithResponse(ctx context.Context, subscriptionId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetWebhookSubscriptionResponse, error) -// StatusCode returns HTTPResponse.StatusCode -func (r CreateOnrampSessionResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} + // UpdateWebhookSubscriptionWithBodyWithResponse request with any body + UpdateWebhookSubscriptionWithBodyWithResponse(ctx context.Context, subscriptionId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateWebhookSubscriptionResponse, error) -type ListPoliciesResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - // NextPageToken The token for the next page of items, if any. - NextPageToken *string `json:"nextPageToken,omitempty"` + UpdateWebhookSubscriptionWithResponse(ctx context.Context, subscriptionId openapi_types.UUID, body UpdateWebhookSubscriptionJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateWebhookSubscriptionResponse, error) - // Policies The list of policies. - Policies []Policy `json:"policies"` - } - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError -} + // RevokeDelegationForEndUserWithBodyWithResponse request with any body + RevokeDelegationForEndUserWithBodyWithResponse(ctx context.Context, projectId string, userId string, params *RevokeDelegationForEndUserParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RevokeDelegationForEndUserResponse, error) -// Status returns HTTPResponse.Status -func (r ListPoliciesResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} + RevokeDelegationForEndUserWithResponse(ctx context.Context, projectId string, userId string, params *RevokeDelegationForEndUserParams, body RevokeDelegationForEndUserJSONRequestBody, reqEditors ...RequestEditorFn) (*RevokeDelegationForEndUserResponse, error) -// StatusCode returns HTTPResponse.StatusCode -func (r ListPoliciesResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} + // CreateEvmEip7702DelegationWithEndUserAccountWithBodyWithResponse request with any body + CreateEvmEip7702DelegationWithEndUserAccountWithBodyWithResponse(ctx context.Context, projectId string, userId string, params *CreateEvmEip7702DelegationWithEndUserAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateEvmEip7702DelegationWithEndUserAccountResponse, error) -type CreatePolicyResponse struct { - Body []byte - HTTPResponse *http.Response - JSON201 *Policy - JSON400 *Error - JSON409 *AlreadyExistsError - JSON422 *IdempotencyError - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError -} + CreateEvmEip7702DelegationWithEndUserAccountWithResponse(ctx context.Context, projectId string, userId string, params *CreateEvmEip7702DelegationWithEndUserAccountParams, body CreateEvmEip7702DelegationWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateEvmEip7702DelegationWithEndUserAccountResponse, error) -// Status returns HTTPResponse.Status -func (r CreatePolicyResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} + // SendEvmTransactionWithEndUserAccountWithBodyWithResponse request with any body + SendEvmTransactionWithEndUserAccountWithBodyWithResponse(ctx context.Context, projectId string, userId string, params *SendEvmTransactionWithEndUserAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SendEvmTransactionWithEndUserAccountResponse, error) -// StatusCode returns HTTPResponse.StatusCode -func (r CreatePolicyResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} + SendEvmTransactionWithEndUserAccountWithResponse(ctx context.Context, projectId string, userId string, params *SendEvmTransactionWithEndUserAccountParams, body SendEvmTransactionWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*SendEvmTransactionWithEndUserAccountResponse, error) -type DeletePolicyResponse struct { - Body []byte - HTTPResponse *http.Response - JSON400 *Error - JSON404 *Error - JSON409 *AlreadyExistsError - JSON422 *IdempotencyError - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError -} + // SignEvmHashWithEndUserAccountWithBodyWithResponse request with any body + SignEvmHashWithEndUserAccountWithBodyWithResponse(ctx context.Context, projectId string, userId string, params *SignEvmHashWithEndUserAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SignEvmHashWithEndUserAccountResponse, error) -// Status returns HTTPResponse.Status -func (r DeletePolicyResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} + SignEvmHashWithEndUserAccountWithResponse(ctx context.Context, projectId string, userId string, params *SignEvmHashWithEndUserAccountParams, body SignEvmHashWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*SignEvmHashWithEndUserAccountResponse, error) -// StatusCode returns HTTPResponse.StatusCode -func (r DeletePolicyResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} + // SignEvmMessageWithEndUserAccountWithBodyWithResponse request with any body + SignEvmMessageWithEndUserAccountWithBodyWithResponse(ctx context.Context, projectId string, userId string, params *SignEvmMessageWithEndUserAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SignEvmMessageWithEndUserAccountResponse, error) -type GetPolicyByIdResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *Policy - JSON404 *Error - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError -} + SignEvmMessageWithEndUserAccountWithResponse(ctx context.Context, projectId string, userId string, params *SignEvmMessageWithEndUserAccountParams, body SignEvmMessageWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*SignEvmMessageWithEndUserAccountResponse, error) -// Status returns HTTPResponse.Status -func (r GetPolicyByIdResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} + // SignEvmTransactionWithEndUserAccountWithBodyWithResponse request with any body + SignEvmTransactionWithEndUserAccountWithBodyWithResponse(ctx context.Context, projectId string, userId string, params *SignEvmTransactionWithEndUserAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SignEvmTransactionWithEndUserAccountResponse, error) -// StatusCode returns HTTPResponse.StatusCode -func (r GetPolicyByIdResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} + SignEvmTransactionWithEndUserAccountWithResponse(ctx context.Context, projectId string, userId string, params *SignEvmTransactionWithEndUserAccountParams, body SignEvmTransactionWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*SignEvmTransactionWithEndUserAccountResponse, error) -type UpdatePolicyResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *Policy - JSON400 *Error - JSON404 *Error - JSON409 *AlreadyExistsError - JSON422 *IdempotencyError - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError -} + // SignEvmTypedDataWithEndUserAccountWithBodyWithResponse request with any body + SignEvmTypedDataWithEndUserAccountWithBodyWithResponse(ctx context.Context, projectId string, userId string, params *SignEvmTypedDataWithEndUserAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SignEvmTypedDataWithEndUserAccountResponse, error) -// Status returns HTTPResponse.Status -func (r UpdatePolicyResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} + SignEvmTypedDataWithEndUserAccountWithResponse(ctx context.Context, projectId string, userId string, params *SignEvmTypedDataWithEndUserAccountParams, body SignEvmTypedDataWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*SignEvmTypedDataWithEndUserAccountResponse, error) -// StatusCode returns HTTPResponse.StatusCode -func (r UpdatePolicyResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} + // SendUserOperationWithEndUserAccountWithBodyWithResponse request with any body + SendUserOperationWithEndUserAccountWithBodyWithResponse(ctx context.Context, projectId string, userId string, address string, params *SendUserOperationWithEndUserAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SendUserOperationWithEndUserAccountResponse, error) -type ListSolanaAccountsResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - // Accounts The list of Solana accounts. - Accounts []SolanaAccount `json:"accounts"` + SendUserOperationWithEndUserAccountWithResponse(ctx context.Context, projectId string, userId string, address string, params *SendUserOperationWithEndUserAccountParams, body SendUserOperationWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*SendUserOperationWithEndUserAccountResponse, error) - // NextPageToken The token for the next page of items, if any. - NextPageToken *string `json:"nextPageToken,omitempty"` - } - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError -} + // RevokeSpendPermissionWithEndUserAccountWithBodyWithResponse request with any body + RevokeSpendPermissionWithEndUserAccountWithBodyWithResponse(ctx context.Context, projectId string, userId string, address string, params *RevokeSpendPermissionWithEndUserAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RevokeSpendPermissionWithEndUserAccountResponse, error) -// Status returns HTTPResponse.Status -func (r ListSolanaAccountsResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} + RevokeSpendPermissionWithEndUserAccountWithResponse(ctx context.Context, projectId string, userId string, address string, params *RevokeSpendPermissionWithEndUserAccountParams, body RevokeSpendPermissionWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*RevokeSpendPermissionWithEndUserAccountResponse, error) -// StatusCode returns HTTPResponse.StatusCode -func (r ListSolanaAccountsResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} + // SendEvmAssetWithEndUserAccountWithBodyWithResponse request with any body + SendEvmAssetWithEndUserAccountWithBodyWithResponse(ctx context.Context, projectId string, userId string, address BlockchainAddress, asset Asset, params *SendEvmAssetWithEndUserAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SendEvmAssetWithEndUserAccountResponse, error) -type CreateSolanaAccountResponse struct { - Body []byte - HTTPResponse *http.Response - JSON201 *SolanaAccount - JSON400 *Error - JSON401 *Error - JSON402 *PaymentMethodRequiredError - JSON409 *Error - JSON422 *IdempotencyError - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError -} + SendEvmAssetWithEndUserAccountWithResponse(ctx context.Context, projectId string, userId string, address BlockchainAddress, asset Asset, params *SendEvmAssetWithEndUserAccountParams, body SendEvmAssetWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*SendEvmAssetWithEndUserAccountResponse, error) -// Status returns HTTPResponse.Status -func (r CreateSolanaAccountResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} + // SendSolanaTransactionWithEndUserAccountWithBodyWithResponse request with any body + SendSolanaTransactionWithEndUserAccountWithBodyWithResponse(ctx context.Context, projectId string, userId string, params *SendSolanaTransactionWithEndUserAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SendSolanaTransactionWithEndUserAccountResponse, error) -// StatusCode returns HTTPResponse.StatusCode -func (r CreateSolanaAccountResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} + SendSolanaTransactionWithEndUserAccountWithResponse(ctx context.Context, projectId string, userId string, params *SendSolanaTransactionWithEndUserAccountParams, body SendSolanaTransactionWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*SendSolanaTransactionWithEndUserAccountResponse, error) -type GetSolanaAccountByNameResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *SolanaAccount - JSON400 *Error - JSON404 *Error - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError -} + // SignSolanaHashWithEndUserAccountWithBodyWithResponse request with any body + SignSolanaHashWithEndUserAccountWithBodyWithResponse(ctx context.Context, projectId string, userId string, params *SignSolanaHashWithEndUserAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SignSolanaHashWithEndUserAccountResponse, error) -// Status returns HTTPResponse.Status -func (r GetSolanaAccountByNameResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} + SignSolanaHashWithEndUserAccountWithResponse(ctx context.Context, projectId string, userId string, params *SignSolanaHashWithEndUserAccountParams, body SignSolanaHashWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*SignSolanaHashWithEndUserAccountResponse, error) -// StatusCode returns HTTPResponse.StatusCode -func (r GetSolanaAccountByNameResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} + // SignSolanaMessageWithEndUserAccountWithBodyWithResponse request with any body + SignSolanaMessageWithEndUserAccountWithBodyWithResponse(ctx context.Context, projectId string, userId string, params *SignSolanaMessageWithEndUserAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SignSolanaMessageWithEndUserAccountResponse, error) -type ExportSolanaAccountByNameResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - // EncryptedPrivateKey The base64-encoded, encrypted private key of the Solana account which is a 32 byte raw private key. The private key is encrypted in transport using the exportEncryptionKey in the request. - EncryptedPrivateKey string `json:"encryptedPrivateKey"` - } - JSON400 *Error - JSON401 *Error - JSON402 *PaymentMethodRequiredError + SignSolanaMessageWithEndUserAccountWithResponse(ctx context.Context, projectId string, userId string, params *SignSolanaMessageWithEndUserAccountParams, body SignSolanaMessageWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*SignSolanaMessageWithEndUserAccountResponse, error) + + // SignSolanaTransactionWithEndUserAccountWithBodyWithResponse request with any body + SignSolanaTransactionWithEndUserAccountWithBodyWithResponse(ctx context.Context, projectId string, userId string, params *SignSolanaTransactionWithEndUserAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SignSolanaTransactionWithEndUserAccountResponse, error) + + SignSolanaTransactionWithEndUserAccountWithResponse(ctx context.Context, projectId string, userId string, params *SignSolanaTransactionWithEndUserAccountParams, body SignSolanaTransactionWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*SignSolanaTransactionWithEndUserAccountResponse, error) + + // SendSolanaAssetWithEndUserAccountWithBodyWithResponse request with any body + SendSolanaAssetWithEndUserAccountWithBodyWithResponse(ctx context.Context, projectId string, userId string, address BlockchainAddress, asset Asset, params *SendSolanaAssetWithEndUserAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SendSolanaAssetWithEndUserAccountResponse, error) + + SendSolanaAssetWithEndUserAccountWithResponse(ctx context.Context, projectId string, userId string, address BlockchainAddress, asset Asset, params *SendSolanaAssetWithEndUserAccountParams, body SendSolanaAssetWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*SendSolanaAssetWithEndUserAccountResponse, error) + + // ListEndUsersWithResponse request + ListEndUsersWithResponse(ctx context.Context, params *ListEndUsersParams, reqEditors ...RequestEditorFn) (*ListEndUsersResponse, error) + + // CreateEndUserWithBodyWithResponse request with any body + CreateEndUserWithBodyWithResponse(ctx context.Context, params *CreateEndUserParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateEndUserResponse, error) + + CreateEndUserWithResponse(ctx context.Context, params *CreateEndUserParams, body CreateEndUserJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateEndUserResponse, error) + + // ValidateEndUserAccessTokenWithBodyWithResponse request with any body + ValidateEndUserAccessTokenWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ValidateEndUserAccessTokenResponse, error) + + ValidateEndUserAccessTokenWithResponse(ctx context.Context, body ValidateEndUserAccessTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*ValidateEndUserAccessTokenResponse, error) + + // ImportEndUserWithBodyWithResponse request with any body + ImportEndUserWithBodyWithResponse(ctx context.Context, params *ImportEndUserParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ImportEndUserResponse, error) + + ImportEndUserWithResponse(ctx context.Context, params *ImportEndUserParams, body ImportEndUserJSONRequestBody, reqEditors ...RequestEditorFn) (*ImportEndUserResponse, error) + + // GetEndUserWithResponse request + GetEndUserWithResponse(ctx context.Context, userId string, reqEditors ...RequestEditorFn) (*GetEndUserResponse, error) + + // AddEndUserEvmAccountWithBodyWithResponse request with any body + AddEndUserEvmAccountWithBodyWithResponse(ctx context.Context, userId string, params *AddEndUserEvmAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AddEndUserEvmAccountResponse, error) + + AddEndUserEvmAccountWithResponse(ctx context.Context, userId string, params *AddEndUserEvmAccountParams, body AddEndUserEvmAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*AddEndUserEvmAccountResponse, error) + + // AddEndUserEvmSmartAccountWithBodyWithResponse request with any body + AddEndUserEvmSmartAccountWithBodyWithResponse(ctx context.Context, userId string, params *AddEndUserEvmSmartAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AddEndUserEvmSmartAccountResponse, error) + + AddEndUserEvmSmartAccountWithResponse(ctx context.Context, userId string, params *AddEndUserEvmSmartAccountParams, body AddEndUserEvmSmartAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*AddEndUserEvmSmartAccountResponse, error) + + // AddEndUserSolanaAccountWithBodyWithResponse request with any body + AddEndUserSolanaAccountWithBodyWithResponse(ctx context.Context, userId string, params *AddEndUserSolanaAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AddEndUserSolanaAccountResponse, error) + + AddEndUserSolanaAccountWithResponse(ctx context.Context, userId string, params *AddEndUserSolanaAccountParams, body AddEndUserSolanaAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*AddEndUserSolanaAccountResponse, error) + + // ListEvmAccountsWithResponse request + ListEvmAccountsWithResponse(ctx context.Context, params *ListEvmAccountsParams, reqEditors ...RequestEditorFn) (*ListEvmAccountsResponse, error) + + // CreateEvmAccountWithBodyWithResponse request with any body + CreateEvmAccountWithBodyWithResponse(ctx context.Context, params *CreateEvmAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateEvmAccountResponse, error) + + CreateEvmAccountWithResponse(ctx context.Context, params *CreateEvmAccountParams, body CreateEvmAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateEvmAccountResponse, error) + + // GetEvmAccountByNameWithResponse request + GetEvmAccountByNameWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*GetEvmAccountByNameResponse, error) + + // ExportEvmAccountByNameWithBodyWithResponse request with any body + ExportEvmAccountByNameWithBodyWithResponse(ctx context.Context, name string, params *ExportEvmAccountByNameParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ExportEvmAccountByNameResponse, error) + + ExportEvmAccountByNameWithResponse(ctx context.Context, name string, params *ExportEvmAccountByNameParams, body ExportEvmAccountByNameJSONRequestBody, reqEditors ...RequestEditorFn) (*ExportEvmAccountByNameResponse, error) + + // ImportEvmAccountWithBodyWithResponse request with any body + ImportEvmAccountWithBodyWithResponse(ctx context.Context, params *ImportEvmAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ImportEvmAccountResponse, error) + + ImportEvmAccountWithResponse(ctx context.Context, params *ImportEvmAccountParams, body ImportEvmAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*ImportEvmAccountResponse, error) + + // GetEvmAccountWithResponse request + GetEvmAccountWithResponse(ctx context.Context, address string, reqEditors ...RequestEditorFn) (*GetEvmAccountResponse, error) + + // UpdateEvmAccountWithBodyWithResponse request with any body + UpdateEvmAccountWithBodyWithResponse(ctx context.Context, address string, params *UpdateEvmAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateEvmAccountResponse, error) + + UpdateEvmAccountWithResponse(ctx context.Context, address string, params *UpdateEvmAccountParams, body UpdateEvmAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateEvmAccountResponse, error) + + // CreateEvmEip7702DelegationWithBodyWithResponse request with any body + CreateEvmEip7702DelegationWithBodyWithResponse(ctx context.Context, address string, params *CreateEvmEip7702DelegationParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateEvmEip7702DelegationResponse, error) + + CreateEvmEip7702DelegationWithResponse(ctx context.Context, address string, params *CreateEvmEip7702DelegationParams, body CreateEvmEip7702DelegationJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateEvmEip7702DelegationResponse, error) + + // ExportEvmAccountWithBodyWithResponse request with any body + ExportEvmAccountWithBodyWithResponse(ctx context.Context, address string, params *ExportEvmAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ExportEvmAccountResponse, error) + + ExportEvmAccountWithResponse(ctx context.Context, address string, params *ExportEvmAccountParams, body ExportEvmAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*ExportEvmAccountResponse, error) + + // SendEvmTransactionWithBodyWithResponse request with any body + SendEvmTransactionWithBodyWithResponse(ctx context.Context, address string, params *SendEvmTransactionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SendEvmTransactionResponse, error) + + SendEvmTransactionWithResponse(ctx context.Context, address string, params *SendEvmTransactionParams, body SendEvmTransactionJSONRequestBody, reqEditors ...RequestEditorFn) (*SendEvmTransactionResponse, error) + + // SignEvmHashWithBodyWithResponse request with any body + SignEvmHashWithBodyWithResponse(ctx context.Context, address string, params *SignEvmHashParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SignEvmHashResponse, error) + + SignEvmHashWithResponse(ctx context.Context, address string, params *SignEvmHashParams, body SignEvmHashJSONRequestBody, reqEditors ...RequestEditorFn) (*SignEvmHashResponse, error) + + // SignEvmMessageWithBodyWithResponse request with any body + SignEvmMessageWithBodyWithResponse(ctx context.Context, address string, params *SignEvmMessageParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SignEvmMessageResponse, error) + + SignEvmMessageWithResponse(ctx context.Context, address string, params *SignEvmMessageParams, body SignEvmMessageJSONRequestBody, reqEditors ...RequestEditorFn) (*SignEvmMessageResponse, error) + + // SignEvmTransactionWithBodyWithResponse request with any body + SignEvmTransactionWithBodyWithResponse(ctx context.Context, address string, params *SignEvmTransactionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SignEvmTransactionResponse, error) + + SignEvmTransactionWithResponse(ctx context.Context, address string, params *SignEvmTransactionParams, body SignEvmTransactionJSONRequestBody, reqEditors ...RequestEditorFn) (*SignEvmTransactionResponse, error) + + // SignEvmTypedDataWithBodyWithResponse request with any body + SignEvmTypedDataWithBodyWithResponse(ctx context.Context, address string, params *SignEvmTypedDataParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SignEvmTypedDataResponse, error) + + SignEvmTypedDataWithResponse(ctx context.Context, address string, params *SignEvmTypedDataParams, body SignEvmTypedDataJSONRequestBody, reqEditors ...RequestEditorFn) (*SignEvmTypedDataResponse, error) + + // GetEvmEip7702DelegationOperationByIdWithResponse request + GetEvmEip7702DelegationOperationByIdWithResponse(ctx context.Context, delegationOperationId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetEvmEip7702DelegationOperationByIdResponse, error) + + // RequestEvmFaucetWithBodyWithResponse request with any body + RequestEvmFaucetWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RequestEvmFaucetResponse, error) + + RequestEvmFaucetWithResponse(ctx context.Context, body RequestEvmFaucetJSONRequestBody, reqEditors ...RequestEditorFn) (*RequestEvmFaucetResponse, error) + + // ListEvmSmartAccountsWithResponse request + ListEvmSmartAccountsWithResponse(ctx context.Context, params *ListEvmSmartAccountsParams, reqEditors ...RequestEditorFn) (*ListEvmSmartAccountsResponse, error) + + // CreateEvmSmartAccountWithBodyWithResponse request with any body + CreateEvmSmartAccountWithBodyWithResponse(ctx context.Context, params *CreateEvmSmartAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateEvmSmartAccountResponse, error) + + CreateEvmSmartAccountWithResponse(ctx context.Context, params *CreateEvmSmartAccountParams, body CreateEvmSmartAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateEvmSmartAccountResponse, error) + + // GetEvmSmartAccountByNameWithResponse request + GetEvmSmartAccountByNameWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*GetEvmSmartAccountByNameResponse, error) + + // GetEvmSmartAccountWithResponse request + GetEvmSmartAccountWithResponse(ctx context.Context, address string, reqEditors ...RequestEditorFn) (*GetEvmSmartAccountResponse, error) + + // UpdateEvmSmartAccountWithBodyWithResponse request with any body + UpdateEvmSmartAccountWithBodyWithResponse(ctx context.Context, address string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateEvmSmartAccountResponse, error) + + UpdateEvmSmartAccountWithResponse(ctx context.Context, address string, body UpdateEvmSmartAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateEvmSmartAccountResponse, error) + + // CreateSpendPermissionWithBodyWithResponse request with any body + CreateSpendPermissionWithBodyWithResponse(ctx context.Context, address string, params *CreateSpendPermissionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateSpendPermissionResponse, error) + + CreateSpendPermissionWithResponse(ctx context.Context, address string, params *CreateSpendPermissionParams, body CreateSpendPermissionJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateSpendPermissionResponse, error) + + // ListSpendPermissionsWithResponse request + ListSpendPermissionsWithResponse(ctx context.Context, address string, params *ListSpendPermissionsParams, reqEditors ...RequestEditorFn) (*ListSpendPermissionsResponse, error) + + // RevokeSpendPermissionWithBodyWithResponse request with any body + RevokeSpendPermissionWithBodyWithResponse(ctx context.Context, address string, params *RevokeSpendPermissionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RevokeSpendPermissionResponse, error) + + RevokeSpendPermissionWithResponse(ctx context.Context, address string, params *RevokeSpendPermissionParams, body RevokeSpendPermissionJSONRequestBody, reqEditors ...RequestEditorFn) (*RevokeSpendPermissionResponse, error) + + // PrepareUserOperationWithBodyWithResponse request with any body + PrepareUserOperationWithBodyWithResponse(ctx context.Context, address string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PrepareUserOperationResponse, error) + + PrepareUserOperationWithResponse(ctx context.Context, address string, body PrepareUserOperationJSONRequestBody, reqEditors ...RequestEditorFn) (*PrepareUserOperationResponse, error) + + // PrepareAndSendUserOperationWithBodyWithResponse request with any body + PrepareAndSendUserOperationWithBodyWithResponse(ctx context.Context, address string, params *PrepareAndSendUserOperationParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PrepareAndSendUserOperationResponse, error) + + PrepareAndSendUserOperationWithResponse(ctx context.Context, address string, params *PrepareAndSendUserOperationParams, body PrepareAndSendUserOperationJSONRequestBody, reqEditors ...RequestEditorFn) (*PrepareAndSendUserOperationResponse, error) + + // GetUserOperationWithResponse request + GetUserOperationWithResponse(ctx context.Context, address string, userOpHash string, reqEditors ...RequestEditorFn) (*GetUserOperationResponse, error) + + // SendUserOperationWithBodyWithResponse request with any body + SendUserOperationWithBodyWithResponse(ctx context.Context, address string, userOpHash string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SendUserOperationResponse, error) + + SendUserOperationWithResponse(ctx context.Context, address string, userOpHash string, body SendUserOperationJSONRequestBody, reqEditors ...RequestEditorFn) (*SendUserOperationResponse, error) + + // CreateEvmSwapQuoteWithBodyWithResponse request with any body + CreateEvmSwapQuoteWithBodyWithResponse(ctx context.Context, params *CreateEvmSwapQuoteParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateEvmSwapQuoteResponse, error) + + CreateEvmSwapQuoteWithResponse(ctx context.Context, params *CreateEvmSwapQuoteParams, body CreateEvmSwapQuoteJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateEvmSwapQuoteResponse, error) + + // GetEvmSwapPriceWithResponse request + GetEvmSwapPriceWithResponse(ctx context.Context, params *GetEvmSwapPriceParams, reqEditors ...RequestEditorFn) (*GetEvmSwapPriceResponse, error) + + // ListEvmTokenBalancesWithResponse request + ListEvmTokenBalancesWithResponse(ctx context.Context, network ListEvmTokenBalancesNetwork, address string, params *ListEvmTokenBalancesParams, reqEditors ...RequestEditorFn) (*ListEvmTokenBalancesResponse, error) + + // GetOnrampUserLimitsWithBodyWithResponse request with any body + GetOnrampUserLimitsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*GetOnrampUserLimitsResponse, error) + + GetOnrampUserLimitsWithResponse(ctx context.Context, body GetOnrampUserLimitsJSONRequestBody, reqEditors ...RequestEditorFn) (*GetOnrampUserLimitsResponse, error) + + // CreateOnrampOrderWithBodyWithResponse request with any body + CreateOnrampOrderWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateOnrampOrderResponse, error) + + CreateOnrampOrderWithResponse(ctx context.Context, body CreateOnrampOrderJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateOnrampOrderResponse, error) + + // GetOnrampOrderByIdWithResponse request + GetOnrampOrderByIdWithResponse(ctx context.Context, orderId string, reqEditors ...RequestEditorFn) (*GetOnrampOrderByIdResponse, error) + + // CreateOnrampSessionWithBodyWithResponse request with any body + CreateOnrampSessionWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateOnrampSessionResponse, error) + + CreateOnrampSessionWithResponse(ctx context.Context, body CreateOnrampSessionJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateOnrampSessionResponse, error) + + // ListPoliciesWithResponse request + ListPoliciesWithResponse(ctx context.Context, params *ListPoliciesParams, reqEditors ...RequestEditorFn) (*ListPoliciesResponse, error) + + // CreatePolicyWithBodyWithResponse request with any body + CreatePolicyWithBodyWithResponse(ctx context.Context, params *CreatePolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreatePolicyResponse, error) + + CreatePolicyWithResponse(ctx context.Context, params *CreatePolicyParams, body CreatePolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*CreatePolicyResponse, error) + + // DeletePolicyWithResponse request + DeletePolicyWithResponse(ctx context.Context, policyId string, params *DeletePolicyParams, reqEditors ...RequestEditorFn) (*DeletePolicyResponse, error) + + // GetPolicyByIdWithResponse request + GetPolicyByIdWithResponse(ctx context.Context, policyId string, reqEditors ...RequestEditorFn) (*GetPolicyByIdResponse, error) + + // UpdatePolicyWithBodyWithResponse request with any body + UpdatePolicyWithBodyWithResponse(ctx context.Context, policyId string, params *UpdatePolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdatePolicyResponse, error) + + UpdatePolicyWithResponse(ctx context.Context, policyId string, params *UpdatePolicyParams, body UpdatePolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdatePolicyResponse, error) + + // ListSolanaAccountsWithResponse request + ListSolanaAccountsWithResponse(ctx context.Context, params *ListSolanaAccountsParams, reqEditors ...RequestEditorFn) (*ListSolanaAccountsResponse, error) + + // CreateSolanaAccountWithBodyWithResponse request with any body + CreateSolanaAccountWithBodyWithResponse(ctx context.Context, params *CreateSolanaAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateSolanaAccountResponse, error) + + CreateSolanaAccountWithResponse(ctx context.Context, params *CreateSolanaAccountParams, body CreateSolanaAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateSolanaAccountResponse, error) + + // GetSolanaAccountByNameWithResponse request + GetSolanaAccountByNameWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*GetSolanaAccountByNameResponse, error) + + // ExportSolanaAccountByNameWithBodyWithResponse request with any body + ExportSolanaAccountByNameWithBodyWithResponse(ctx context.Context, name string, params *ExportSolanaAccountByNameParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ExportSolanaAccountByNameResponse, error) + + ExportSolanaAccountByNameWithResponse(ctx context.Context, name string, params *ExportSolanaAccountByNameParams, body ExportSolanaAccountByNameJSONRequestBody, reqEditors ...RequestEditorFn) (*ExportSolanaAccountByNameResponse, error) + + // ImportSolanaAccountWithBodyWithResponse request with any body + ImportSolanaAccountWithBodyWithResponse(ctx context.Context, params *ImportSolanaAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ImportSolanaAccountResponse, error) + + ImportSolanaAccountWithResponse(ctx context.Context, params *ImportSolanaAccountParams, body ImportSolanaAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*ImportSolanaAccountResponse, error) + + // SendSolanaTransactionWithBodyWithResponse request with any body + SendSolanaTransactionWithBodyWithResponse(ctx context.Context, params *SendSolanaTransactionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SendSolanaTransactionResponse, error) + + SendSolanaTransactionWithResponse(ctx context.Context, params *SendSolanaTransactionParams, body SendSolanaTransactionJSONRequestBody, reqEditors ...RequestEditorFn) (*SendSolanaTransactionResponse, error) + + // GetSolanaAccountWithResponse request + GetSolanaAccountWithResponse(ctx context.Context, address string, reqEditors ...RequestEditorFn) (*GetSolanaAccountResponse, error) + + // UpdateSolanaAccountWithBodyWithResponse request with any body + UpdateSolanaAccountWithBodyWithResponse(ctx context.Context, address string, params *UpdateSolanaAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateSolanaAccountResponse, error) + + UpdateSolanaAccountWithResponse(ctx context.Context, address string, params *UpdateSolanaAccountParams, body UpdateSolanaAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateSolanaAccountResponse, error) + + // ExportSolanaAccountWithBodyWithResponse request with any body + ExportSolanaAccountWithBodyWithResponse(ctx context.Context, address string, params *ExportSolanaAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ExportSolanaAccountResponse, error) + + ExportSolanaAccountWithResponse(ctx context.Context, address string, params *ExportSolanaAccountParams, body ExportSolanaAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*ExportSolanaAccountResponse, error) + + // SignSolanaMessageWithBodyWithResponse request with any body + SignSolanaMessageWithBodyWithResponse(ctx context.Context, address string, params *SignSolanaMessageParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SignSolanaMessageResponse, error) + + SignSolanaMessageWithResponse(ctx context.Context, address string, params *SignSolanaMessageParams, body SignSolanaMessageJSONRequestBody, reqEditors ...RequestEditorFn) (*SignSolanaMessageResponse, error) + + // SignSolanaTransactionWithBodyWithResponse request with any body + SignSolanaTransactionWithBodyWithResponse(ctx context.Context, address string, params *SignSolanaTransactionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SignSolanaTransactionResponse, error) + + SignSolanaTransactionWithResponse(ctx context.Context, address string, params *SignSolanaTransactionParams, body SignSolanaTransactionJSONRequestBody, reqEditors ...RequestEditorFn) (*SignSolanaTransactionResponse, error) + + // RequestSolanaFaucetWithBodyWithResponse request with any body + RequestSolanaFaucetWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RequestSolanaFaucetResponse, error) + + RequestSolanaFaucetWithResponse(ctx context.Context, body RequestSolanaFaucetJSONRequestBody, reqEditors ...RequestEditorFn) (*RequestSolanaFaucetResponse, error) + + // ListSolanaTokenBalancesWithResponse request + ListSolanaTokenBalancesWithResponse(ctx context.Context, network ListSolanaTokenBalancesNetwork, address string, params *ListSolanaTokenBalancesParams, reqEditors ...RequestEditorFn) (*ListSolanaTokenBalancesResponse, error) + + // SettleX402PaymentWithBodyWithResponse request with any body + SettleX402PaymentWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SettleX402PaymentResponse, error) + + SettleX402PaymentWithResponse(ctx context.Context, body SettleX402PaymentJSONRequestBody, reqEditors ...RequestEditorFn) (*SettleX402PaymentResponse, error) + + // SupportedX402PaymentKindsWithResponse request + SupportedX402PaymentKindsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*SupportedX402PaymentKindsResponse, error) + + // VerifyX402PaymentWithBodyWithResponse request with any body + VerifyX402PaymentWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*VerifyX402PaymentResponse, error) + + VerifyX402PaymentWithResponse(ctx context.Context, body VerifyX402PaymentJSONRequestBody, reqEditors ...RequestEditorFn) (*VerifyX402PaymentResponse, error) +} + +type ListDataTokenBalancesResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + // Balances The list of EVM token balances. + Balances []TokenBalance `json:"balances"` + + // NextPageToken The token for the next page of items, if any. + NextPageToken *string `json:"nextPageToken,omitempty"` + } + JSON400 *Error + JSON404 *Error + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r ListDataTokenBalancesResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ListDataTokenBalancesResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ListTokensForAccountResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *AccountTokenAddressesResponse + JSON400 *Error + JSON401 *UnauthorizedError + JSON429 *Error + JSON500 *InternalServerError +} + +// Status returns HTTPResponse.Status +func (r ListTokensForAccountResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ListTokensForAccountResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetSQLGrammarResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *string + JSON401 *UnauthorizedError + JSON429 *Error + JSON500 *InternalServerError + JSON504 *TimedOutError +} + +// Status returns HTTPResponse.Status +func (r GetSQLGrammarResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetSQLGrammarResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type RunSQLQueryResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *OnchainDataResult + JSON400 *InvalidSQLQueryError + JSON401 *UnauthorizedError + JSON402 *PaymentMethodRequiredError + JSON408 *Error + JSON429 *Error + JSON499 *ClientClosedRequestError + JSON500 *InternalServerError + JSON504 *TimedOutError +} + +// Status returns HTTPResponse.Status +func (r RunSQLQueryResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r RunSQLQueryResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ListWebhookSubscriptionsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *WebhookSubscriptionListResponse + JSON400 *Error + JSON401 *UnauthorizedError + JSON429 *Error + JSON500 *InternalServerError +} + +// Status returns HTTPResponse.Status +func (r ListWebhookSubscriptionsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ListWebhookSubscriptionsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type CreateWebhookSubscriptionResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *WebhookSubscriptionResponse + JSON400 *Error + JSON401 *UnauthorizedError + JSON429 *Error + JSON500 *InternalServerError +} + +// Status returns HTTPResponse.Status +func (r CreateWebhookSubscriptionResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r CreateWebhookSubscriptionResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type DeleteWebhookSubscriptionResponse struct { + Body []byte + HTTPResponse *http.Response + JSON401 *UnauthorizedError + JSON404 *Error + JSON429 *Error + JSON500 *InternalServerError +} + +// Status returns HTTPResponse.Status +func (r DeleteWebhookSubscriptionResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteWebhookSubscriptionResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetWebhookSubscriptionResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *WebhookSubscriptionResponse + JSON401 *UnauthorizedError + JSON404 *Error + JSON429 *Error + JSON500 *InternalServerError +} + +// Status returns HTTPResponse.Status +func (r GetWebhookSubscriptionResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetWebhookSubscriptionResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type UpdateWebhookSubscriptionResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *WebhookSubscriptionResponse + JSON400 *Error + JSON401 *UnauthorizedError + JSON404 *Error + JSON429 *Error + JSON500 *InternalServerError +} + +// Status returns HTTPResponse.Status +func (r UpdateWebhookSubscriptionResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r UpdateWebhookSubscriptionResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type RevokeDelegationForEndUserResponse struct { + Body []byte + HTTPResponse *http.Response + JSON401 *UnauthorizedError + JSON404 *Error + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r RevokeDelegationForEndUserResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r RevokeDelegationForEndUserResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type CreateEvmEip7702DelegationWithEndUserAccountResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *struct { + // DelegationOperationId The unique identifier for the delegation operation. Use this to poll the operation status. + DelegationOperationId openapi_types.UUID `json:"delegationOperationId"` + } + JSON400 *Error + JSON401 *UnauthorizedError + JSON402 *PaymentMethodRequiredError + JSON404 *Error + JSON409 *Error + JSON422 *IdempotencyError + JSON429 *Error + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r CreateEvmEip7702DelegationWithEndUserAccountResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r CreateEvmEip7702DelegationWithEndUserAccountResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type SendEvmTransactionWithEndUserAccountResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + // TransactionHash The hash of the transaction, as a 0x-prefixed hex string. + TransactionHash string `json:"transactionHash"` + } + JSON400 *Error + JSON401 *UnauthorizedError + JSON402 *PaymentMethodRequiredError + JSON403 *Error + JSON404 *Error + JSON409 *AlreadyExistsError + JSON422 *IdempotencyError + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r SendEvmTransactionWithEndUserAccountResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r SendEvmTransactionWithEndUserAccountResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type SignEvmHashWithEndUserAccountResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + // Signature The signature of the hash, as a 0x-prefixed hex string. + Signature string `json:"signature"` + } + JSON400 *Error + JSON401 *UnauthorizedError + JSON402 *PaymentMethodRequiredError + JSON404 *Error + JSON409 *AlreadyExistsError + JSON422 *IdempotencyError + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r SignEvmHashWithEndUserAccountResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r SignEvmHashWithEndUserAccountResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type SignEvmMessageWithEndUserAccountResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + // Signature The signature of the message, as a 0x-prefixed hex string. + Signature string `json:"signature"` + } + JSON401 *UnauthorizedError + JSON402 *PaymentMethodRequiredError + JSON404 *Error + JSON409 *AlreadyExistsError + JSON422 *IdempotencyError + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r SignEvmMessageWithEndUserAccountResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r SignEvmMessageWithEndUserAccountResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type SignEvmTransactionWithEndUserAccountResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + // SignedTransaction The RLP-encoded signed transaction, as a 0x-prefixed hex string. + SignedTransaction string `json:"signedTransaction"` + } + JSON400 *Error + JSON401 *UnauthorizedError + JSON402 *PaymentMethodRequiredError + JSON403 *Error + JSON404 *Error + JSON409 *AlreadyExistsError + JSON422 *IdempotencyError + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r SignEvmTransactionWithEndUserAccountResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r SignEvmTransactionWithEndUserAccountResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type SignEvmTypedDataWithEndUserAccountResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + // Signature The signature of the typed data, as a 0x-prefixed hex string. + Signature string `json:"signature"` + } + JSON400 *Error + JSON401 *UnauthorizedError + JSON402 *PaymentMethodRequiredError + JSON404 *Error + JSON422 *IdempotencyError + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r SignEvmTypedDataWithEndUserAccountResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r SignEvmTypedDataWithEndUserAccountResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type SendUserOperationWithEndUserAccountResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *EvmUserOperation + JSON400 *Error + JSON401 *UnauthorizedError + JSON402 *PaymentMethodRequiredError + JSON403 *Error + JSON404 *Error + JSON429 *Error + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r SendUserOperationWithEndUserAccountResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r SendUserOperationWithEndUserAccountResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type RevokeSpendPermissionWithEndUserAccountResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *EvmUserOperation + JSON400 *Error + JSON401 *UnauthorizedError + JSON404 *Error + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r RevokeSpendPermissionWithEndUserAccountResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r RevokeSpendPermissionWithEndUserAccountResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type SendEvmAssetWithEndUserAccountResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + // TransactionHash The hash of the transaction, as a 0x-prefixed hex string. Populated for EOA accounts. Null for Smart Accounts (use userOpHash instead). + TransactionHash *string `json:"transactionHash"` + + // UserOpHash The hash of the user operation, as a 0x-prefixed hex string. Populated for Smart Accounts. Null for EOA accounts (use transactionHash instead). + UserOpHash *string `json:"userOpHash"` + } + JSON400 *Error + JSON401 *UnauthorizedError + JSON402 *PaymentMethodRequiredError + JSON404 *Error + JSON422 *IdempotencyError + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r SendEvmAssetWithEndUserAccountResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r SendEvmAssetWithEndUserAccountResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type SendSolanaTransactionWithEndUserAccountResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + // TransactionSignature The base58 encoded transaction signature. + TransactionSignature string `json:"transactionSignature"` + } + JSON400 *Error + JSON401 *UnauthorizedError + JSON402 *PaymentMethodRequiredError + JSON403 *Error + JSON404 *Error + JSON422 *IdempotencyError + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r SendSolanaTransactionWithEndUserAccountResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r SendSolanaTransactionWithEndUserAccountResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type SignSolanaHashWithEndUserAccountResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + // Signature The signature of the hash, as a base58 encoded string. + Signature string `json:"signature"` + } + JSON400 *Error + JSON401 *UnauthorizedError + JSON402 *PaymentMethodRequiredError + JSON404 *Error + JSON409 *AlreadyExistsError + JSON422 *IdempotencyError + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r SignSolanaHashWithEndUserAccountResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r SignSolanaHashWithEndUserAccountResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type SignSolanaMessageWithEndUserAccountResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + // Signature The signature of the message, as a base58 encoded string. + Signature string `json:"signature"` + } + JSON400 *Error + JSON401 *UnauthorizedError + JSON402 *PaymentMethodRequiredError + JSON404 *Error + JSON409 *AlreadyExistsError + JSON422 *IdempotencyError + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r SignSolanaMessageWithEndUserAccountResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r SignSolanaMessageWithEndUserAccountResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type SignSolanaTransactionWithEndUserAccountResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + // SignedTransaction The base64 encoded signed transaction. + SignedTransaction string `json:"signedTransaction"` + } + JSON400 *Error + JSON401 *UnauthorizedError + JSON402 *PaymentMethodRequiredError + JSON403 *Error + JSON404 *Error + JSON409 *AlreadyExistsError + JSON422 *IdempotencyError + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r SignSolanaTransactionWithEndUserAccountResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r SignSolanaTransactionWithEndUserAccountResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type SendSolanaAssetWithEndUserAccountResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + // TransactionSignature The base58 encoded transaction signature. + TransactionSignature string `json:"transactionSignature"` + } + JSON400 *Error + JSON401 *UnauthorizedError + JSON402 *PaymentMethodRequiredError + JSON404 *Error + JSON422 *IdempotencyError + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r SendSolanaAssetWithEndUserAccountResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r SendSolanaAssetWithEndUserAccountResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ListEndUsersResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + // EndUsers The list of end users. + EndUsers []EndUser `json:"endUsers"` + + // NextPageToken The token for the next page of items, if any. + NextPageToken *string `json:"nextPageToken,omitempty"` + } + JSON400 *Error + JSON401 *UnauthorizedError + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r ListEndUsersResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ListEndUsersResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type CreateEndUserResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *EndUser + JSON400 *Error + JSON401 *Error + JSON402 *PaymentMethodRequiredError + JSON422 *IdempotencyError + JSON500 *InternalServerError +} + +// Status returns HTTPResponse.Status +func (r CreateEndUserResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r CreateEndUserResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ValidateEndUserAccessTokenResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *EndUser + JSON400 *Error + JSON401 *Error + JSON404 *Error + JSON500 *InternalServerError +} + +// Status returns HTTPResponse.Status +func (r ValidateEndUserAccessTokenResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ValidateEndUserAccessTokenResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ImportEndUserResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *EndUser + JSON400 *Error + JSON401 *Error + JSON402 *PaymentMethodRequiredError + JSON409 *Error + JSON422 *IdempotencyError + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r ImportEndUserResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ImportEndUserResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetEndUserResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *EndUser + JSON404 *Error + JSON500 *InternalServerError +} + +// Status returns HTTPResponse.Status +func (r GetEndUserResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetEndUserResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type AddEndUserEvmAccountResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *struct { + // EvmAccount Information about an EVM account associated with an end user. + EvmAccount EndUserEvmAccount `json:"evmAccount"` + } + JSON400 *Error + JSON401 *Error + JSON402 *PaymentMethodRequiredError + JSON404 *Error + JSON422 *IdempotencyError + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r AddEndUserEvmAccountResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r AddEndUserEvmAccountResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type AddEndUserEvmSmartAccountResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *struct { + // EvmSmartAccount Information about an EVM smart account associated with an end user. + EvmSmartAccount EndUserEvmSmartAccount `json:"evmSmartAccount"` + } + JSON400 *Error + JSON401 *Error + JSON402 *PaymentMethodRequiredError + JSON404 *Error + JSON422 *IdempotencyError + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r AddEndUserEvmSmartAccountResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r AddEndUserEvmSmartAccountResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type AddEndUserSolanaAccountResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *struct { + // SolanaAccount Information about a Solana account associated with an end user. + SolanaAccount EndUserSolanaAccount `json:"solanaAccount"` + } + JSON400 *Error + JSON401 *Error + JSON402 *PaymentMethodRequiredError + JSON404 *Error + JSON422 *IdempotencyError + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r AddEndUserSolanaAccountResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r AddEndUserSolanaAccountResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ListEvmAccountsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + // Accounts The list of EVM accounts. + Accounts []EvmAccount `json:"accounts"` + + // NextPageToken The token for the next page of items, if any. + NextPageToken *string `json:"nextPageToken,omitempty"` + } + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r ListEvmAccountsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ListEvmAccountsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type CreateEvmAccountResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *EvmAccount + JSON400 *Error + JSON401 *Error + JSON402 *PaymentMethodRequiredError + JSON409 *Error + JSON422 *IdempotencyError + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r CreateEvmAccountResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r CreateEvmAccountResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetEvmAccountByNameResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *EvmAccount + JSON400 *Error + JSON404 *Error + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r GetEvmAccountByNameResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetEvmAccountByNameResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ExportEvmAccountByNameResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + // EncryptedPrivateKey The base64-encoded, encrypted private key of the EVM account which is a 32 byte raw private key. The private key is encrypted in transport using the exportEncryptionKey in the request. + EncryptedPrivateKey string `json:"encryptedPrivateKey"` + } + JSON400 *Error + JSON401 *Error + JSON402 *PaymentMethodRequiredError + JSON404 *Error + JSON422 *IdempotencyError + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r ExportEvmAccountByNameResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ExportEvmAccountByNameResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ImportEvmAccountResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *EvmAccount + JSON400 *Error + JSON401 *Error + JSON402 *PaymentMethodRequiredError + JSON409 *Error + JSON422 *IdempotencyError + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r ImportEvmAccountResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ImportEvmAccountResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetEvmAccountResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *EvmAccount + JSON400 *Error + JSON404 *Error + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r GetEvmAccountResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetEvmAccountResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type UpdateEvmAccountResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *EvmAccount + JSON400 *Error + JSON404 *Error + JSON409 *AlreadyExistsError + JSON422 *IdempotencyError + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r UpdateEvmAccountResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r UpdateEvmAccountResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type CreateEvmEip7702DelegationResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *struct { + // DelegationOperationId The unique identifier for the delegation operation. Use this to poll the operation status. + DelegationOperationId openapi_types.UUID `json:"delegationOperationId"` + } + JSON400 *Error + JSON401 *UnauthorizedError + JSON402 *PaymentMethodRequiredError + JSON404 *Error + JSON409 *Error + JSON422 *IdempotencyError + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r CreateEvmEip7702DelegationResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r CreateEvmEip7702DelegationResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ExportEvmAccountResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + // EncryptedPrivateKey The base64-encoded, encrypted private key of the EVM account which is a 32 byte raw private key. The private key is encrypted in transport using the exportEncryptionKey in the request. + EncryptedPrivateKey string `json:"encryptedPrivateKey"` + } + JSON400 *Error + JSON401 *Error + JSON402 *PaymentMethodRequiredError + JSON404 *Error + JSON422 *IdempotencyError + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r ExportEvmAccountResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ExportEvmAccountResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type SendEvmTransactionResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + // TransactionHash The hash of the transaction, as a 0x-prefixed hex string. + TransactionHash string `json:"transactionHash"` + } + JSON400 *Error + JSON401 *Error + JSON402 *PaymentMethodRequiredError + JSON403 *Error + JSON404 *Error + JSON409 *AlreadyExistsError + JSON422 *IdempotencyError + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r SendEvmTransactionResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r SendEvmTransactionResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type SignEvmHashResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + // Signature The signature of the hash, as a 0x-prefixed hex string. + Signature string `json:"signature"` + } + JSON400 *Error + JSON402 *PaymentMethodRequiredError + JSON404 *Error + JSON409 *AlreadyExistsError + JSON422 *IdempotencyError + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r SignEvmHashResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r SignEvmHashResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type SignEvmMessageResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + // Signature The signature of the message, as a 0x-prefixed hex string. + Signature string `json:"signature"` + } + JSON401 *Error + JSON402 *PaymentMethodRequiredError + JSON404 *Error + JSON409 *AlreadyExistsError + JSON422 *IdempotencyError + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r SignEvmMessageResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r SignEvmMessageResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type SignEvmTransactionResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + // SignedTransaction The RLP-encoded signed transaction, as a 0x-prefixed hex string. + SignedTransaction string `json:"signedTransaction"` + } + JSON400 *Error + JSON401 *Error + JSON402 *PaymentMethodRequiredError + JSON403 *Error + JSON404 *Error + JSON409 *AlreadyExistsError + JSON422 *IdempotencyError + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r SignEvmTransactionResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r SignEvmTransactionResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type SignEvmTypedDataResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + // Signature The signature of the typed data, as a 0x-prefixed hex string. + Signature string `json:"signature"` + } + JSON400 *Error + JSON401 *Error + JSON402 *PaymentMethodRequiredError + JSON404 *Error + JSON422 *IdempotencyError + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r SignEvmTypedDataResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r SignEvmTypedDataResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetEvmEip7702DelegationOperationByIdResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *EvmEip7702DelegationOperation + JSON400 *Error + JSON404 *Error + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r GetEvmEip7702DelegationOperationByIdResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetEvmEip7702DelegationOperationByIdResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type RequestEvmFaucetResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + // TransactionHash The hash of the transaction that requested the funds. + // **Note:** In rare cases, when gas conditions are unusually high, the transaction may not confirm, and the system may issue a replacement transaction to complete the faucet request. In these rare cases, the `transactionHash` will be out of sync with the actual faucet transaction that was confirmed onchain. + TransactionHash string `json:"transactionHash"` + } + JSON400 *Error + JSON403 *Error + JSON429 *Error + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r RequestEvmFaucetResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r RequestEvmFaucetResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ListEvmSmartAccountsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + // Accounts The list of Smart Accounts. + Accounts []EvmSmartAccount `json:"accounts"` + + // NextPageToken The token for the next page of items, if any. + NextPageToken *string `json:"nextPageToken,omitempty"` + } + JSON400 *Error + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r ListEvmSmartAccountsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ListEvmSmartAccountsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type CreateEvmSmartAccountResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *EvmSmartAccount + JSON400 *Error + JSON402 *PaymentMethodRequiredError + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r CreateEvmSmartAccountResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r CreateEvmSmartAccountResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetEvmSmartAccountByNameResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *EvmSmartAccount + JSON400 *Error + JSON404 *Error + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r GetEvmSmartAccountByNameResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetEvmSmartAccountByNameResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetEvmSmartAccountResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *EvmSmartAccount + JSON400 *Error + JSON404 *Error + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r GetEvmSmartAccountResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetEvmSmartAccountResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type UpdateEvmSmartAccountResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *EvmSmartAccount + JSON400 *Error + JSON404 *Error + JSON409 *AlreadyExistsError + JSON422 *IdempotencyError + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r UpdateEvmSmartAccountResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r UpdateEvmSmartAccountResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type CreateSpendPermissionResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *EvmUserOperation + JSON400 *Error + JSON404 *Error + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r CreateSpendPermissionResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r CreateSpendPermissionResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ListSpendPermissionsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + // NextPageToken The token for the next page of items, if any. + NextPageToken *string `json:"nextPageToken,omitempty"` + + // SpendPermissions The spend permissions for the smart account. + SpendPermissions []SpendPermissionResponseObject `json:"spendPermissions"` + } + JSON400 *Error + JSON404 *Error + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r ListSpendPermissionsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ListSpendPermissionsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type RevokeSpendPermissionResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *EvmUserOperation + JSON400 *Error + JSON404 *Error + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r RevokeSpendPermissionResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r RevokeSpendPermissionResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PrepareUserOperationResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *EvmUserOperation + JSON400 *Error + JSON403 *Error + JSON404 *Error + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r PrepareUserOperationResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PrepareUserOperationResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PrepareAndSendUserOperationResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *EvmUserOperation + JSON400 *Error + JSON401 *UnauthorizedError + JSON402 *PaymentMethodRequiredError + JSON403 *Error + JSON404 *Error + JSON429 *Error + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r PrepareAndSendUserOperationResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PrepareAndSendUserOperationResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetUserOperationResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *EvmUserOperation + JSON400 *Error + JSON404 *Error + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r GetUserOperationResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetUserOperationResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type SendUserOperationResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *EvmUserOperation + JSON400 *Error + JSON402 *PaymentMethodRequiredError + JSON403 *Error + JSON404 *Error + JSON429 *Error + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r SendUserOperationResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r SendUserOperationResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type CreateEvmSwapQuoteResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *CreateSwapQuoteResponseWrapper + JSON400 *Error + JSON403 *Error + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r CreateEvmSwapQuoteResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r CreateEvmSwapQuoteResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetEvmSwapPriceResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *GetSwapPriceResponseWrapper + JSON400 *Error + JSON403 *Error + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r GetEvmSwapPriceResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetEvmSwapPriceResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ListEvmTokenBalancesResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + // Balances The list of EVM token balances. + Balances []TokenBalance `json:"balances"` + + // NextPageToken The token for the next page of items, if any. + NextPageToken *string `json:"nextPageToken,omitempty"` + } + JSON400 *Error + JSON404 *Error + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r ListEvmTokenBalancesResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ListEvmTokenBalancesResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetOnrampUserLimitsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + // Limits The list of limits applicable to the user. + Limits []OnrampUserLimit `json:"limits"` + } + JSON400 *Error + JSON401 *UnauthorizedError + JSON429 *RateLimitExceeded + JSON500 *InternalServerError +} + +// Status returns HTTPResponse.Status +func (r GetOnrampUserLimitsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetOnrampUserLimitsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type CreateOnrampOrderResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *struct { + // Order An Onramp order. + Order OnrampOrder `json:"order"` + + // PaymentLink A payment link to pay for an order. + // + // Please refer to the [Onramp docs](https://docs.cdp.coinbase.com/onramp-&-offramp/onramp-apis/onramp-overview) for details on how to integrate with the different payment link types. + PaymentLink *OnrampPaymentLink `json:"paymentLink,omitempty"` + } + JSON400 *Error + JSON401 *UnauthorizedError + JSON429 *RateLimitExceeded + JSON500 *InternalServerError +} + +// Status returns HTTPResponse.Status +func (r CreateOnrampOrderResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r CreateOnrampOrderResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetOnrampOrderByIdResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + // Order An Onramp order. + Order OnrampOrder `json:"order"` + } + JSON401 *UnauthorizedError + JSON404 *Error + JSON429 *RateLimitExceeded +} + +// Status returns HTTPResponse.Status +func (r GetOnrampOrderByIdResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetOnrampOrderByIdResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type CreateOnrampSessionResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *struct { + // Quote Quote information with pricing details for the crypto purchase. + Quote *OnrampQuote `json:"quote,omitempty"` + + // Session An onramp session containing a ready-to-use onramp URL. + Session OnrampSession `json:"session"` + } + JSON400 *Error + JSON401 *UnauthorizedError + JSON429 *RateLimitExceeded + JSON500 *InternalServerError +} + +// Status returns HTTPResponse.Status +func (r CreateOnrampSessionResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r CreateOnrampSessionResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ListPoliciesResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + // NextPageToken The token for the next page of items, if any. + NextPageToken *string `json:"nextPageToken,omitempty"` + + // Policies The list of policies. + Policies []Policy `json:"policies"` + } + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r ListPoliciesResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ListPoliciesResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type CreatePolicyResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *Policy + JSON400 *Error + JSON409 *AlreadyExistsError + JSON422 *IdempotencyError + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r CreatePolicyResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r CreatePolicyResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type DeletePolicyResponse struct { + Body []byte + HTTPResponse *http.Response + JSON400 *Error + JSON404 *Error + JSON409 *AlreadyExistsError + JSON422 *IdempotencyError + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r DeletePolicyResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeletePolicyResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetPolicyByIdResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Policy + JSON404 *Error + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r GetPolicyByIdResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetPolicyByIdResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type UpdatePolicyResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Policy + JSON400 *Error + JSON404 *Error + JSON409 *AlreadyExistsError + JSON422 *IdempotencyError + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r UpdatePolicyResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r UpdatePolicyResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ListSolanaAccountsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + // Accounts The list of Solana accounts. + Accounts []SolanaAccount `json:"accounts"` + + // NextPageToken The token for the next page of items, if any. + NextPageToken *string `json:"nextPageToken,omitempty"` + } + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r ListSolanaAccountsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ListSolanaAccountsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type CreateSolanaAccountResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *SolanaAccount + JSON400 *Error + JSON401 *Error + JSON402 *PaymentMethodRequiredError + JSON409 *Error + JSON422 *IdempotencyError + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r CreateSolanaAccountResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r CreateSolanaAccountResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetSolanaAccountByNameResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *SolanaAccount + JSON400 *Error + JSON404 *Error + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r GetSolanaAccountByNameResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetSolanaAccountByNameResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ExportSolanaAccountByNameResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + // EncryptedPrivateKey The base64-encoded, encrypted private key of the Solana account which is a 32 byte raw private key. The private key is encrypted in transport using the exportEncryptionKey in the request. + EncryptedPrivateKey string `json:"encryptedPrivateKey"` + } + JSON400 *Error + JSON401 *Error + JSON402 *PaymentMethodRequiredError + JSON404 *Error + JSON422 *IdempotencyError + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r ExportSolanaAccountByNameResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ExportSolanaAccountByNameResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ImportSolanaAccountResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *SolanaAccount + JSON400 *Error + JSON401 *Error + JSON402 *PaymentMethodRequiredError + JSON409 *Error + JSON422 *IdempotencyError + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r ImportSolanaAccountResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ImportSolanaAccountResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type SendSolanaTransactionResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + // TransactionSignature The base58 encoded transaction signature. + TransactionSignature string `json:"transactionSignature"` + } + JSON400 *Error + JSON401 *Error + JSON402 *PaymentMethodRequiredError + JSON403 *Error + JSON404 *Error + JSON422 *IdempotencyError + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r SendSolanaTransactionResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r SendSolanaTransactionResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetSolanaAccountResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *SolanaAccount + JSON400 *Error + JSON404 *Error + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r GetSolanaAccountResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetSolanaAccountResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type UpdateSolanaAccountResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *SolanaAccount + JSON400 *Error + JSON404 *Error + JSON409 *AlreadyExistsError + JSON422 *IdempotencyError + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r UpdateSolanaAccountResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r UpdateSolanaAccountResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ExportSolanaAccountResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + // EncryptedPrivateKey The base64-encoded, encrypted private key of the Solana account which is a 32 byte raw private key. The private key is encrypted in transport using the exportEncryptionKey in the request. + EncryptedPrivateKey string `json:"encryptedPrivateKey"` + } + JSON400 *Error + JSON401 *Error + JSON402 *PaymentMethodRequiredError + JSON404 *Error + JSON422 *IdempotencyError + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r ExportSolanaAccountResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ExportSolanaAccountResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type SignSolanaMessageResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + // Signature The signature of the message, as a base58 encoded string. + Signature string `json:"signature"` + } + JSON400 *Error + JSON401 *Error + JSON402 *PaymentMethodRequiredError + JSON404 *Error + JSON409 *AlreadyExistsError + JSON422 *IdempotencyError + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r SignSolanaMessageResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r SignSolanaMessageResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type SignSolanaTransactionResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + // SignedTransaction The base64 encoded signed transaction. + SignedTransaction string `json:"signedTransaction"` + } + JSON400 *Error + JSON401 *Error + JSON402 *PaymentMethodRequiredError + JSON403 *Error JSON404 *Error + JSON409 *AlreadyExistsError JSON422 *IdempotencyError JSON500 *InternalServerError JSON502 *BadGatewayError JSON503 *ServiceUnavailableError } -// Status returns HTTPResponse.Status -func (r ExportSolanaAccountByNameResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// Status returns HTTPResponse.Status +func (r SignSolanaTransactionResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r SignSolanaTransactionResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type RequestSolanaFaucetResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + // TransactionSignature The signature identifying the transaction that requested the funds. + TransactionSignature string `json:"transactionSignature"` + } + JSON400 *Error + JSON403 *Error + JSON429 *Error + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r RequestSolanaFaucetResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r RequestSolanaFaucetResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ListSolanaTokenBalancesResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + // Balances The list of Solana token balances. + Balances []SolanaTokenBalance `json:"balances"` + + // NextPageToken The token for the next page of items, if any. + NextPageToken *string `json:"nextPageToken,omitempty"` + } + JSON400 *Error + JSON404 *Error + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r ListSolanaTokenBalancesResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ListSolanaTokenBalancesResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type SettleX402PaymentResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *X402SettleResponse + JSON400 *X402SettleError + JSON402 *PaymentMethodRequiredError + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r SettleX402PaymentResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r SettleX402PaymentResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type SupportedX402PaymentKindsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *X402SupportedPaymentKindsResponse + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r SupportedX402PaymentKindsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r SupportedX402PaymentKindsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type VerifyX402PaymentResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *X402VerifyResponse + JSON400 *X402VerifyInvalidError + JSON500 *InternalServerError + JSON502 *BadGatewayError + JSON503 *ServiceUnavailableError +} + +// Status returns HTTPResponse.Status +func (r VerifyX402PaymentResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r VerifyX402PaymentResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ListDataTokenBalancesWithResponse request returning *ListDataTokenBalancesResponse +func (c *ClientWithResponses) ListDataTokenBalancesWithResponse(ctx context.Context, network ListEvmTokenBalancesNetwork, address string, params *ListDataTokenBalancesParams, reqEditors ...RequestEditorFn) (*ListDataTokenBalancesResponse, error) { + rsp, err := c.ListDataTokenBalances(ctx, network, address, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseListDataTokenBalancesResponse(rsp) +} + +// ListTokensForAccountWithResponse request returning *ListTokensForAccountResponse +func (c *ClientWithResponses) ListTokensForAccountWithResponse(ctx context.Context, network ListTokensForAccountParamsNetwork, address string, reqEditors ...RequestEditorFn) (*ListTokensForAccountResponse, error) { + rsp, err := c.ListTokensForAccount(ctx, network, address, reqEditors...) + if err != nil { + return nil, err + } + return ParseListTokensForAccountResponse(rsp) +} + +// GetSQLGrammarWithResponse request returning *GetSQLGrammarResponse +func (c *ClientWithResponses) GetSQLGrammarWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetSQLGrammarResponse, error) { + rsp, err := c.GetSQLGrammar(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetSQLGrammarResponse(rsp) +} + +// RunSQLQueryWithBodyWithResponse request with arbitrary body returning *RunSQLQueryResponse +func (c *ClientWithResponses) RunSQLQueryWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RunSQLQueryResponse, error) { + rsp, err := c.RunSQLQueryWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseRunSQLQueryResponse(rsp) +} + +func (c *ClientWithResponses) RunSQLQueryWithResponse(ctx context.Context, body RunSQLQueryJSONRequestBody, reqEditors ...RequestEditorFn) (*RunSQLQueryResponse, error) { + rsp, err := c.RunSQLQuery(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseRunSQLQueryResponse(rsp) +} + +// ListWebhookSubscriptionsWithResponse request returning *ListWebhookSubscriptionsResponse +func (c *ClientWithResponses) ListWebhookSubscriptionsWithResponse(ctx context.Context, params *ListWebhookSubscriptionsParams, reqEditors ...RequestEditorFn) (*ListWebhookSubscriptionsResponse, error) { + rsp, err := c.ListWebhookSubscriptions(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseListWebhookSubscriptionsResponse(rsp) +} + +// CreateWebhookSubscriptionWithBodyWithResponse request with arbitrary body returning *CreateWebhookSubscriptionResponse +func (c *ClientWithResponses) CreateWebhookSubscriptionWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateWebhookSubscriptionResponse, error) { + rsp, err := c.CreateWebhookSubscriptionWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateWebhookSubscriptionResponse(rsp) +} + +func (c *ClientWithResponses) CreateWebhookSubscriptionWithResponse(ctx context.Context, body CreateWebhookSubscriptionJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateWebhookSubscriptionResponse, error) { + rsp, err := c.CreateWebhookSubscription(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateWebhookSubscriptionResponse(rsp) +} + +// DeleteWebhookSubscriptionWithResponse request returning *DeleteWebhookSubscriptionResponse +func (c *ClientWithResponses) DeleteWebhookSubscriptionWithResponse(ctx context.Context, subscriptionId openapi_types.UUID, reqEditors ...RequestEditorFn) (*DeleteWebhookSubscriptionResponse, error) { + rsp, err := c.DeleteWebhookSubscription(ctx, subscriptionId, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteWebhookSubscriptionResponse(rsp) +} + +// GetWebhookSubscriptionWithResponse request returning *GetWebhookSubscriptionResponse +func (c *ClientWithResponses) GetWebhookSubscriptionWithResponse(ctx context.Context, subscriptionId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetWebhookSubscriptionResponse, error) { + rsp, err := c.GetWebhookSubscription(ctx, subscriptionId, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetWebhookSubscriptionResponse(rsp) +} + +// UpdateWebhookSubscriptionWithBodyWithResponse request with arbitrary body returning *UpdateWebhookSubscriptionResponse +func (c *ClientWithResponses) UpdateWebhookSubscriptionWithBodyWithResponse(ctx context.Context, subscriptionId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateWebhookSubscriptionResponse, error) { + rsp, err := c.UpdateWebhookSubscriptionWithBody(ctx, subscriptionId, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateWebhookSubscriptionResponse(rsp) +} + +func (c *ClientWithResponses) UpdateWebhookSubscriptionWithResponse(ctx context.Context, subscriptionId openapi_types.UUID, body UpdateWebhookSubscriptionJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateWebhookSubscriptionResponse, error) { + rsp, err := c.UpdateWebhookSubscription(ctx, subscriptionId, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateWebhookSubscriptionResponse(rsp) +} + +// RevokeDelegationForEndUserWithBodyWithResponse request with arbitrary body returning *RevokeDelegationForEndUserResponse +func (c *ClientWithResponses) RevokeDelegationForEndUserWithBodyWithResponse(ctx context.Context, projectId string, userId string, params *RevokeDelegationForEndUserParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RevokeDelegationForEndUserResponse, error) { + rsp, err := c.RevokeDelegationForEndUserWithBody(ctx, projectId, userId, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseRevokeDelegationForEndUserResponse(rsp) +} + +func (c *ClientWithResponses) RevokeDelegationForEndUserWithResponse(ctx context.Context, projectId string, userId string, params *RevokeDelegationForEndUserParams, body RevokeDelegationForEndUserJSONRequestBody, reqEditors ...RequestEditorFn) (*RevokeDelegationForEndUserResponse, error) { + rsp, err := c.RevokeDelegationForEndUser(ctx, projectId, userId, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseRevokeDelegationForEndUserResponse(rsp) +} + +// CreateEvmEip7702DelegationWithEndUserAccountWithBodyWithResponse request with arbitrary body returning *CreateEvmEip7702DelegationWithEndUserAccountResponse +func (c *ClientWithResponses) CreateEvmEip7702DelegationWithEndUserAccountWithBodyWithResponse(ctx context.Context, projectId string, userId string, params *CreateEvmEip7702DelegationWithEndUserAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateEvmEip7702DelegationWithEndUserAccountResponse, error) { + rsp, err := c.CreateEvmEip7702DelegationWithEndUserAccountWithBody(ctx, projectId, userId, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateEvmEip7702DelegationWithEndUserAccountResponse(rsp) +} + +func (c *ClientWithResponses) CreateEvmEip7702DelegationWithEndUserAccountWithResponse(ctx context.Context, projectId string, userId string, params *CreateEvmEip7702DelegationWithEndUserAccountParams, body CreateEvmEip7702DelegationWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateEvmEip7702DelegationWithEndUserAccountResponse, error) { + rsp, err := c.CreateEvmEip7702DelegationWithEndUserAccount(ctx, projectId, userId, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateEvmEip7702DelegationWithEndUserAccountResponse(rsp) +} + +// SendEvmTransactionWithEndUserAccountWithBodyWithResponse request with arbitrary body returning *SendEvmTransactionWithEndUserAccountResponse +func (c *ClientWithResponses) SendEvmTransactionWithEndUserAccountWithBodyWithResponse(ctx context.Context, projectId string, userId string, params *SendEvmTransactionWithEndUserAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SendEvmTransactionWithEndUserAccountResponse, error) { + rsp, err := c.SendEvmTransactionWithEndUserAccountWithBody(ctx, projectId, userId, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseSendEvmTransactionWithEndUserAccountResponse(rsp) +} + +func (c *ClientWithResponses) SendEvmTransactionWithEndUserAccountWithResponse(ctx context.Context, projectId string, userId string, params *SendEvmTransactionWithEndUserAccountParams, body SendEvmTransactionWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*SendEvmTransactionWithEndUserAccountResponse, error) { + rsp, err := c.SendEvmTransactionWithEndUserAccount(ctx, projectId, userId, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseSendEvmTransactionWithEndUserAccountResponse(rsp) +} + +// SignEvmHashWithEndUserAccountWithBodyWithResponse request with arbitrary body returning *SignEvmHashWithEndUserAccountResponse +func (c *ClientWithResponses) SignEvmHashWithEndUserAccountWithBodyWithResponse(ctx context.Context, projectId string, userId string, params *SignEvmHashWithEndUserAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SignEvmHashWithEndUserAccountResponse, error) { + rsp, err := c.SignEvmHashWithEndUserAccountWithBody(ctx, projectId, userId, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseSignEvmHashWithEndUserAccountResponse(rsp) +} + +func (c *ClientWithResponses) SignEvmHashWithEndUserAccountWithResponse(ctx context.Context, projectId string, userId string, params *SignEvmHashWithEndUserAccountParams, body SignEvmHashWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*SignEvmHashWithEndUserAccountResponse, error) { + rsp, err := c.SignEvmHashWithEndUserAccount(ctx, projectId, userId, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseSignEvmHashWithEndUserAccountResponse(rsp) +} + +// SignEvmMessageWithEndUserAccountWithBodyWithResponse request with arbitrary body returning *SignEvmMessageWithEndUserAccountResponse +func (c *ClientWithResponses) SignEvmMessageWithEndUserAccountWithBodyWithResponse(ctx context.Context, projectId string, userId string, params *SignEvmMessageWithEndUserAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SignEvmMessageWithEndUserAccountResponse, error) { + rsp, err := c.SignEvmMessageWithEndUserAccountWithBody(ctx, projectId, userId, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseSignEvmMessageWithEndUserAccountResponse(rsp) +} + +func (c *ClientWithResponses) SignEvmMessageWithEndUserAccountWithResponse(ctx context.Context, projectId string, userId string, params *SignEvmMessageWithEndUserAccountParams, body SignEvmMessageWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*SignEvmMessageWithEndUserAccountResponse, error) { + rsp, err := c.SignEvmMessageWithEndUserAccount(ctx, projectId, userId, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseSignEvmMessageWithEndUserAccountResponse(rsp) +} + +// SignEvmTransactionWithEndUserAccountWithBodyWithResponse request with arbitrary body returning *SignEvmTransactionWithEndUserAccountResponse +func (c *ClientWithResponses) SignEvmTransactionWithEndUserAccountWithBodyWithResponse(ctx context.Context, projectId string, userId string, params *SignEvmTransactionWithEndUserAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SignEvmTransactionWithEndUserAccountResponse, error) { + rsp, err := c.SignEvmTransactionWithEndUserAccountWithBody(ctx, projectId, userId, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseSignEvmTransactionWithEndUserAccountResponse(rsp) +} + +func (c *ClientWithResponses) SignEvmTransactionWithEndUserAccountWithResponse(ctx context.Context, projectId string, userId string, params *SignEvmTransactionWithEndUserAccountParams, body SignEvmTransactionWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*SignEvmTransactionWithEndUserAccountResponse, error) { + rsp, err := c.SignEvmTransactionWithEndUserAccount(ctx, projectId, userId, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseSignEvmTransactionWithEndUserAccountResponse(rsp) +} + +// SignEvmTypedDataWithEndUserAccountWithBodyWithResponse request with arbitrary body returning *SignEvmTypedDataWithEndUserAccountResponse +func (c *ClientWithResponses) SignEvmTypedDataWithEndUserAccountWithBodyWithResponse(ctx context.Context, projectId string, userId string, params *SignEvmTypedDataWithEndUserAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SignEvmTypedDataWithEndUserAccountResponse, error) { + rsp, err := c.SignEvmTypedDataWithEndUserAccountWithBody(ctx, projectId, userId, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseSignEvmTypedDataWithEndUserAccountResponse(rsp) +} + +func (c *ClientWithResponses) SignEvmTypedDataWithEndUserAccountWithResponse(ctx context.Context, projectId string, userId string, params *SignEvmTypedDataWithEndUserAccountParams, body SignEvmTypedDataWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*SignEvmTypedDataWithEndUserAccountResponse, error) { + rsp, err := c.SignEvmTypedDataWithEndUserAccount(ctx, projectId, userId, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseSignEvmTypedDataWithEndUserAccountResponse(rsp) +} + +// SendUserOperationWithEndUserAccountWithBodyWithResponse request with arbitrary body returning *SendUserOperationWithEndUserAccountResponse +func (c *ClientWithResponses) SendUserOperationWithEndUserAccountWithBodyWithResponse(ctx context.Context, projectId string, userId string, address string, params *SendUserOperationWithEndUserAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SendUserOperationWithEndUserAccountResponse, error) { + rsp, err := c.SendUserOperationWithEndUserAccountWithBody(ctx, projectId, userId, address, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseSendUserOperationWithEndUserAccountResponse(rsp) +} + +func (c *ClientWithResponses) SendUserOperationWithEndUserAccountWithResponse(ctx context.Context, projectId string, userId string, address string, params *SendUserOperationWithEndUserAccountParams, body SendUserOperationWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*SendUserOperationWithEndUserAccountResponse, error) { + rsp, err := c.SendUserOperationWithEndUserAccount(ctx, projectId, userId, address, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseSendUserOperationWithEndUserAccountResponse(rsp) +} + +// RevokeSpendPermissionWithEndUserAccountWithBodyWithResponse request with arbitrary body returning *RevokeSpendPermissionWithEndUserAccountResponse +func (c *ClientWithResponses) RevokeSpendPermissionWithEndUserAccountWithBodyWithResponse(ctx context.Context, projectId string, userId string, address string, params *RevokeSpendPermissionWithEndUserAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RevokeSpendPermissionWithEndUserAccountResponse, error) { + rsp, err := c.RevokeSpendPermissionWithEndUserAccountWithBody(ctx, projectId, userId, address, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseRevokeSpendPermissionWithEndUserAccountResponse(rsp) +} + +func (c *ClientWithResponses) RevokeSpendPermissionWithEndUserAccountWithResponse(ctx context.Context, projectId string, userId string, address string, params *RevokeSpendPermissionWithEndUserAccountParams, body RevokeSpendPermissionWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*RevokeSpendPermissionWithEndUserAccountResponse, error) { + rsp, err := c.RevokeSpendPermissionWithEndUserAccount(ctx, projectId, userId, address, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseRevokeSpendPermissionWithEndUserAccountResponse(rsp) +} + +// SendEvmAssetWithEndUserAccountWithBodyWithResponse request with arbitrary body returning *SendEvmAssetWithEndUserAccountResponse +func (c *ClientWithResponses) SendEvmAssetWithEndUserAccountWithBodyWithResponse(ctx context.Context, projectId string, userId string, address BlockchainAddress, asset Asset, params *SendEvmAssetWithEndUserAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SendEvmAssetWithEndUserAccountResponse, error) { + rsp, err := c.SendEvmAssetWithEndUserAccountWithBody(ctx, projectId, userId, address, asset, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseSendEvmAssetWithEndUserAccountResponse(rsp) +} + +func (c *ClientWithResponses) SendEvmAssetWithEndUserAccountWithResponse(ctx context.Context, projectId string, userId string, address BlockchainAddress, asset Asset, params *SendEvmAssetWithEndUserAccountParams, body SendEvmAssetWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*SendEvmAssetWithEndUserAccountResponse, error) { + rsp, err := c.SendEvmAssetWithEndUserAccount(ctx, projectId, userId, address, asset, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseSendEvmAssetWithEndUserAccountResponse(rsp) +} + +// SendSolanaTransactionWithEndUserAccountWithBodyWithResponse request with arbitrary body returning *SendSolanaTransactionWithEndUserAccountResponse +func (c *ClientWithResponses) SendSolanaTransactionWithEndUserAccountWithBodyWithResponse(ctx context.Context, projectId string, userId string, params *SendSolanaTransactionWithEndUserAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SendSolanaTransactionWithEndUserAccountResponse, error) { + rsp, err := c.SendSolanaTransactionWithEndUserAccountWithBody(ctx, projectId, userId, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseSendSolanaTransactionWithEndUserAccountResponse(rsp) +} + +func (c *ClientWithResponses) SendSolanaTransactionWithEndUserAccountWithResponse(ctx context.Context, projectId string, userId string, params *SendSolanaTransactionWithEndUserAccountParams, body SendSolanaTransactionWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*SendSolanaTransactionWithEndUserAccountResponse, error) { + rsp, err := c.SendSolanaTransactionWithEndUserAccount(ctx, projectId, userId, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseSendSolanaTransactionWithEndUserAccountResponse(rsp) +} + +// SignSolanaHashWithEndUserAccountWithBodyWithResponse request with arbitrary body returning *SignSolanaHashWithEndUserAccountResponse +func (c *ClientWithResponses) SignSolanaHashWithEndUserAccountWithBodyWithResponse(ctx context.Context, projectId string, userId string, params *SignSolanaHashWithEndUserAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SignSolanaHashWithEndUserAccountResponse, error) { + rsp, err := c.SignSolanaHashWithEndUserAccountWithBody(ctx, projectId, userId, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseSignSolanaHashWithEndUserAccountResponse(rsp) +} + +func (c *ClientWithResponses) SignSolanaHashWithEndUserAccountWithResponse(ctx context.Context, projectId string, userId string, params *SignSolanaHashWithEndUserAccountParams, body SignSolanaHashWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*SignSolanaHashWithEndUserAccountResponse, error) { + rsp, err := c.SignSolanaHashWithEndUserAccount(ctx, projectId, userId, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseSignSolanaHashWithEndUserAccountResponse(rsp) +} + +// SignSolanaMessageWithEndUserAccountWithBodyWithResponse request with arbitrary body returning *SignSolanaMessageWithEndUserAccountResponse +func (c *ClientWithResponses) SignSolanaMessageWithEndUserAccountWithBodyWithResponse(ctx context.Context, projectId string, userId string, params *SignSolanaMessageWithEndUserAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SignSolanaMessageWithEndUserAccountResponse, error) { + rsp, err := c.SignSolanaMessageWithEndUserAccountWithBody(ctx, projectId, userId, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseSignSolanaMessageWithEndUserAccountResponse(rsp) +} + +func (c *ClientWithResponses) SignSolanaMessageWithEndUserAccountWithResponse(ctx context.Context, projectId string, userId string, params *SignSolanaMessageWithEndUserAccountParams, body SignSolanaMessageWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*SignSolanaMessageWithEndUserAccountResponse, error) { + rsp, err := c.SignSolanaMessageWithEndUserAccount(ctx, projectId, userId, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseSignSolanaMessageWithEndUserAccountResponse(rsp) +} + +// SignSolanaTransactionWithEndUserAccountWithBodyWithResponse request with arbitrary body returning *SignSolanaTransactionWithEndUserAccountResponse +func (c *ClientWithResponses) SignSolanaTransactionWithEndUserAccountWithBodyWithResponse(ctx context.Context, projectId string, userId string, params *SignSolanaTransactionWithEndUserAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SignSolanaTransactionWithEndUserAccountResponse, error) { + rsp, err := c.SignSolanaTransactionWithEndUserAccountWithBody(ctx, projectId, userId, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseSignSolanaTransactionWithEndUserAccountResponse(rsp) +} + +func (c *ClientWithResponses) SignSolanaTransactionWithEndUserAccountWithResponse(ctx context.Context, projectId string, userId string, params *SignSolanaTransactionWithEndUserAccountParams, body SignSolanaTransactionWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*SignSolanaTransactionWithEndUserAccountResponse, error) { + rsp, err := c.SignSolanaTransactionWithEndUserAccount(ctx, projectId, userId, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseSignSolanaTransactionWithEndUserAccountResponse(rsp) +} + +// SendSolanaAssetWithEndUserAccountWithBodyWithResponse request with arbitrary body returning *SendSolanaAssetWithEndUserAccountResponse +func (c *ClientWithResponses) SendSolanaAssetWithEndUserAccountWithBodyWithResponse(ctx context.Context, projectId string, userId string, address BlockchainAddress, asset Asset, params *SendSolanaAssetWithEndUserAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SendSolanaAssetWithEndUserAccountResponse, error) { + rsp, err := c.SendSolanaAssetWithEndUserAccountWithBody(ctx, projectId, userId, address, asset, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseSendSolanaAssetWithEndUserAccountResponse(rsp) +} + +func (c *ClientWithResponses) SendSolanaAssetWithEndUserAccountWithResponse(ctx context.Context, projectId string, userId string, address BlockchainAddress, asset Asset, params *SendSolanaAssetWithEndUserAccountParams, body SendSolanaAssetWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*SendSolanaAssetWithEndUserAccountResponse, error) { + rsp, err := c.SendSolanaAssetWithEndUserAccount(ctx, projectId, userId, address, asset, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseSendSolanaAssetWithEndUserAccountResponse(rsp) +} + +// ListEndUsersWithResponse request returning *ListEndUsersResponse +func (c *ClientWithResponses) ListEndUsersWithResponse(ctx context.Context, params *ListEndUsersParams, reqEditors ...RequestEditorFn) (*ListEndUsersResponse, error) { + rsp, err := c.ListEndUsers(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseListEndUsersResponse(rsp) +} + +// CreateEndUserWithBodyWithResponse request with arbitrary body returning *CreateEndUserResponse +func (c *ClientWithResponses) CreateEndUserWithBodyWithResponse(ctx context.Context, params *CreateEndUserParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateEndUserResponse, error) { + rsp, err := c.CreateEndUserWithBody(ctx, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateEndUserResponse(rsp) +} + +func (c *ClientWithResponses) CreateEndUserWithResponse(ctx context.Context, params *CreateEndUserParams, body CreateEndUserJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateEndUserResponse, error) { + rsp, err := c.CreateEndUser(ctx, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateEndUserResponse(rsp) +} + +// ValidateEndUserAccessTokenWithBodyWithResponse request with arbitrary body returning *ValidateEndUserAccessTokenResponse +func (c *ClientWithResponses) ValidateEndUserAccessTokenWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ValidateEndUserAccessTokenResponse, error) { + rsp, err := c.ValidateEndUserAccessTokenWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseValidateEndUserAccessTokenResponse(rsp) +} + +func (c *ClientWithResponses) ValidateEndUserAccessTokenWithResponse(ctx context.Context, body ValidateEndUserAccessTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*ValidateEndUserAccessTokenResponse, error) { + rsp, err := c.ValidateEndUserAccessToken(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseValidateEndUserAccessTokenResponse(rsp) +} + +// ImportEndUserWithBodyWithResponse request with arbitrary body returning *ImportEndUserResponse +func (c *ClientWithResponses) ImportEndUserWithBodyWithResponse(ctx context.Context, params *ImportEndUserParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ImportEndUserResponse, error) { + rsp, err := c.ImportEndUserWithBody(ctx, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseImportEndUserResponse(rsp) +} + +func (c *ClientWithResponses) ImportEndUserWithResponse(ctx context.Context, params *ImportEndUserParams, body ImportEndUserJSONRequestBody, reqEditors ...RequestEditorFn) (*ImportEndUserResponse, error) { + rsp, err := c.ImportEndUser(ctx, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseImportEndUserResponse(rsp) +} + +// GetEndUserWithResponse request returning *GetEndUserResponse +func (c *ClientWithResponses) GetEndUserWithResponse(ctx context.Context, userId string, reqEditors ...RequestEditorFn) (*GetEndUserResponse, error) { + rsp, err := c.GetEndUser(ctx, userId, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetEndUserResponse(rsp) +} + +// AddEndUserEvmAccountWithBodyWithResponse request with arbitrary body returning *AddEndUserEvmAccountResponse +func (c *ClientWithResponses) AddEndUserEvmAccountWithBodyWithResponse(ctx context.Context, userId string, params *AddEndUserEvmAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AddEndUserEvmAccountResponse, error) { + rsp, err := c.AddEndUserEvmAccountWithBody(ctx, userId, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseAddEndUserEvmAccountResponse(rsp) +} + +func (c *ClientWithResponses) AddEndUserEvmAccountWithResponse(ctx context.Context, userId string, params *AddEndUserEvmAccountParams, body AddEndUserEvmAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*AddEndUserEvmAccountResponse, error) { + rsp, err := c.AddEndUserEvmAccount(ctx, userId, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseAddEndUserEvmAccountResponse(rsp) +} + +// AddEndUserEvmSmartAccountWithBodyWithResponse request with arbitrary body returning *AddEndUserEvmSmartAccountResponse +func (c *ClientWithResponses) AddEndUserEvmSmartAccountWithBodyWithResponse(ctx context.Context, userId string, params *AddEndUserEvmSmartAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AddEndUserEvmSmartAccountResponse, error) { + rsp, err := c.AddEndUserEvmSmartAccountWithBody(ctx, userId, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseAddEndUserEvmSmartAccountResponse(rsp) +} + +func (c *ClientWithResponses) AddEndUserEvmSmartAccountWithResponse(ctx context.Context, userId string, params *AddEndUserEvmSmartAccountParams, body AddEndUserEvmSmartAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*AddEndUserEvmSmartAccountResponse, error) { + rsp, err := c.AddEndUserEvmSmartAccount(ctx, userId, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseAddEndUserEvmSmartAccountResponse(rsp) +} + +// AddEndUserSolanaAccountWithBodyWithResponse request with arbitrary body returning *AddEndUserSolanaAccountResponse +func (c *ClientWithResponses) AddEndUserSolanaAccountWithBodyWithResponse(ctx context.Context, userId string, params *AddEndUserSolanaAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AddEndUserSolanaAccountResponse, error) { + rsp, err := c.AddEndUserSolanaAccountWithBody(ctx, userId, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseAddEndUserSolanaAccountResponse(rsp) +} + +func (c *ClientWithResponses) AddEndUserSolanaAccountWithResponse(ctx context.Context, userId string, params *AddEndUserSolanaAccountParams, body AddEndUserSolanaAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*AddEndUserSolanaAccountResponse, error) { + rsp, err := c.AddEndUserSolanaAccount(ctx, userId, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseAddEndUserSolanaAccountResponse(rsp) +} + +// ListEvmAccountsWithResponse request returning *ListEvmAccountsResponse +func (c *ClientWithResponses) ListEvmAccountsWithResponse(ctx context.Context, params *ListEvmAccountsParams, reqEditors ...RequestEditorFn) (*ListEvmAccountsResponse, error) { + rsp, err := c.ListEvmAccounts(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseListEvmAccountsResponse(rsp) +} + +// CreateEvmAccountWithBodyWithResponse request with arbitrary body returning *CreateEvmAccountResponse +func (c *ClientWithResponses) CreateEvmAccountWithBodyWithResponse(ctx context.Context, params *CreateEvmAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateEvmAccountResponse, error) { + rsp, err := c.CreateEvmAccountWithBody(ctx, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateEvmAccountResponse(rsp) +} + +func (c *ClientWithResponses) CreateEvmAccountWithResponse(ctx context.Context, params *CreateEvmAccountParams, body CreateEvmAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateEvmAccountResponse, error) { + rsp, err := c.CreateEvmAccount(ctx, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateEvmAccountResponse(rsp) +} + +// GetEvmAccountByNameWithResponse request returning *GetEvmAccountByNameResponse +func (c *ClientWithResponses) GetEvmAccountByNameWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*GetEvmAccountByNameResponse, error) { + rsp, err := c.GetEvmAccountByName(ctx, name, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetEvmAccountByNameResponse(rsp) +} + +// ExportEvmAccountByNameWithBodyWithResponse request with arbitrary body returning *ExportEvmAccountByNameResponse +func (c *ClientWithResponses) ExportEvmAccountByNameWithBodyWithResponse(ctx context.Context, name string, params *ExportEvmAccountByNameParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ExportEvmAccountByNameResponse, error) { + rsp, err := c.ExportEvmAccountByNameWithBody(ctx, name, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseExportEvmAccountByNameResponse(rsp) +} + +func (c *ClientWithResponses) ExportEvmAccountByNameWithResponse(ctx context.Context, name string, params *ExportEvmAccountByNameParams, body ExportEvmAccountByNameJSONRequestBody, reqEditors ...RequestEditorFn) (*ExportEvmAccountByNameResponse, error) { + rsp, err := c.ExportEvmAccountByName(ctx, name, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseExportEvmAccountByNameResponse(rsp) +} + +// ImportEvmAccountWithBodyWithResponse request with arbitrary body returning *ImportEvmAccountResponse +func (c *ClientWithResponses) ImportEvmAccountWithBodyWithResponse(ctx context.Context, params *ImportEvmAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ImportEvmAccountResponse, error) { + rsp, err := c.ImportEvmAccountWithBody(ctx, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseImportEvmAccountResponse(rsp) +} + +func (c *ClientWithResponses) ImportEvmAccountWithResponse(ctx context.Context, params *ImportEvmAccountParams, body ImportEvmAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*ImportEvmAccountResponse, error) { + rsp, err := c.ImportEvmAccount(ctx, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseImportEvmAccountResponse(rsp) +} + +// GetEvmAccountWithResponse request returning *GetEvmAccountResponse +func (c *ClientWithResponses) GetEvmAccountWithResponse(ctx context.Context, address string, reqEditors ...RequestEditorFn) (*GetEvmAccountResponse, error) { + rsp, err := c.GetEvmAccount(ctx, address, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetEvmAccountResponse(rsp) +} + +// UpdateEvmAccountWithBodyWithResponse request with arbitrary body returning *UpdateEvmAccountResponse +func (c *ClientWithResponses) UpdateEvmAccountWithBodyWithResponse(ctx context.Context, address string, params *UpdateEvmAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateEvmAccountResponse, error) { + rsp, err := c.UpdateEvmAccountWithBody(ctx, address, params, contentType, body, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseUpdateEvmAccountResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r ExportSolanaAccountByNameResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +func (c *ClientWithResponses) UpdateEvmAccountWithResponse(ctx context.Context, address string, params *UpdateEvmAccountParams, body UpdateEvmAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateEvmAccountResponse, error) { + rsp, err := c.UpdateEvmAccount(ctx, address, params, body, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseUpdateEvmAccountResponse(rsp) } -type ImportSolanaAccountResponse struct { - Body []byte - HTTPResponse *http.Response - JSON201 *SolanaAccount - JSON400 *Error - JSON401 *Error - JSON402 *PaymentMethodRequiredError - JSON409 *Error - JSON422 *IdempotencyError - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError +// CreateEvmEip7702DelegationWithBodyWithResponse request with arbitrary body returning *CreateEvmEip7702DelegationResponse +func (c *ClientWithResponses) CreateEvmEip7702DelegationWithBodyWithResponse(ctx context.Context, address string, params *CreateEvmEip7702DelegationParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateEvmEip7702DelegationResponse, error) { + rsp, err := c.CreateEvmEip7702DelegationWithBody(ctx, address, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateEvmEip7702DelegationResponse(rsp) +} + +func (c *ClientWithResponses) CreateEvmEip7702DelegationWithResponse(ctx context.Context, address string, params *CreateEvmEip7702DelegationParams, body CreateEvmEip7702DelegationJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateEvmEip7702DelegationResponse, error) { + rsp, err := c.CreateEvmEip7702Delegation(ctx, address, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateEvmEip7702DelegationResponse(rsp) +} + +// ExportEvmAccountWithBodyWithResponse request with arbitrary body returning *ExportEvmAccountResponse +func (c *ClientWithResponses) ExportEvmAccountWithBodyWithResponse(ctx context.Context, address string, params *ExportEvmAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ExportEvmAccountResponse, error) { + rsp, err := c.ExportEvmAccountWithBody(ctx, address, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseExportEvmAccountResponse(rsp) +} + +func (c *ClientWithResponses) ExportEvmAccountWithResponse(ctx context.Context, address string, params *ExportEvmAccountParams, body ExportEvmAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*ExportEvmAccountResponse, error) { + rsp, err := c.ExportEvmAccount(ctx, address, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseExportEvmAccountResponse(rsp) +} + +// SendEvmTransactionWithBodyWithResponse request with arbitrary body returning *SendEvmTransactionResponse +func (c *ClientWithResponses) SendEvmTransactionWithBodyWithResponse(ctx context.Context, address string, params *SendEvmTransactionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SendEvmTransactionResponse, error) { + rsp, err := c.SendEvmTransactionWithBody(ctx, address, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseSendEvmTransactionResponse(rsp) +} + +func (c *ClientWithResponses) SendEvmTransactionWithResponse(ctx context.Context, address string, params *SendEvmTransactionParams, body SendEvmTransactionJSONRequestBody, reqEditors ...RequestEditorFn) (*SendEvmTransactionResponse, error) { + rsp, err := c.SendEvmTransaction(ctx, address, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseSendEvmTransactionResponse(rsp) +} + +// SignEvmHashWithBodyWithResponse request with arbitrary body returning *SignEvmHashResponse +func (c *ClientWithResponses) SignEvmHashWithBodyWithResponse(ctx context.Context, address string, params *SignEvmHashParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SignEvmHashResponse, error) { + rsp, err := c.SignEvmHashWithBody(ctx, address, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseSignEvmHashResponse(rsp) +} + +func (c *ClientWithResponses) SignEvmHashWithResponse(ctx context.Context, address string, params *SignEvmHashParams, body SignEvmHashJSONRequestBody, reqEditors ...RequestEditorFn) (*SignEvmHashResponse, error) { + rsp, err := c.SignEvmHash(ctx, address, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseSignEvmHashResponse(rsp) +} + +// SignEvmMessageWithBodyWithResponse request with arbitrary body returning *SignEvmMessageResponse +func (c *ClientWithResponses) SignEvmMessageWithBodyWithResponse(ctx context.Context, address string, params *SignEvmMessageParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SignEvmMessageResponse, error) { + rsp, err := c.SignEvmMessageWithBody(ctx, address, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseSignEvmMessageResponse(rsp) +} + +func (c *ClientWithResponses) SignEvmMessageWithResponse(ctx context.Context, address string, params *SignEvmMessageParams, body SignEvmMessageJSONRequestBody, reqEditors ...RequestEditorFn) (*SignEvmMessageResponse, error) { + rsp, err := c.SignEvmMessage(ctx, address, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseSignEvmMessageResponse(rsp) +} + +// SignEvmTransactionWithBodyWithResponse request with arbitrary body returning *SignEvmTransactionResponse +func (c *ClientWithResponses) SignEvmTransactionWithBodyWithResponse(ctx context.Context, address string, params *SignEvmTransactionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SignEvmTransactionResponse, error) { + rsp, err := c.SignEvmTransactionWithBody(ctx, address, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseSignEvmTransactionResponse(rsp) +} + +func (c *ClientWithResponses) SignEvmTransactionWithResponse(ctx context.Context, address string, params *SignEvmTransactionParams, body SignEvmTransactionJSONRequestBody, reqEditors ...RequestEditorFn) (*SignEvmTransactionResponse, error) { + rsp, err := c.SignEvmTransaction(ctx, address, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseSignEvmTransactionResponse(rsp) +} + +// SignEvmTypedDataWithBodyWithResponse request with arbitrary body returning *SignEvmTypedDataResponse +func (c *ClientWithResponses) SignEvmTypedDataWithBodyWithResponse(ctx context.Context, address string, params *SignEvmTypedDataParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SignEvmTypedDataResponse, error) { + rsp, err := c.SignEvmTypedDataWithBody(ctx, address, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseSignEvmTypedDataResponse(rsp) +} + +func (c *ClientWithResponses) SignEvmTypedDataWithResponse(ctx context.Context, address string, params *SignEvmTypedDataParams, body SignEvmTypedDataJSONRequestBody, reqEditors ...RequestEditorFn) (*SignEvmTypedDataResponse, error) { + rsp, err := c.SignEvmTypedData(ctx, address, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseSignEvmTypedDataResponse(rsp) +} + +// GetEvmEip7702DelegationOperationByIdWithResponse request returning *GetEvmEip7702DelegationOperationByIdResponse +func (c *ClientWithResponses) GetEvmEip7702DelegationOperationByIdWithResponse(ctx context.Context, delegationOperationId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetEvmEip7702DelegationOperationByIdResponse, error) { + rsp, err := c.GetEvmEip7702DelegationOperationById(ctx, delegationOperationId, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetEvmEip7702DelegationOperationByIdResponse(rsp) +} + +// RequestEvmFaucetWithBodyWithResponse request with arbitrary body returning *RequestEvmFaucetResponse +func (c *ClientWithResponses) RequestEvmFaucetWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RequestEvmFaucetResponse, error) { + rsp, err := c.RequestEvmFaucetWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseRequestEvmFaucetResponse(rsp) +} + +func (c *ClientWithResponses) RequestEvmFaucetWithResponse(ctx context.Context, body RequestEvmFaucetJSONRequestBody, reqEditors ...RequestEditorFn) (*RequestEvmFaucetResponse, error) { + rsp, err := c.RequestEvmFaucet(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseRequestEvmFaucetResponse(rsp) +} + +// ListEvmSmartAccountsWithResponse request returning *ListEvmSmartAccountsResponse +func (c *ClientWithResponses) ListEvmSmartAccountsWithResponse(ctx context.Context, params *ListEvmSmartAccountsParams, reqEditors ...RequestEditorFn) (*ListEvmSmartAccountsResponse, error) { + rsp, err := c.ListEvmSmartAccounts(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseListEvmSmartAccountsResponse(rsp) +} + +// CreateEvmSmartAccountWithBodyWithResponse request with arbitrary body returning *CreateEvmSmartAccountResponse +func (c *ClientWithResponses) CreateEvmSmartAccountWithBodyWithResponse(ctx context.Context, params *CreateEvmSmartAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateEvmSmartAccountResponse, error) { + rsp, err := c.CreateEvmSmartAccountWithBody(ctx, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateEvmSmartAccountResponse(rsp) +} + +func (c *ClientWithResponses) CreateEvmSmartAccountWithResponse(ctx context.Context, params *CreateEvmSmartAccountParams, body CreateEvmSmartAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateEvmSmartAccountResponse, error) { + rsp, err := c.CreateEvmSmartAccount(ctx, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateEvmSmartAccountResponse(rsp) +} + +// GetEvmSmartAccountByNameWithResponse request returning *GetEvmSmartAccountByNameResponse +func (c *ClientWithResponses) GetEvmSmartAccountByNameWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*GetEvmSmartAccountByNameResponse, error) { + rsp, err := c.GetEvmSmartAccountByName(ctx, name, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetEvmSmartAccountByNameResponse(rsp) +} + +// GetEvmSmartAccountWithResponse request returning *GetEvmSmartAccountResponse +func (c *ClientWithResponses) GetEvmSmartAccountWithResponse(ctx context.Context, address string, reqEditors ...RequestEditorFn) (*GetEvmSmartAccountResponse, error) { + rsp, err := c.GetEvmSmartAccount(ctx, address, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetEvmSmartAccountResponse(rsp) +} + +// UpdateEvmSmartAccountWithBodyWithResponse request with arbitrary body returning *UpdateEvmSmartAccountResponse +func (c *ClientWithResponses) UpdateEvmSmartAccountWithBodyWithResponse(ctx context.Context, address string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateEvmSmartAccountResponse, error) { + rsp, err := c.UpdateEvmSmartAccountWithBody(ctx, address, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateEvmSmartAccountResponse(rsp) +} + +func (c *ClientWithResponses) UpdateEvmSmartAccountWithResponse(ctx context.Context, address string, body UpdateEvmSmartAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateEvmSmartAccountResponse, error) { + rsp, err := c.UpdateEvmSmartAccount(ctx, address, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateEvmSmartAccountResponse(rsp) +} + +// CreateSpendPermissionWithBodyWithResponse request with arbitrary body returning *CreateSpendPermissionResponse +func (c *ClientWithResponses) CreateSpendPermissionWithBodyWithResponse(ctx context.Context, address string, params *CreateSpendPermissionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateSpendPermissionResponse, error) { + rsp, err := c.CreateSpendPermissionWithBody(ctx, address, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateSpendPermissionResponse(rsp) +} + +func (c *ClientWithResponses) CreateSpendPermissionWithResponse(ctx context.Context, address string, params *CreateSpendPermissionParams, body CreateSpendPermissionJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateSpendPermissionResponse, error) { + rsp, err := c.CreateSpendPermission(ctx, address, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateSpendPermissionResponse(rsp) } -// Status returns HTTPResponse.Status -func (r ImportSolanaAccountResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// ListSpendPermissionsWithResponse request returning *ListSpendPermissionsResponse +func (c *ClientWithResponses) ListSpendPermissionsWithResponse(ctx context.Context, address string, params *ListSpendPermissionsParams, reqEditors ...RequestEditorFn) (*ListSpendPermissionsResponse, error) { + rsp, err := c.ListSpendPermissions(ctx, address, params, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseListSpendPermissionsResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r ImportSolanaAccountResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// RevokeSpendPermissionWithBodyWithResponse request with arbitrary body returning *RevokeSpendPermissionResponse +func (c *ClientWithResponses) RevokeSpendPermissionWithBodyWithResponse(ctx context.Context, address string, params *RevokeSpendPermissionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RevokeSpendPermissionResponse, error) { + rsp, err := c.RevokeSpendPermissionWithBody(ctx, address, params, contentType, body, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseRevokeSpendPermissionResponse(rsp) } -type SendSolanaTransactionResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - // TransactionSignature The base58 encoded transaction signature. - TransactionSignature string `json:"transactionSignature"` +func (c *ClientWithResponses) RevokeSpendPermissionWithResponse(ctx context.Context, address string, params *RevokeSpendPermissionParams, body RevokeSpendPermissionJSONRequestBody, reqEditors ...RequestEditorFn) (*RevokeSpendPermissionResponse, error) { + rsp, err := c.RevokeSpendPermission(ctx, address, params, body, reqEditors...) + if err != nil { + return nil, err } - JSON400 *Error - JSON401 *Error - JSON402 *PaymentMethodRequiredError - JSON403 *Error - JSON404 *Error - JSON422 *IdempotencyError - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError + return ParseRevokeSpendPermissionResponse(rsp) } -// Status returns HTTPResponse.Status -func (r SendSolanaTransactionResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// PrepareUserOperationWithBodyWithResponse request with arbitrary body returning *PrepareUserOperationResponse +func (c *ClientWithResponses) PrepareUserOperationWithBodyWithResponse(ctx context.Context, address string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PrepareUserOperationResponse, error) { + rsp, err := c.PrepareUserOperationWithBody(ctx, address, contentType, body, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParsePrepareUserOperationResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r SendSolanaTransactionResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +func (c *ClientWithResponses) PrepareUserOperationWithResponse(ctx context.Context, address string, body PrepareUserOperationJSONRequestBody, reqEditors ...RequestEditorFn) (*PrepareUserOperationResponse, error) { + rsp, err := c.PrepareUserOperation(ctx, address, body, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParsePrepareUserOperationResponse(rsp) } -type GetSolanaAccountResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *SolanaAccount - JSON400 *Error - JSON404 *Error - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError +// PrepareAndSendUserOperationWithBodyWithResponse request with arbitrary body returning *PrepareAndSendUserOperationResponse +func (c *ClientWithResponses) PrepareAndSendUserOperationWithBodyWithResponse(ctx context.Context, address string, params *PrepareAndSendUserOperationParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PrepareAndSendUserOperationResponse, error) { + rsp, err := c.PrepareAndSendUserOperationWithBody(ctx, address, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePrepareAndSendUserOperationResponse(rsp) } -// Status returns HTTPResponse.Status -func (r GetSolanaAccountResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +func (c *ClientWithResponses) PrepareAndSendUserOperationWithResponse(ctx context.Context, address string, params *PrepareAndSendUserOperationParams, body PrepareAndSendUserOperationJSONRequestBody, reqEditors ...RequestEditorFn) (*PrepareAndSendUserOperationResponse, error) { + rsp, err := c.PrepareAndSendUserOperation(ctx, address, params, body, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParsePrepareAndSendUserOperationResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r GetSolanaAccountResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// GetUserOperationWithResponse request returning *GetUserOperationResponse +func (c *ClientWithResponses) GetUserOperationWithResponse(ctx context.Context, address string, userOpHash string, reqEditors ...RequestEditorFn) (*GetUserOperationResponse, error) { + rsp, err := c.GetUserOperation(ctx, address, userOpHash, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseGetUserOperationResponse(rsp) } -type UpdateSolanaAccountResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *SolanaAccount - JSON400 *Error - JSON404 *Error - JSON409 *AlreadyExistsError - JSON422 *IdempotencyError - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError +// SendUserOperationWithBodyWithResponse request with arbitrary body returning *SendUserOperationResponse +func (c *ClientWithResponses) SendUserOperationWithBodyWithResponse(ctx context.Context, address string, userOpHash string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SendUserOperationResponse, error) { + rsp, err := c.SendUserOperationWithBody(ctx, address, userOpHash, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseSendUserOperationResponse(rsp) } -// Status returns HTTPResponse.Status -func (r UpdateSolanaAccountResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +func (c *ClientWithResponses) SendUserOperationWithResponse(ctx context.Context, address string, userOpHash string, body SendUserOperationJSONRequestBody, reqEditors ...RequestEditorFn) (*SendUserOperationResponse, error) { + rsp, err := c.SendUserOperation(ctx, address, userOpHash, body, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseSendUserOperationResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r UpdateSolanaAccountResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// CreateEvmSwapQuoteWithBodyWithResponse request with arbitrary body returning *CreateEvmSwapQuoteResponse +func (c *ClientWithResponses) CreateEvmSwapQuoteWithBodyWithResponse(ctx context.Context, params *CreateEvmSwapQuoteParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateEvmSwapQuoteResponse, error) { + rsp, err := c.CreateEvmSwapQuoteWithBody(ctx, params, contentType, body, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseCreateEvmSwapQuoteResponse(rsp) } -type ExportSolanaAccountResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - // EncryptedPrivateKey The base64-encoded, encrypted private key of the Solana account which is a 32 byte raw private key. The private key is encrypted in transport using the exportEncryptionKey in the request. - EncryptedPrivateKey string `json:"encryptedPrivateKey"` +func (c *ClientWithResponses) CreateEvmSwapQuoteWithResponse(ctx context.Context, params *CreateEvmSwapQuoteParams, body CreateEvmSwapQuoteJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateEvmSwapQuoteResponse, error) { + rsp, err := c.CreateEvmSwapQuote(ctx, params, body, reqEditors...) + if err != nil { + return nil, err } - JSON400 *Error - JSON401 *Error - JSON402 *PaymentMethodRequiredError - JSON404 *Error - JSON422 *IdempotencyError - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError + return ParseCreateEvmSwapQuoteResponse(rsp) } -// Status returns HTTPResponse.Status -func (r ExportSolanaAccountResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// GetEvmSwapPriceWithResponse request returning *GetEvmSwapPriceResponse +func (c *ClientWithResponses) GetEvmSwapPriceWithResponse(ctx context.Context, params *GetEvmSwapPriceParams, reqEditors ...RequestEditorFn) (*GetEvmSwapPriceResponse, error) { + rsp, err := c.GetEvmSwapPrice(ctx, params, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseGetEvmSwapPriceResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r ExportSolanaAccountResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// ListEvmTokenBalancesWithResponse request returning *ListEvmTokenBalancesResponse +func (c *ClientWithResponses) ListEvmTokenBalancesWithResponse(ctx context.Context, network ListEvmTokenBalancesNetwork, address string, params *ListEvmTokenBalancesParams, reqEditors ...RequestEditorFn) (*ListEvmTokenBalancesResponse, error) { + rsp, err := c.ListEvmTokenBalances(ctx, network, address, params, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseListEvmTokenBalancesResponse(rsp) } -type SignSolanaMessageResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - // Signature The signature of the message, as a base58 encoded string. - Signature string `json:"signature"` +// GetOnrampUserLimitsWithBodyWithResponse request with arbitrary body returning *GetOnrampUserLimitsResponse +func (c *ClientWithResponses) GetOnrampUserLimitsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*GetOnrampUserLimitsResponse, error) { + rsp, err := c.GetOnrampUserLimitsWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err } - JSON400 *Error - JSON401 *Error - JSON402 *PaymentMethodRequiredError - JSON404 *Error - JSON409 *AlreadyExistsError - JSON422 *IdempotencyError - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError + return ParseGetOnrampUserLimitsResponse(rsp) } -// Status returns HTTPResponse.Status -func (r SignSolanaMessageResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +func (c *ClientWithResponses) GetOnrampUserLimitsWithResponse(ctx context.Context, body GetOnrampUserLimitsJSONRequestBody, reqEditors ...RequestEditorFn) (*GetOnrampUserLimitsResponse, error) { + rsp, err := c.GetOnrampUserLimits(ctx, body, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseGetOnrampUserLimitsResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r SignSolanaMessageResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// CreateOnrampOrderWithBodyWithResponse request with arbitrary body returning *CreateOnrampOrderResponse +func (c *ClientWithResponses) CreateOnrampOrderWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateOnrampOrderResponse, error) { + rsp, err := c.CreateOnrampOrderWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseCreateOnrampOrderResponse(rsp) } -type SignSolanaTransactionResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - // SignedTransaction The base64 encoded signed transaction. - SignedTransaction string `json:"signedTransaction"` +func (c *ClientWithResponses) CreateOnrampOrderWithResponse(ctx context.Context, body CreateOnrampOrderJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateOnrampOrderResponse, error) { + rsp, err := c.CreateOnrampOrder(ctx, body, reqEditors...) + if err != nil { + return nil, err } - JSON400 *Error - JSON401 *Error - JSON402 *PaymentMethodRequiredError - JSON403 *Error - JSON404 *Error - JSON409 *AlreadyExistsError - JSON422 *IdempotencyError - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError + return ParseCreateOnrampOrderResponse(rsp) +} + +// GetOnrampOrderByIdWithResponse request returning *GetOnrampOrderByIdResponse +func (c *ClientWithResponses) GetOnrampOrderByIdWithResponse(ctx context.Context, orderId string, reqEditors ...RequestEditorFn) (*GetOnrampOrderByIdResponse, error) { + rsp, err := c.GetOnrampOrderById(ctx, orderId, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetOnrampOrderByIdResponse(rsp) } -// Status returns HTTPResponse.Status -func (r SignSolanaTransactionResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// CreateOnrampSessionWithBodyWithResponse request with arbitrary body returning *CreateOnrampSessionResponse +func (c *ClientWithResponses) CreateOnrampSessionWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateOnrampSessionResponse, error) { + rsp, err := c.CreateOnrampSessionWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseCreateOnrampSessionResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r SignSolanaTransactionResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +func (c *ClientWithResponses) CreateOnrampSessionWithResponse(ctx context.Context, body CreateOnrampSessionJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateOnrampSessionResponse, error) { + rsp, err := c.CreateOnrampSession(ctx, body, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseCreateOnrampSessionResponse(rsp) } -type RequestSolanaFaucetResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - // TransactionSignature The signature identifying the transaction that requested the funds. - TransactionSignature string `json:"transactionSignature"` +// ListPoliciesWithResponse request returning *ListPoliciesResponse +func (c *ClientWithResponses) ListPoliciesWithResponse(ctx context.Context, params *ListPoliciesParams, reqEditors ...RequestEditorFn) (*ListPoliciesResponse, error) { + rsp, err := c.ListPolicies(ctx, params, reqEditors...) + if err != nil { + return nil, err } - JSON400 *Error - JSON403 *Error - JSON429 *Error - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError + return ParseListPoliciesResponse(rsp) } -// Status returns HTTPResponse.Status -func (r RequestSolanaFaucetResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// CreatePolicyWithBodyWithResponse request with arbitrary body returning *CreatePolicyResponse +func (c *ClientWithResponses) CreatePolicyWithBodyWithResponse(ctx context.Context, params *CreatePolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreatePolicyResponse, error) { + rsp, err := c.CreatePolicyWithBody(ctx, params, contentType, body, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseCreatePolicyResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r RequestSolanaFaucetResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +func (c *ClientWithResponses) CreatePolicyWithResponse(ctx context.Context, params *CreatePolicyParams, body CreatePolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*CreatePolicyResponse, error) { + rsp, err := c.CreatePolicy(ctx, params, body, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseCreatePolicyResponse(rsp) } -type ListSolanaTokenBalancesResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - // Balances The list of Solana token balances. - Balances []SolanaTokenBalance `json:"balances"` +// DeletePolicyWithResponse request returning *DeletePolicyResponse +func (c *ClientWithResponses) DeletePolicyWithResponse(ctx context.Context, policyId string, params *DeletePolicyParams, reqEditors ...RequestEditorFn) (*DeletePolicyResponse, error) { + rsp, err := c.DeletePolicy(ctx, policyId, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeletePolicyResponse(rsp) +} - // NextPageToken The token for the next page of items, if any. - NextPageToken *string `json:"nextPageToken,omitempty"` +// GetPolicyByIdWithResponse request returning *GetPolicyByIdResponse +func (c *ClientWithResponses) GetPolicyByIdWithResponse(ctx context.Context, policyId string, reqEditors ...RequestEditorFn) (*GetPolicyByIdResponse, error) { + rsp, err := c.GetPolicyById(ctx, policyId, reqEditors...) + if err != nil { + return nil, err } - JSON400 *Error - JSON404 *Error - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError + return ParseGetPolicyByIdResponse(rsp) } -// Status returns HTTPResponse.Status -func (r ListSolanaTokenBalancesResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// UpdatePolicyWithBodyWithResponse request with arbitrary body returning *UpdatePolicyResponse +func (c *ClientWithResponses) UpdatePolicyWithBodyWithResponse(ctx context.Context, policyId string, params *UpdatePolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdatePolicyResponse, error) { + rsp, err := c.UpdatePolicyWithBody(ctx, policyId, params, contentType, body, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseUpdatePolicyResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r ListSolanaTokenBalancesResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +func (c *ClientWithResponses) UpdatePolicyWithResponse(ctx context.Context, policyId string, params *UpdatePolicyParams, body UpdatePolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdatePolicyResponse, error) { + rsp, err := c.UpdatePolicy(ctx, policyId, params, body, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseUpdatePolicyResponse(rsp) } -type SettleX402PaymentResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *X402SettleResponse - JSON400 *X402SettleError - JSON402 *PaymentMethodRequiredError - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError +// ListSolanaAccountsWithResponse request returning *ListSolanaAccountsResponse +func (c *ClientWithResponses) ListSolanaAccountsWithResponse(ctx context.Context, params *ListSolanaAccountsParams, reqEditors ...RequestEditorFn) (*ListSolanaAccountsResponse, error) { + rsp, err := c.ListSolanaAccounts(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseListSolanaAccountsResponse(rsp) } -// Status returns HTTPResponse.Status -func (r SettleX402PaymentResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// CreateSolanaAccountWithBodyWithResponse request with arbitrary body returning *CreateSolanaAccountResponse +func (c *ClientWithResponses) CreateSolanaAccountWithBodyWithResponse(ctx context.Context, params *CreateSolanaAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateSolanaAccountResponse, error) { + rsp, err := c.CreateSolanaAccountWithBody(ctx, params, contentType, body, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseCreateSolanaAccountResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r SettleX402PaymentResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +func (c *ClientWithResponses) CreateSolanaAccountWithResponse(ctx context.Context, params *CreateSolanaAccountParams, body CreateSolanaAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateSolanaAccountResponse, error) { + rsp, err := c.CreateSolanaAccount(ctx, params, body, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseCreateSolanaAccountResponse(rsp) } -type SupportedX402PaymentKindsResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *X402SupportedPaymentKindsResponse - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError +// GetSolanaAccountByNameWithResponse request returning *GetSolanaAccountByNameResponse +func (c *ClientWithResponses) GetSolanaAccountByNameWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*GetSolanaAccountByNameResponse, error) { + rsp, err := c.GetSolanaAccountByName(ctx, name, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetSolanaAccountByNameResponse(rsp) } -// Status returns HTTPResponse.Status -func (r SupportedX402PaymentKindsResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// ExportSolanaAccountByNameWithBodyWithResponse request with arbitrary body returning *ExportSolanaAccountByNameResponse +func (c *ClientWithResponses) ExportSolanaAccountByNameWithBodyWithResponse(ctx context.Context, name string, params *ExportSolanaAccountByNameParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ExportSolanaAccountByNameResponse, error) { + rsp, err := c.ExportSolanaAccountByNameWithBody(ctx, name, params, contentType, body, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseExportSolanaAccountByNameResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r SupportedX402PaymentKindsResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +func (c *ClientWithResponses) ExportSolanaAccountByNameWithResponse(ctx context.Context, name string, params *ExportSolanaAccountByNameParams, body ExportSolanaAccountByNameJSONRequestBody, reqEditors ...RequestEditorFn) (*ExportSolanaAccountByNameResponse, error) { + rsp, err := c.ExportSolanaAccountByName(ctx, name, params, body, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseExportSolanaAccountByNameResponse(rsp) } -type VerifyX402PaymentResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *X402VerifyResponse - JSON400 *X402VerifyInvalidError - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError +// ImportSolanaAccountWithBodyWithResponse request with arbitrary body returning *ImportSolanaAccountResponse +func (c *ClientWithResponses) ImportSolanaAccountWithBodyWithResponse(ctx context.Context, params *ImportSolanaAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ImportSolanaAccountResponse, error) { + rsp, err := c.ImportSolanaAccountWithBody(ctx, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseImportSolanaAccountResponse(rsp) } -// Status returns HTTPResponse.Status -func (r VerifyX402PaymentResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +func (c *ClientWithResponses) ImportSolanaAccountWithResponse(ctx context.Context, params *ImportSolanaAccountParams, body ImportSolanaAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*ImportSolanaAccountResponse, error) { + rsp, err := c.ImportSolanaAccount(ctx, params, body, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseImportSolanaAccountResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r VerifyX402PaymentResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// SendSolanaTransactionWithBodyWithResponse request with arbitrary body returning *SendSolanaTransactionResponse +func (c *ClientWithResponses) SendSolanaTransactionWithBodyWithResponse(ctx context.Context, params *SendSolanaTransactionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SendSolanaTransactionResponse, error) { + rsp, err := c.SendSolanaTransactionWithBody(ctx, params, contentType, body, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseSendSolanaTransactionResponse(rsp) } -// ListDataTokenBalancesWithResponse request returning *ListDataTokenBalancesResponse -func (c *ClientWithResponses) ListDataTokenBalancesWithResponse(ctx context.Context, network ListEvmTokenBalancesNetwork, address string, params *ListDataTokenBalancesParams, reqEditors ...RequestEditorFn) (*ListDataTokenBalancesResponse, error) { - rsp, err := c.ListDataTokenBalances(ctx, network, address, params, reqEditors...) +func (c *ClientWithResponses) SendSolanaTransactionWithResponse(ctx context.Context, params *SendSolanaTransactionParams, body SendSolanaTransactionJSONRequestBody, reqEditors ...RequestEditorFn) (*SendSolanaTransactionResponse, error) { + rsp, err := c.SendSolanaTransaction(ctx, params, body, reqEditors...) if err != nil { return nil, err } - return ParseListDataTokenBalancesResponse(rsp) + return ParseSendSolanaTransactionResponse(rsp) } -// ListTokensForAccountWithResponse request returning *ListTokensForAccountResponse -func (c *ClientWithResponses) ListTokensForAccountWithResponse(ctx context.Context, network ListTokensForAccountParamsNetwork, address string, reqEditors ...RequestEditorFn) (*ListTokensForAccountResponse, error) { - rsp, err := c.ListTokensForAccount(ctx, network, address, reqEditors...) +// GetSolanaAccountWithResponse request returning *GetSolanaAccountResponse +func (c *ClientWithResponses) GetSolanaAccountWithResponse(ctx context.Context, address string, reqEditors ...RequestEditorFn) (*GetSolanaAccountResponse, error) { + rsp, err := c.GetSolanaAccount(ctx, address, reqEditors...) if err != nil { return nil, err } - return ParseListTokensForAccountResponse(rsp) + return ParseGetSolanaAccountResponse(rsp) } -// GetSQLGrammarWithResponse request returning *GetSQLGrammarResponse -func (c *ClientWithResponses) GetSQLGrammarWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetSQLGrammarResponse, error) { - rsp, err := c.GetSQLGrammar(ctx, reqEditors...) +// UpdateSolanaAccountWithBodyWithResponse request with arbitrary body returning *UpdateSolanaAccountResponse +func (c *ClientWithResponses) UpdateSolanaAccountWithBodyWithResponse(ctx context.Context, address string, params *UpdateSolanaAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateSolanaAccountResponse, error) { + rsp, err := c.UpdateSolanaAccountWithBody(ctx, address, params, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseGetSQLGrammarResponse(rsp) + return ParseUpdateSolanaAccountResponse(rsp) } -// RunSQLQueryWithBodyWithResponse request with arbitrary body returning *RunSQLQueryResponse -func (c *ClientWithResponses) RunSQLQueryWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RunSQLQueryResponse, error) { - rsp, err := c.RunSQLQueryWithBody(ctx, contentType, body, reqEditors...) +func (c *ClientWithResponses) UpdateSolanaAccountWithResponse(ctx context.Context, address string, params *UpdateSolanaAccountParams, body UpdateSolanaAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateSolanaAccountResponse, error) { + rsp, err := c.UpdateSolanaAccount(ctx, address, params, body, reqEditors...) if err != nil { return nil, err } - return ParseRunSQLQueryResponse(rsp) + return ParseUpdateSolanaAccountResponse(rsp) } -func (c *ClientWithResponses) RunSQLQueryWithResponse(ctx context.Context, body RunSQLQueryJSONRequestBody, reqEditors ...RequestEditorFn) (*RunSQLQueryResponse, error) { - rsp, err := c.RunSQLQuery(ctx, body, reqEditors...) +// ExportSolanaAccountWithBodyWithResponse request with arbitrary body returning *ExportSolanaAccountResponse +func (c *ClientWithResponses) ExportSolanaAccountWithBodyWithResponse(ctx context.Context, address string, params *ExportSolanaAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ExportSolanaAccountResponse, error) { + rsp, err := c.ExportSolanaAccountWithBody(ctx, address, params, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseRunSQLQueryResponse(rsp) + return ParseExportSolanaAccountResponse(rsp) } -// ListWebhookSubscriptionsWithResponse request returning *ListWebhookSubscriptionsResponse -func (c *ClientWithResponses) ListWebhookSubscriptionsWithResponse(ctx context.Context, params *ListWebhookSubscriptionsParams, reqEditors ...RequestEditorFn) (*ListWebhookSubscriptionsResponse, error) { - rsp, err := c.ListWebhookSubscriptions(ctx, params, reqEditors...) +func (c *ClientWithResponses) ExportSolanaAccountWithResponse(ctx context.Context, address string, params *ExportSolanaAccountParams, body ExportSolanaAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*ExportSolanaAccountResponse, error) { + rsp, err := c.ExportSolanaAccount(ctx, address, params, body, reqEditors...) if err != nil { return nil, err } - return ParseListWebhookSubscriptionsResponse(rsp) + return ParseExportSolanaAccountResponse(rsp) } -// CreateWebhookSubscriptionWithBodyWithResponse request with arbitrary body returning *CreateWebhookSubscriptionResponse -func (c *ClientWithResponses) CreateWebhookSubscriptionWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateWebhookSubscriptionResponse, error) { - rsp, err := c.CreateWebhookSubscriptionWithBody(ctx, contentType, body, reqEditors...) +// SignSolanaMessageWithBodyWithResponse request with arbitrary body returning *SignSolanaMessageResponse +func (c *ClientWithResponses) SignSolanaMessageWithBodyWithResponse(ctx context.Context, address string, params *SignSolanaMessageParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SignSolanaMessageResponse, error) { + rsp, err := c.SignSolanaMessageWithBody(ctx, address, params, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseCreateWebhookSubscriptionResponse(rsp) + return ParseSignSolanaMessageResponse(rsp) } -func (c *ClientWithResponses) CreateWebhookSubscriptionWithResponse(ctx context.Context, body CreateWebhookSubscriptionJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateWebhookSubscriptionResponse, error) { - rsp, err := c.CreateWebhookSubscription(ctx, body, reqEditors...) +func (c *ClientWithResponses) SignSolanaMessageWithResponse(ctx context.Context, address string, params *SignSolanaMessageParams, body SignSolanaMessageJSONRequestBody, reqEditors ...RequestEditorFn) (*SignSolanaMessageResponse, error) { + rsp, err := c.SignSolanaMessage(ctx, address, params, body, reqEditors...) if err != nil { return nil, err } - return ParseCreateWebhookSubscriptionResponse(rsp) + return ParseSignSolanaMessageResponse(rsp) } -// DeleteWebhookSubscriptionWithResponse request returning *DeleteWebhookSubscriptionResponse -func (c *ClientWithResponses) DeleteWebhookSubscriptionWithResponse(ctx context.Context, subscriptionId openapi_types.UUID, reqEditors ...RequestEditorFn) (*DeleteWebhookSubscriptionResponse, error) { - rsp, err := c.DeleteWebhookSubscription(ctx, subscriptionId, reqEditors...) +// SignSolanaTransactionWithBodyWithResponse request with arbitrary body returning *SignSolanaTransactionResponse +func (c *ClientWithResponses) SignSolanaTransactionWithBodyWithResponse(ctx context.Context, address string, params *SignSolanaTransactionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SignSolanaTransactionResponse, error) { + rsp, err := c.SignSolanaTransactionWithBody(ctx, address, params, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseDeleteWebhookSubscriptionResponse(rsp) + return ParseSignSolanaTransactionResponse(rsp) } -// GetWebhookSubscriptionWithResponse request returning *GetWebhookSubscriptionResponse -func (c *ClientWithResponses) GetWebhookSubscriptionWithResponse(ctx context.Context, subscriptionId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetWebhookSubscriptionResponse, error) { - rsp, err := c.GetWebhookSubscription(ctx, subscriptionId, reqEditors...) +func (c *ClientWithResponses) SignSolanaTransactionWithResponse(ctx context.Context, address string, params *SignSolanaTransactionParams, body SignSolanaTransactionJSONRequestBody, reqEditors ...RequestEditorFn) (*SignSolanaTransactionResponse, error) { + rsp, err := c.SignSolanaTransaction(ctx, address, params, body, reqEditors...) if err != nil { return nil, err } - return ParseGetWebhookSubscriptionResponse(rsp) + return ParseSignSolanaTransactionResponse(rsp) } -// UpdateWebhookSubscriptionWithBodyWithResponse request with arbitrary body returning *UpdateWebhookSubscriptionResponse -func (c *ClientWithResponses) UpdateWebhookSubscriptionWithBodyWithResponse(ctx context.Context, subscriptionId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateWebhookSubscriptionResponse, error) { - rsp, err := c.UpdateWebhookSubscriptionWithBody(ctx, subscriptionId, contentType, body, reqEditors...) +// RequestSolanaFaucetWithBodyWithResponse request with arbitrary body returning *RequestSolanaFaucetResponse +func (c *ClientWithResponses) RequestSolanaFaucetWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RequestSolanaFaucetResponse, error) { + rsp, err := c.RequestSolanaFaucetWithBody(ctx, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseUpdateWebhookSubscriptionResponse(rsp) + return ParseRequestSolanaFaucetResponse(rsp) } -func (c *ClientWithResponses) UpdateWebhookSubscriptionWithResponse(ctx context.Context, subscriptionId openapi_types.UUID, body UpdateWebhookSubscriptionJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateWebhookSubscriptionResponse, error) { - rsp, err := c.UpdateWebhookSubscription(ctx, subscriptionId, body, reqEditors...) +func (c *ClientWithResponses) RequestSolanaFaucetWithResponse(ctx context.Context, body RequestSolanaFaucetJSONRequestBody, reqEditors ...RequestEditorFn) (*RequestSolanaFaucetResponse, error) { + rsp, err := c.RequestSolanaFaucet(ctx, body, reqEditors...) if err != nil { return nil, err } - return ParseUpdateWebhookSubscriptionResponse(rsp) + return ParseRequestSolanaFaucetResponse(rsp) } -// ListEndUsersWithResponse request returning *ListEndUsersResponse -func (c *ClientWithResponses) ListEndUsersWithResponse(ctx context.Context, params *ListEndUsersParams, reqEditors ...RequestEditorFn) (*ListEndUsersResponse, error) { - rsp, err := c.ListEndUsers(ctx, params, reqEditors...) +// ListSolanaTokenBalancesWithResponse request returning *ListSolanaTokenBalancesResponse +func (c *ClientWithResponses) ListSolanaTokenBalancesWithResponse(ctx context.Context, network ListSolanaTokenBalancesNetwork, address string, params *ListSolanaTokenBalancesParams, reqEditors ...RequestEditorFn) (*ListSolanaTokenBalancesResponse, error) { + rsp, err := c.ListSolanaTokenBalances(ctx, network, address, params, reqEditors...) if err != nil { return nil, err } - return ParseListEndUsersResponse(rsp) + return ParseListSolanaTokenBalancesResponse(rsp) } -// CreateEndUserWithBodyWithResponse request with arbitrary body returning *CreateEndUserResponse -func (c *ClientWithResponses) CreateEndUserWithBodyWithResponse(ctx context.Context, params *CreateEndUserParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateEndUserResponse, error) { - rsp, err := c.CreateEndUserWithBody(ctx, params, contentType, body, reqEditors...) +// SettleX402PaymentWithBodyWithResponse request with arbitrary body returning *SettleX402PaymentResponse +func (c *ClientWithResponses) SettleX402PaymentWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SettleX402PaymentResponse, error) { + rsp, err := c.SettleX402PaymentWithBody(ctx, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseCreateEndUserResponse(rsp) + return ParseSettleX402PaymentResponse(rsp) } -func (c *ClientWithResponses) CreateEndUserWithResponse(ctx context.Context, params *CreateEndUserParams, body CreateEndUserJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateEndUserResponse, error) { - rsp, err := c.CreateEndUser(ctx, params, body, reqEditors...) +func (c *ClientWithResponses) SettleX402PaymentWithResponse(ctx context.Context, body SettleX402PaymentJSONRequestBody, reqEditors ...RequestEditorFn) (*SettleX402PaymentResponse, error) { + rsp, err := c.SettleX402Payment(ctx, body, reqEditors...) if err != nil { return nil, err } - return ParseCreateEndUserResponse(rsp) + return ParseSettleX402PaymentResponse(rsp) } -// ValidateEndUserAccessTokenWithBodyWithResponse request with arbitrary body returning *ValidateEndUserAccessTokenResponse -func (c *ClientWithResponses) ValidateEndUserAccessTokenWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ValidateEndUserAccessTokenResponse, error) { - rsp, err := c.ValidateEndUserAccessTokenWithBody(ctx, contentType, body, reqEditors...) +// SupportedX402PaymentKindsWithResponse request returning *SupportedX402PaymentKindsResponse +func (c *ClientWithResponses) SupportedX402PaymentKindsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*SupportedX402PaymentKindsResponse, error) { + rsp, err := c.SupportedX402PaymentKinds(ctx, reqEditors...) if err != nil { return nil, err } - return ParseValidateEndUserAccessTokenResponse(rsp) + return ParseSupportedX402PaymentKindsResponse(rsp) } -func (c *ClientWithResponses) ValidateEndUserAccessTokenWithResponse(ctx context.Context, body ValidateEndUserAccessTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*ValidateEndUserAccessTokenResponse, error) { - rsp, err := c.ValidateEndUserAccessToken(ctx, body, reqEditors...) +// VerifyX402PaymentWithBodyWithResponse request with arbitrary body returning *VerifyX402PaymentResponse +func (c *ClientWithResponses) VerifyX402PaymentWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*VerifyX402PaymentResponse, error) { + rsp, err := c.VerifyX402PaymentWithBody(ctx, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseValidateEndUserAccessTokenResponse(rsp) + return ParseVerifyX402PaymentResponse(rsp) } -// ImportEndUserWithBodyWithResponse request with arbitrary body returning *ImportEndUserResponse -func (c *ClientWithResponses) ImportEndUserWithBodyWithResponse(ctx context.Context, params *ImportEndUserParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ImportEndUserResponse, error) { - rsp, err := c.ImportEndUserWithBody(ctx, params, contentType, body, reqEditors...) +func (c *ClientWithResponses) VerifyX402PaymentWithResponse(ctx context.Context, body VerifyX402PaymentJSONRequestBody, reqEditors ...RequestEditorFn) (*VerifyX402PaymentResponse, error) { + rsp, err := c.VerifyX402Payment(ctx, body, reqEditors...) if err != nil { return nil, err } - return ParseImportEndUserResponse(rsp) + return ParseVerifyX402PaymentResponse(rsp) } -func (c *ClientWithResponses) ImportEndUserWithResponse(ctx context.Context, params *ImportEndUserParams, body ImportEndUserJSONRequestBody, reqEditors ...RequestEditorFn) (*ImportEndUserResponse, error) { - rsp, err := c.ImportEndUser(ctx, params, body, reqEditors...) +// ParseListDataTokenBalancesResponse parses an HTTP response from a ListDataTokenBalancesWithResponse call +func ParseListDataTokenBalancesResponse(rsp *http.Response) (*ListDataTokenBalancesResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseImportEndUserResponse(rsp) + + response := &ListDataTokenBalancesResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Balances The list of EVM token balances. + Balances []TokenBalance `json:"balances"` + + // NextPageToken The token for the next page of items, if any. + NextPageToken *string `json:"nextPageToken,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest InternalServerError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 502: + var dest BadGatewayError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON502 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: + var dest ServiceUnavailableError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON503 = &dest + + } + + return response, nil } -// GetEndUserWithResponse request returning *GetEndUserResponse -func (c *ClientWithResponses) GetEndUserWithResponse(ctx context.Context, userId string, reqEditors ...RequestEditorFn) (*GetEndUserResponse, error) { - rsp, err := c.GetEndUser(ctx, userId, reqEditors...) +// ParseListTokensForAccountResponse parses an HTTP response from a ListTokensForAccountWithResponse call +func ParseListTokensForAccountResponse(rsp *http.Response) (*ListTokensForAccountResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseGetEndUserResponse(rsp) + + response := &ListTokensForAccountResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest AccountTokenAddressesResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest UnauthorizedError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON429 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest InternalServerError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil } -// AddEndUserEvmAccountWithBodyWithResponse request with arbitrary body returning *AddEndUserEvmAccountResponse -func (c *ClientWithResponses) AddEndUserEvmAccountWithBodyWithResponse(ctx context.Context, userId string, params *AddEndUserEvmAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AddEndUserEvmAccountResponse, error) { - rsp, err := c.AddEndUserEvmAccountWithBody(ctx, userId, params, contentType, body, reqEditors...) +// ParseGetSQLGrammarResponse parses an HTTP response from a GetSQLGrammarWithResponse call +func ParseGetSQLGrammarResponse(rsp *http.Response) (*GetSQLGrammarResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseAddEndUserEvmAccountResponse(rsp) -} -func (c *ClientWithResponses) AddEndUserEvmAccountWithResponse(ctx context.Context, userId string, params *AddEndUserEvmAccountParams, body AddEndUserEvmAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*AddEndUserEvmAccountResponse, error) { - rsp, err := c.AddEndUserEvmAccount(ctx, userId, params, body, reqEditors...) - if err != nil { - return nil, err + response := &GetSQLGrammarResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest string + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest UnauthorizedError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON429 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest InternalServerError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 504: + var dest TimedOutError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON504 = &dest + } - return ParseAddEndUserEvmAccountResponse(rsp) -} -// AddEndUserEvmSmartAccountWithBodyWithResponse request with arbitrary body returning *AddEndUserEvmSmartAccountResponse -func (c *ClientWithResponses) AddEndUserEvmSmartAccountWithBodyWithResponse(ctx context.Context, userId string, params *AddEndUserEvmSmartAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AddEndUserEvmSmartAccountResponse, error) { - rsp, err := c.AddEndUserEvmSmartAccountWithBody(ctx, userId, params, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseAddEndUserEvmSmartAccountResponse(rsp) + return response, nil } -func (c *ClientWithResponses) AddEndUserEvmSmartAccountWithResponse(ctx context.Context, userId string, params *AddEndUserEvmSmartAccountParams, body AddEndUserEvmSmartAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*AddEndUserEvmSmartAccountResponse, error) { - rsp, err := c.AddEndUserEvmSmartAccount(ctx, userId, params, body, reqEditors...) +// ParseRunSQLQueryResponse parses an HTTP response from a RunSQLQueryWithResponse call +func ParseRunSQLQueryResponse(rsp *http.Response) (*RunSQLQueryResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseAddEndUserEvmSmartAccountResponse(rsp) -} -// AddEndUserSolanaAccountWithBodyWithResponse request with arbitrary body returning *AddEndUserSolanaAccountResponse -func (c *ClientWithResponses) AddEndUserSolanaAccountWithBodyWithResponse(ctx context.Context, userId string, params *AddEndUserSolanaAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AddEndUserSolanaAccountResponse, error) { - rsp, err := c.AddEndUserSolanaAccountWithBody(ctx, userId, params, contentType, body, reqEditors...) - if err != nil { - return nil, err + response := &RunSQLQueryResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseAddEndUserSolanaAccountResponse(rsp) -} -func (c *ClientWithResponses) AddEndUserSolanaAccountWithResponse(ctx context.Context, userId string, params *AddEndUserSolanaAccountParams, body AddEndUserSolanaAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*AddEndUserSolanaAccountResponse, error) { - rsp, err := c.AddEndUserSolanaAccount(ctx, userId, params, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseAddEndUserSolanaAccountResponse(rsp) -} + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest OnchainDataResult + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest -// ListEvmAccountsWithResponse request returning *ListEvmAccountsResponse -func (c *ClientWithResponses) ListEvmAccountsWithResponse(ctx context.Context, params *ListEvmAccountsParams, reqEditors ...RequestEditorFn) (*ListEvmAccountsResponse, error) { - rsp, err := c.ListEvmAccounts(ctx, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseListEvmAccountsResponse(rsp) -} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest InvalidSQLQueryError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest -// CreateEvmAccountWithBodyWithResponse request with arbitrary body returning *CreateEvmAccountResponse -func (c *ClientWithResponses) CreateEvmAccountWithBodyWithResponse(ctx context.Context, params *CreateEvmAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateEvmAccountResponse, error) { - rsp, err := c.CreateEvmAccountWithBody(ctx, params, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseCreateEvmAccountResponse(rsp) -} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest UnauthorizedError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest -func (c *ClientWithResponses) CreateEvmAccountWithResponse(ctx context.Context, params *CreateEvmAccountParams, body CreateEvmAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateEvmAccountResponse, error) { - rsp, err := c.CreateEvmAccount(ctx, params, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseCreateEvmAccountResponse(rsp) -} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 402: + var dest PaymentMethodRequiredError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON402 = &dest -// GetEvmAccountByNameWithResponse request returning *GetEvmAccountByNameResponse -func (c *ClientWithResponses) GetEvmAccountByNameWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*GetEvmAccountByNameResponse, error) { - rsp, err := c.GetEvmAccountByName(ctx, name, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetEvmAccountByNameResponse(rsp) -} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 408: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON408 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON429 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 499: + var dest ClientClosedRequestError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON499 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest InternalServerError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 504: + var dest TimedOutError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON504 = &dest -// ExportEvmAccountByNameWithBodyWithResponse request with arbitrary body returning *ExportEvmAccountByNameResponse -func (c *ClientWithResponses) ExportEvmAccountByNameWithBodyWithResponse(ctx context.Context, name string, params *ExportEvmAccountByNameParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ExportEvmAccountByNameResponse, error) { - rsp, err := c.ExportEvmAccountByNameWithBody(ctx, name, params, contentType, body, reqEditors...) - if err != nil { - return nil, err } - return ParseExportEvmAccountByNameResponse(rsp) + + return response, nil } -func (c *ClientWithResponses) ExportEvmAccountByNameWithResponse(ctx context.Context, name string, params *ExportEvmAccountByNameParams, body ExportEvmAccountByNameJSONRequestBody, reqEditors ...RequestEditorFn) (*ExportEvmAccountByNameResponse, error) { - rsp, err := c.ExportEvmAccountByName(ctx, name, params, body, reqEditors...) +// ParseListWebhookSubscriptionsResponse parses an HTTP response from a ListWebhookSubscriptionsWithResponse call +func ParseListWebhookSubscriptionsResponse(rsp *http.Response) (*ListWebhookSubscriptionsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseExportEvmAccountByNameResponse(rsp) -} -// ImportEvmAccountWithBodyWithResponse request with arbitrary body returning *ImportEvmAccountResponse -func (c *ClientWithResponses) ImportEvmAccountWithBodyWithResponse(ctx context.Context, params *ImportEvmAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ImportEvmAccountResponse, error) { - rsp, err := c.ImportEvmAccountWithBody(ctx, params, contentType, body, reqEditors...) - if err != nil { - return nil, err + response := &ListWebhookSubscriptionsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseImportEvmAccountResponse(rsp) -} -func (c *ClientWithResponses) ImportEvmAccountWithResponse(ctx context.Context, params *ImportEvmAccountParams, body ImportEvmAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*ImportEvmAccountResponse, error) { - rsp, err := c.ImportEvmAccount(ctx, params, body, reqEditors...) - if err != nil { - return nil, err + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest WebhookSubscriptionListResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest UnauthorizedError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON429 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest InternalServerError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + } - return ParseImportEvmAccountResponse(rsp) + + return response, nil } -// GetEvmAccountWithResponse request returning *GetEvmAccountResponse -func (c *ClientWithResponses) GetEvmAccountWithResponse(ctx context.Context, address string, reqEditors ...RequestEditorFn) (*GetEvmAccountResponse, error) { - rsp, err := c.GetEvmAccount(ctx, address, reqEditors...) +// ParseCreateWebhookSubscriptionResponse parses an HTTP response from a CreateWebhookSubscriptionWithResponse call +func ParseCreateWebhookSubscriptionResponse(rsp *http.Response) (*CreateWebhookSubscriptionResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseGetEvmAccountResponse(rsp) -} -// UpdateEvmAccountWithBodyWithResponse request with arbitrary body returning *UpdateEvmAccountResponse -func (c *ClientWithResponses) UpdateEvmAccountWithBodyWithResponse(ctx context.Context, address string, params *UpdateEvmAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateEvmAccountResponse, error) { - rsp, err := c.UpdateEvmAccountWithBody(ctx, address, params, contentType, body, reqEditors...) - if err != nil { - return nil, err + response := &CreateWebhookSubscriptionResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseUpdateEvmAccountResponse(rsp) -} -func (c *ClientWithResponses) UpdateEvmAccountWithResponse(ctx context.Context, address string, params *UpdateEvmAccountParams, body UpdateEvmAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateEvmAccountResponse, error) { - rsp, err := c.UpdateEvmAccount(ctx, address, params, body, reqEditors...) - if err != nil { - return nil, err + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest WebhookSubscriptionResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest UnauthorizedError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON429 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest InternalServerError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + } - return ParseUpdateEvmAccountResponse(rsp) -} -// CreateEvmEip7702DelegationWithBodyWithResponse request with arbitrary body returning *CreateEvmEip7702DelegationResponse -func (c *ClientWithResponses) CreateEvmEip7702DelegationWithBodyWithResponse(ctx context.Context, address string, params *CreateEvmEip7702DelegationParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateEvmEip7702DelegationResponse, error) { - rsp, err := c.CreateEvmEip7702DelegationWithBody(ctx, address, params, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseCreateEvmEip7702DelegationResponse(rsp) + return response, nil } -func (c *ClientWithResponses) CreateEvmEip7702DelegationWithResponse(ctx context.Context, address string, params *CreateEvmEip7702DelegationParams, body CreateEvmEip7702DelegationJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateEvmEip7702DelegationResponse, error) { - rsp, err := c.CreateEvmEip7702Delegation(ctx, address, params, body, reqEditors...) +// ParseDeleteWebhookSubscriptionResponse parses an HTTP response from a DeleteWebhookSubscriptionWithResponse call +func ParseDeleteWebhookSubscriptionResponse(rsp *http.Response) (*DeleteWebhookSubscriptionResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseCreateEvmEip7702DelegationResponse(rsp) -} -// ExportEvmAccountWithBodyWithResponse request with arbitrary body returning *ExportEvmAccountResponse -func (c *ClientWithResponses) ExportEvmAccountWithBodyWithResponse(ctx context.Context, address string, params *ExportEvmAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ExportEvmAccountResponse, error) { - rsp, err := c.ExportEvmAccountWithBody(ctx, address, params, contentType, body, reqEditors...) - if err != nil { - return nil, err + response := &DeleteWebhookSubscriptionResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseExportEvmAccountResponse(rsp) -} -func (c *ClientWithResponses) ExportEvmAccountWithResponse(ctx context.Context, address string, params *ExportEvmAccountParams, body ExportEvmAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*ExportEvmAccountResponse, error) { - rsp, err := c.ExportEvmAccount(ctx, address, params, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseExportEvmAccountResponse(rsp) -} + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest UnauthorizedError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest -// SendEvmTransactionWithBodyWithResponse request with arbitrary body returning *SendEvmTransactionResponse -func (c *ClientWithResponses) SendEvmTransactionWithBodyWithResponse(ctx context.Context, address string, params *SendEvmTransactionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SendEvmTransactionResponse, error) { - rsp, err := c.SendEvmTransactionWithBody(ctx, address, params, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseSendEvmTransactionResponse(rsp) -} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest -func (c *ClientWithResponses) SendEvmTransactionWithResponse(ctx context.Context, address string, params *SendEvmTransactionParams, body SendEvmTransactionJSONRequestBody, reqEditors ...RequestEditorFn) (*SendEvmTransactionResponse, error) { - rsp, err := c.SendEvmTransaction(ctx, address, params, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseSendEvmTransactionResponse(rsp) -} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON429 = &dest -// SignEvmHashWithBodyWithResponse request with arbitrary body returning *SignEvmHashResponse -func (c *ClientWithResponses) SignEvmHashWithBodyWithResponse(ctx context.Context, address string, params *SignEvmHashParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SignEvmHashResponse, error) { - rsp, err := c.SignEvmHashWithBody(ctx, address, params, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseSignEvmHashResponse(rsp) -} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest InternalServerError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest -func (c *ClientWithResponses) SignEvmHashWithResponse(ctx context.Context, address string, params *SignEvmHashParams, body SignEvmHashJSONRequestBody, reqEditors ...RequestEditorFn) (*SignEvmHashResponse, error) { - rsp, err := c.SignEvmHash(ctx, address, params, body, reqEditors...) - if err != nil { - return nil, err } - return ParseSignEvmHashResponse(rsp) -} -// SignEvmMessageWithBodyWithResponse request with arbitrary body returning *SignEvmMessageResponse -func (c *ClientWithResponses) SignEvmMessageWithBodyWithResponse(ctx context.Context, address string, params *SignEvmMessageParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SignEvmMessageResponse, error) { - rsp, err := c.SignEvmMessageWithBody(ctx, address, params, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseSignEvmMessageResponse(rsp) + return response, nil } -func (c *ClientWithResponses) SignEvmMessageWithResponse(ctx context.Context, address string, params *SignEvmMessageParams, body SignEvmMessageJSONRequestBody, reqEditors ...RequestEditorFn) (*SignEvmMessageResponse, error) { - rsp, err := c.SignEvmMessage(ctx, address, params, body, reqEditors...) +// ParseGetWebhookSubscriptionResponse parses an HTTP response from a GetWebhookSubscriptionWithResponse call +func ParseGetWebhookSubscriptionResponse(rsp *http.Response) (*GetWebhookSubscriptionResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseSignEvmMessageResponse(rsp) -} -// SignEvmTransactionWithBodyWithResponse request with arbitrary body returning *SignEvmTransactionResponse -func (c *ClientWithResponses) SignEvmTransactionWithBodyWithResponse(ctx context.Context, address string, params *SignEvmTransactionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SignEvmTransactionResponse, error) { - rsp, err := c.SignEvmTransactionWithBody(ctx, address, params, contentType, body, reqEditors...) - if err != nil { - return nil, err + response := &GetWebhookSubscriptionResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseSignEvmTransactionResponse(rsp) -} -func (c *ClientWithResponses) SignEvmTransactionWithResponse(ctx context.Context, address string, params *SignEvmTransactionParams, body SignEvmTransactionJSONRequestBody, reqEditors ...RequestEditorFn) (*SignEvmTransactionResponse, error) { - rsp, err := c.SignEvmTransaction(ctx, address, params, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseSignEvmTransactionResponse(rsp) -} + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest WebhookSubscriptionResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest -// SignEvmTypedDataWithBodyWithResponse request with arbitrary body returning *SignEvmTypedDataResponse -func (c *ClientWithResponses) SignEvmTypedDataWithBodyWithResponse(ctx context.Context, address string, params *SignEvmTypedDataParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SignEvmTypedDataResponse, error) { - rsp, err := c.SignEvmTypedDataWithBody(ctx, address, params, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseSignEvmTypedDataResponse(rsp) -} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest UnauthorizedError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest -func (c *ClientWithResponses) SignEvmTypedDataWithResponse(ctx context.Context, address string, params *SignEvmTypedDataParams, body SignEvmTypedDataJSONRequestBody, reqEditors ...RequestEditorFn) (*SignEvmTypedDataResponse, error) { - rsp, err := c.SignEvmTypedData(ctx, address, params, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseSignEvmTypedDataResponse(rsp) -} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest -// GetEvmEip7702DelegationOperationByIdWithResponse request returning *GetEvmEip7702DelegationOperationByIdResponse -func (c *ClientWithResponses) GetEvmEip7702DelegationOperationByIdWithResponse(ctx context.Context, delegationOperationId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetEvmEip7702DelegationOperationByIdResponse, error) { - rsp, err := c.GetEvmEip7702DelegationOperationById(ctx, delegationOperationId, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetEvmEip7702DelegationOperationByIdResponse(rsp) -} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON429 = &dest -// RequestEvmFaucetWithBodyWithResponse request with arbitrary body returning *RequestEvmFaucetResponse -func (c *ClientWithResponses) RequestEvmFaucetWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RequestEvmFaucetResponse, error) { - rsp, err := c.RequestEvmFaucetWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseRequestEvmFaucetResponse(rsp) -} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest InternalServerError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest -func (c *ClientWithResponses) RequestEvmFaucetWithResponse(ctx context.Context, body RequestEvmFaucetJSONRequestBody, reqEditors ...RequestEditorFn) (*RequestEvmFaucetResponse, error) { - rsp, err := c.RequestEvmFaucet(ctx, body, reqEditors...) - if err != nil { - return nil, err } - return ParseRequestEvmFaucetResponse(rsp) + + return response, nil } -// ListEvmSmartAccountsWithResponse request returning *ListEvmSmartAccountsResponse -func (c *ClientWithResponses) ListEvmSmartAccountsWithResponse(ctx context.Context, params *ListEvmSmartAccountsParams, reqEditors ...RequestEditorFn) (*ListEvmSmartAccountsResponse, error) { - rsp, err := c.ListEvmSmartAccounts(ctx, params, reqEditors...) +// ParseUpdateWebhookSubscriptionResponse parses an HTTP response from a UpdateWebhookSubscriptionWithResponse call +func ParseUpdateWebhookSubscriptionResponse(rsp *http.Response) (*UpdateWebhookSubscriptionResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseListEvmSmartAccountsResponse(rsp) -} -// CreateEvmSmartAccountWithBodyWithResponse request with arbitrary body returning *CreateEvmSmartAccountResponse -func (c *ClientWithResponses) CreateEvmSmartAccountWithBodyWithResponse(ctx context.Context, params *CreateEvmSmartAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateEvmSmartAccountResponse, error) { - rsp, err := c.CreateEvmSmartAccountWithBody(ctx, params, contentType, body, reqEditors...) - if err != nil { - return nil, err + response := &UpdateWebhookSubscriptionResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseCreateEvmSmartAccountResponse(rsp) -} -func (c *ClientWithResponses) CreateEvmSmartAccountWithResponse(ctx context.Context, params *CreateEvmSmartAccountParams, body CreateEvmSmartAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateEvmSmartAccountResponse, error) { - rsp, err := c.CreateEvmSmartAccount(ctx, params, body, reqEditors...) - if err != nil { - return nil, err + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest WebhookSubscriptionResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest UnauthorizedError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON429 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest InternalServerError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + } - return ParseCreateEvmSmartAccountResponse(rsp) -} -// GetEvmSmartAccountByNameWithResponse request returning *GetEvmSmartAccountByNameResponse -func (c *ClientWithResponses) GetEvmSmartAccountByNameWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*GetEvmSmartAccountByNameResponse, error) { - rsp, err := c.GetEvmSmartAccountByName(ctx, name, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetEvmSmartAccountByNameResponse(rsp) + return response, nil } -// GetEvmSmartAccountWithResponse request returning *GetEvmSmartAccountResponse -func (c *ClientWithResponses) GetEvmSmartAccountWithResponse(ctx context.Context, address string, reqEditors ...RequestEditorFn) (*GetEvmSmartAccountResponse, error) { - rsp, err := c.GetEvmSmartAccount(ctx, address, reqEditors...) +// ParseRevokeDelegationForEndUserResponse parses an HTTP response from a RevokeDelegationForEndUserWithResponse call +func ParseRevokeDelegationForEndUserResponse(rsp *http.Response) (*RevokeDelegationForEndUserResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseGetEvmSmartAccountResponse(rsp) -} -// UpdateEvmSmartAccountWithBodyWithResponse request with arbitrary body returning *UpdateEvmSmartAccountResponse -func (c *ClientWithResponses) UpdateEvmSmartAccountWithBodyWithResponse(ctx context.Context, address string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateEvmSmartAccountResponse, error) { - rsp, err := c.UpdateEvmSmartAccountWithBody(ctx, address, contentType, body, reqEditors...) - if err != nil { - return nil, err + response := &RevokeDelegationForEndUserResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseUpdateEvmSmartAccountResponse(rsp) -} -func (c *ClientWithResponses) UpdateEvmSmartAccountWithResponse(ctx context.Context, address string, body UpdateEvmSmartAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateEvmSmartAccountResponse, error) { - rsp, err := c.UpdateEvmSmartAccount(ctx, address, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseUpdateEvmSmartAccountResponse(rsp) -} + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest UnauthorizedError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest -// CreateSpendPermissionWithBodyWithResponse request with arbitrary body returning *CreateSpendPermissionResponse -func (c *ClientWithResponses) CreateSpendPermissionWithBodyWithResponse(ctx context.Context, address string, params *CreateSpendPermissionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateSpendPermissionResponse, error) { - rsp, err := c.CreateSpendPermissionWithBody(ctx, address, params, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseCreateSpendPermissionResponse(rsp) -} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest -func (c *ClientWithResponses) CreateSpendPermissionWithResponse(ctx context.Context, address string, params *CreateSpendPermissionParams, body CreateSpendPermissionJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateSpendPermissionResponse, error) { - rsp, err := c.CreateSpendPermission(ctx, address, params, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseCreateSpendPermissionResponse(rsp) -} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest InternalServerError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest -// ListSpendPermissionsWithResponse request returning *ListSpendPermissionsResponse -func (c *ClientWithResponses) ListSpendPermissionsWithResponse(ctx context.Context, address string, params *ListSpendPermissionsParams, reqEditors ...RequestEditorFn) (*ListSpendPermissionsResponse, error) { - rsp, err := c.ListSpendPermissions(ctx, address, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseListSpendPermissionsResponse(rsp) -} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 502: + var dest BadGatewayError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON502 = &dest -// RevokeSpendPermissionWithBodyWithResponse request with arbitrary body returning *RevokeSpendPermissionResponse -func (c *ClientWithResponses) RevokeSpendPermissionWithBodyWithResponse(ctx context.Context, address string, params *RevokeSpendPermissionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RevokeSpendPermissionResponse, error) { - rsp, err := c.RevokeSpendPermissionWithBody(ctx, address, params, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseRevokeSpendPermissionResponse(rsp) -} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: + var dest ServiceUnavailableError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON503 = &dest -func (c *ClientWithResponses) RevokeSpendPermissionWithResponse(ctx context.Context, address string, params *RevokeSpendPermissionParams, body RevokeSpendPermissionJSONRequestBody, reqEditors ...RequestEditorFn) (*RevokeSpendPermissionResponse, error) { - rsp, err := c.RevokeSpendPermission(ctx, address, params, body, reqEditors...) - if err != nil { - return nil, err } - return ParseRevokeSpendPermissionResponse(rsp) -} -// PrepareUserOperationWithBodyWithResponse request with arbitrary body returning *PrepareUserOperationResponse -func (c *ClientWithResponses) PrepareUserOperationWithBodyWithResponse(ctx context.Context, address string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PrepareUserOperationResponse, error) { - rsp, err := c.PrepareUserOperationWithBody(ctx, address, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParsePrepareUserOperationResponse(rsp) + return response, nil } -func (c *ClientWithResponses) PrepareUserOperationWithResponse(ctx context.Context, address string, body PrepareUserOperationJSONRequestBody, reqEditors ...RequestEditorFn) (*PrepareUserOperationResponse, error) { - rsp, err := c.PrepareUserOperation(ctx, address, body, reqEditors...) +// ParseCreateEvmEip7702DelegationWithEndUserAccountResponse parses an HTTP response from a CreateEvmEip7702DelegationWithEndUserAccountWithResponse call +func ParseCreateEvmEip7702DelegationWithEndUserAccountResponse(rsp *http.Response) (*CreateEvmEip7702DelegationWithEndUserAccountResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParsePrepareUserOperationResponse(rsp) -} -// PrepareAndSendUserOperationWithBodyWithResponse request with arbitrary body returning *PrepareAndSendUserOperationResponse -func (c *ClientWithResponses) PrepareAndSendUserOperationWithBodyWithResponse(ctx context.Context, address string, params *PrepareAndSendUserOperationParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PrepareAndSendUserOperationResponse, error) { - rsp, err := c.PrepareAndSendUserOperationWithBody(ctx, address, params, contentType, body, reqEditors...) - if err != nil { - return nil, err + response := &CreateEvmEip7702DelegationWithEndUserAccountResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParsePrepareAndSendUserOperationResponse(rsp) -} -func (c *ClientWithResponses) PrepareAndSendUserOperationWithResponse(ctx context.Context, address string, params *PrepareAndSendUserOperationParams, body PrepareAndSendUserOperationJSONRequestBody, reqEditors ...RequestEditorFn) (*PrepareAndSendUserOperationResponse, error) { - rsp, err := c.PrepareAndSendUserOperation(ctx, address, params, body, reqEditors...) - if err != nil { - return nil, err - } - return ParsePrepareAndSendUserOperationResponse(rsp) -} + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest struct { + // DelegationOperationId The unique identifier for the delegation operation. Use this to poll the operation status. + DelegationOperationId openapi_types.UUID `json:"delegationOperationId"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest -// GetUserOperationWithResponse request returning *GetUserOperationResponse -func (c *ClientWithResponses) GetUserOperationWithResponse(ctx context.Context, address string, userOpHash string, reqEditors ...RequestEditorFn) (*GetUserOperationResponse, error) { - rsp, err := c.GetUserOperation(ctx, address, userOpHash, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetUserOperationResponse(rsp) -} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest -// SendUserOperationWithBodyWithResponse request with arbitrary body returning *SendUserOperationResponse -func (c *ClientWithResponses) SendUserOperationWithBodyWithResponse(ctx context.Context, address string, userOpHash string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SendUserOperationResponse, error) { - rsp, err := c.SendUserOperationWithBody(ctx, address, userOpHash, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseSendUserOperationResponse(rsp) -} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest UnauthorizedError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest -func (c *ClientWithResponses) SendUserOperationWithResponse(ctx context.Context, address string, userOpHash string, body SendUserOperationJSONRequestBody, reqEditors ...RequestEditorFn) (*SendUserOperationResponse, error) { - rsp, err := c.SendUserOperation(ctx, address, userOpHash, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseSendUserOperationResponse(rsp) -} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 402: + var dest PaymentMethodRequiredError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON402 = &dest -// CreateEvmSwapQuoteWithBodyWithResponse request with arbitrary body returning *CreateEvmSwapQuoteResponse -func (c *ClientWithResponses) CreateEvmSwapQuoteWithBodyWithResponse(ctx context.Context, params *CreateEvmSwapQuoteParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateEvmSwapQuoteResponse, error) { - rsp, err := c.CreateEvmSwapQuoteWithBody(ctx, params, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseCreateEvmSwapQuoteResponse(rsp) -} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest -func (c *ClientWithResponses) CreateEvmSwapQuoteWithResponse(ctx context.Context, params *CreateEvmSwapQuoteParams, body CreateEvmSwapQuoteJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateEvmSwapQuoteResponse, error) { - rsp, err := c.CreateEvmSwapQuote(ctx, params, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseCreateEvmSwapQuoteResponse(rsp) -} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON409 = &dest -// GetEvmSwapPriceWithResponse request returning *GetEvmSwapPriceResponse -func (c *ClientWithResponses) GetEvmSwapPriceWithResponse(ctx context.Context, params *GetEvmSwapPriceParams, reqEditors ...RequestEditorFn) (*GetEvmSwapPriceResponse, error) { - rsp, err := c.GetEvmSwapPrice(ctx, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetEvmSwapPriceResponse(rsp) -} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: + var dest IdempotencyError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON422 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON429 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest InternalServerError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 502: + var dest BadGatewayError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON502 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: + var dest ServiceUnavailableError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON503 = &dest -// ListEvmTokenBalancesWithResponse request returning *ListEvmTokenBalancesResponse -func (c *ClientWithResponses) ListEvmTokenBalancesWithResponse(ctx context.Context, network ListEvmTokenBalancesNetwork, address string, params *ListEvmTokenBalancesParams, reqEditors ...RequestEditorFn) (*ListEvmTokenBalancesResponse, error) { - rsp, err := c.ListEvmTokenBalances(ctx, network, address, params, reqEditors...) - if err != nil { - return nil, err } - return ParseListEvmTokenBalancesResponse(rsp) -} -// GetOnrampUserLimitsWithBodyWithResponse request with arbitrary body returning *GetOnrampUserLimitsResponse -func (c *ClientWithResponses) GetOnrampUserLimitsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*GetOnrampUserLimitsResponse, error) { - rsp, err := c.GetOnrampUserLimitsWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetOnrampUserLimitsResponse(rsp) + return response, nil } -func (c *ClientWithResponses) GetOnrampUserLimitsWithResponse(ctx context.Context, body GetOnrampUserLimitsJSONRequestBody, reqEditors ...RequestEditorFn) (*GetOnrampUserLimitsResponse, error) { - rsp, err := c.GetOnrampUserLimits(ctx, body, reqEditors...) +// ParseSendEvmTransactionWithEndUserAccountResponse parses an HTTP response from a SendEvmTransactionWithEndUserAccountWithResponse call +func ParseSendEvmTransactionWithEndUserAccountResponse(rsp *http.Response) (*SendEvmTransactionWithEndUserAccountResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseGetOnrampUserLimitsResponse(rsp) -} -// CreateOnrampOrderWithBodyWithResponse request with arbitrary body returning *CreateOnrampOrderResponse -func (c *ClientWithResponses) CreateOnrampOrderWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateOnrampOrderResponse, error) { - rsp, err := c.CreateOnrampOrderWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err + response := &SendEvmTransactionWithEndUserAccountResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseCreateOnrampOrderResponse(rsp) -} -func (c *ClientWithResponses) CreateOnrampOrderWithResponse(ctx context.Context, body CreateOnrampOrderJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateOnrampOrderResponse, error) { - rsp, err := c.CreateOnrampOrder(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseCreateOnrampOrderResponse(rsp) -} + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // TransactionHash The hash of the transaction, as a 0x-prefixed hex string. + TransactionHash string `json:"transactionHash"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest -// GetOnrampOrderByIdWithResponse request returning *GetOnrampOrderByIdResponse -func (c *ClientWithResponses) GetOnrampOrderByIdWithResponse(ctx context.Context, orderId string, reqEditors ...RequestEditorFn) (*GetOnrampOrderByIdResponse, error) { - rsp, err := c.GetOnrampOrderById(ctx, orderId, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetOnrampOrderByIdResponse(rsp) -} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest -// CreateOnrampSessionWithBodyWithResponse request with arbitrary body returning *CreateOnrampSessionResponse -func (c *ClientWithResponses) CreateOnrampSessionWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateOnrampSessionResponse, error) { - rsp, err := c.CreateOnrampSessionWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseCreateOnrampSessionResponse(rsp) -} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest UnauthorizedError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest -func (c *ClientWithResponses) CreateOnrampSessionWithResponse(ctx context.Context, body CreateOnrampSessionJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateOnrampSessionResponse, error) { - rsp, err := c.CreateOnrampSession(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseCreateOnrampSessionResponse(rsp) -} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 402: + var dest PaymentMethodRequiredError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON402 = &dest -// ListPoliciesWithResponse request returning *ListPoliciesResponse -func (c *ClientWithResponses) ListPoliciesWithResponse(ctx context.Context, params *ListPoliciesParams, reqEditors ...RequestEditorFn) (*ListPoliciesResponse, error) { - rsp, err := c.ListPolicies(ctx, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseListPoliciesResponse(rsp) -} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest -// CreatePolicyWithBodyWithResponse request with arbitrary body returning *CreatePolicyResponse -func (c *ClientWithResponses) CreatePolicyWithBodyWithResponse(ctx context.Context, params *CreatePolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreatePolicyResponse, error) { - rsp, err := c.CreatePolicyWithBody(ctx, params, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseCreatePolicyResponse(rsp) -} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest -func (c *ClientWithResponses) CreatePolicyWithResponse(ctx context.Context, params *CreatePolicyParams, body CreatePolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*CreatePolicyResponse, error) { - rsp, err := c.CreatePolicy(ctx, params, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseCreatePolicyResponse(rsp) -} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: + var dest AlreadyExistsError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON409 = &dest -// DeletePolicyWithResponse request returning *DeletePolicyResponse -func (c *ClientWithResponses) DeletePolicyWithResponse(ctx context.Context, policyId string, params *DeletePolicyParams, reqEditors ...RequestEditorFn) (*DeletePolicyResponse, error) { - rsp, err := c.DeletePolicy(ctx, policyId, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseDeletePolicyResponse(rsp) -} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: + var dest IdempotencyError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON422 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest InternalServerError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 502: + var dest BadGatewayError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON502 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: + var dest ServiceUnavailableError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON503 = &dest -// GetPolicyByIdWithResponse request returning *GetPolicyByIdResponse -func (c *ClientWithResponses) GetPolicyByIdWithResponse(ctx context.Context, policyId string, reqEditors ...RequestEditorFn) (*GetPolicyByIdResponse, error) { - rsp, err := c.GetPolicyById(ctx, policyId, reqEditors...) - if err != nil { - return nil, err } - return ParseGetPolicyByIdResponse(rsp) + + return response, nil } -// UpdatePolicyWithBodyWithResponse request with arbitrary body returning *UpdatePolicyResponse -func (c *ClientWithResponses) UpdatePolicyWithBodyWithResponse(ctx context.Context, policyId string, params *UpdatePolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdatePolicyResponse, error) { - rsp, err := c.UpdatePolicyWithBody(ctx, policyId, params, contentType, body, reqEditors...) +// ParseSignEvmHashWithEndUserAccountResponse parses an HTTP response from a SignEvmHashWithEndUserAccountWithResponse call +func ParseSignEvmHashWithEndUserAccountResponse(rsp *http.Response) (*SignEvmHashWithEndUserAccountResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseUpdatePolicyResponse(rsp) -} -func (c *ClientWithResponses) UpdatePolicyWithResponse(ctx context.Context, policyId string, params *UpdatePolicyParams, body UpdatePolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdatePolicyResponse, error) { - rsp, err := c.UpdatePolicy(ctx, policyId, params, body, reqEditors...) - if err != nil { - return nil, err + response := &SignEvmHashWithEndUserAccountResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseUpdatePolicyResponse(rsp) -} -// ListSolanaAccountsWithResponse request returning *ListSolanaAccountsResponse -func (c *ClientWithResponses) ListSolanaAccountsWithResponse(ctx context.Context, params *ListSolanaAccountsParams, reqEditors ...RequestEditorFn) (*ListSolanaAccountsResponse, error) { - rsp, err := c.ListSolanaAccounts(ctx, params, reqEditors...) - if err != nil { - return nil, err + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Signature The signature of the hash, as a 0x-prefixed hex string. + Signature string `json:"signature"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest UnauthorizedError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 402: + var dest PaymentMethodRequiredError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON402 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: + var dest AlreadyExistsError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON409 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: + var dest IdempotencyError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON422 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest InternalServerError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 502: + var dest BadGatewayError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON502 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: + var dest ServiceUnavailableError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON503 = &dest + } - return ParseListSolanaAccountsResponse(rsp) -} -// CreateSolanaAccountWithBodyWithResponse request with arbitrary body returning *CreateSolanaAccountResponse -func (c *ClientWithResponses) CreateSolanaAccountWithBodyWithResponse(ctx context.Context, params *CreateSolanaAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateSolanaAccountResponse, error) { - rsp, err := c.CreateSolanaAccountWithBody(ctx, params, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseCreateSolanaAccountResponse(rsp) + return response, nil } -func (c *ClientWithResponses) CreateSolanaAccountWithResponse(ctx context.Context, params *CreateSolanaAccountParams, body CreateSolanaAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateSolanaAccountResponse, error) { - rsp, err := c.CreateSolanaAccount(ctx, params, body, reqEditors...) +// ParseSignEvmMessageWithEndUserAccountResponse parses an HTTP response from a SignEvmMessageWithEndUserAccountWithResponse call +func ParseSignEvmMessageWithEndUserAccountResponse(rsp *http.Response) (*SignEvmMessageWithEndUserAccountResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseCreateSolanaAccountResponse(rsp) -} -// GetSolanaAccountByNameWithResponse request returning *GetSolanaAccountByNameResponse -func (c *ClientWithResponses) GetSolanaAccountByNameWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*GetSolanaAccountByNameResponse, error) { - rsp, err := c.GetSolanaAccountByName(ctx, name, reqEditors...) - if err != nil { - return nil, err + response := &SignEvmMessageWithEndUserAccountResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseGetSolanaAccountByNameResponse(rsp) -} -// ExportSolanaAccountByNameWithBodyWithResponse request with arbitrary body returning *ExportSolanaAccountByNameResponse -func (c *ClientWithResponses) ExportSolanaAccountByNameWithBodyWithResponse(ctx context.Context, name string, params *ExportSolanaAccountByNameParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ExportSolanaAccountByNameResponse, error) { - rsp, err := c.ExportSolanaAccountByNameWithBody(ctx, name, params, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseExportSolanaAccountByNameResponse(rsp) -} + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Signature The signature of the message, as a 0x-prefixed hex string. + Signature string `json:"signature"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest -func (c *ClientWithResponses) ExportSolanaAccountByNameWithResponse(ctx context.Context, name string, params *ExportSolanaAccountByNameParams, body ExportSolanaAccountByNameJSONRequestBody, reqEditors ...RequestEditorFn) (*ExportSolanaAccountByNameResponse, error) { - rsp, err := c.ExportSolanaAccountByName(ctx, name, params, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseExportSolanaAccountByNameResponse(rsp) -} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest UnauthorizedError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest -// ImportSolanaAccountWithBodyWithResponse request with arbitrary body returning *ImportSolanaAccountResponse -func (c *ClientWithResponses) ImportSolanaAccountWithBodyWithResponse(ctx context.Context, params *ImportSolanaAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ImportSolanaAccountResponse, error) { - rsp, err := c.ImportSolanaAccountWithBody(ctx, params, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseImportSolanaAccountResponse(rsp) -} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 402: + var dest PaymentMethodRequiredError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON402 = &dest -func (c *ClientWithResponses) ImportSolanaAccountWithResponse(ctx context.Context, params *ImportSolanaAccountParams, body ImportSolanaAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*ImportSolanaAccountResponse, error) { - rsp, err := c.ImportSolanaAccount(ctx, params, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseImportSolanaAccountResponse(rsp) -} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest -// SendSolanaTransactionWithBodyWithResponse request with arbitrary body returning *SendSolanaTransactionResponse -func (c *ClientWithResponses) SendSolanaTransactionWithBodyWithResponse(ctx context.Context, params *SendSolanaTransactionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SendSolanaTransactionResponse, error) { - rsp, err := c.SendSolanaTransactionWithBody(ctx, params, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseSendSolanaTransactionResponse(rsp) -} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: + var dest AlreadyExistsError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON409 = &dest -func (c *ClientWithResponses) SendSolanaTransactionWithResponse(ctx context.Context, params *SendSolanaTransactionParams, body SendSolanaTransactionJSONRequestBody, reqEditors ...RequestEditorFn) (*SendSolanaTransactionResponse, error) { - rsp, err := c.SendSolanaTransaction(ctx, params, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseSendSolanaTransactionResponse(rsp) -} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: + var dest IdempotencyError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON422 = &dest -// GetSolanaAccountWithResponse request returning *GetSolanaAccountResponse -func (c *ClientWithResponses) GetSolanaAccountWithResponse(ctx context.Context, address string, reqEditors ...RequestEditorFn) (*GetSolanaAccountResponse, error) { - rsp, err := c.GetSolanaAccount(ctx, address, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetSolanaAccountResponse(rsp) -} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest InternalServerError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest -// UpdateSolanaAccountWithBodyWithResponse request with arbitrary body returning *UpdateSolanaAccountResponse -func (c *ClientWithResponses) UpdateSolanaAccountWithBodyWithResponse(ctx context.Context, address string, params *UpdateSolanaAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateSolanaAccountResponse, error) { - rsp, err := c.UpdateSolanaAccountWithBody(ctx, address, params, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseUpdateSolanaAccountResponse(rsp) -} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 502: + var dest BadGatewayError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON502 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: + var dest ServiceUnavailableError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON503 = &dest -func (c *ClientWithResponses) UpdateSolanaAccountWithResponse(ctx context.Context, address string, params *UpdateSolanaAccountParams, body UpdateSolanaAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateSolanaAccountResponse, error) { - rsp, err := c.UpdateSolanaAccount(ctx, address, params, body, reqEditors...) - if err != nil { - return nil, err } - return ParseUpdateSolanaAccountResponse(rsp) + + return response, nil } -// ExportSolanaAccountWithBodyWithResponse request with arbitrary body returning *ExportSolanaAccountResponse -func (c *ClientWithResponses) ExportSolanaAccountWithBodyWithResponse(ctx context.Context, address string, params *ExportSolanaAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ExportSolanaAccountResponse, error) { - rsp, err := c.ExportSolanaAccountWithBody(ctx, address, params, contentType, body, reqEditors...) +// ParseSignEvmTransactionWithEndUserAccountResponse parses an HTTP response from a SignEvmTransactionWithEndUserAccountWithResponse call +func ParseSignEvmTransactionWithEndUserAccountResponse(rsp *http.Response) (*SignEvmTransactionWithEndUserAccountResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseExportSolanaAccountResponse(rsp) -} -func (c *ClientWithResponses) ExportSolanaAccountWithResponse(ctx context.Context, address string, params *ExportSolanaAccountParams, body ExportSolanaAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*ExportSolanaAccountResponse, error) { - rsp, err := c.ExportSolanaAccount(ctx, address, params, body, reqEditors...) - if err != nil { - return nil, err + response := &SignEvmTransactionWithEndUserAccountResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseExportSolanaAccountResponse(rsp) -} -// SignSolanaMessageWithBodyWithResponse request with arbitrary body returning *SignSolanaMessageResponse -func (c *ClientWithResponses) SignSolanaMessageWithBodyWithResponse(ctx context.Context, address string, params *SignSolanaMessageParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SignSolanaMessageResponse, error) { - rsp, err := c.SignSolanaMessageWithBody(ctx, address, params, contentType, body, reqEditors...) - if err != nil { - return nil, err + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // SignedTransaction The RLP-encoded signed transaction, as a 0x-prefixed hex string. + SignedTransaction string `json:"signedTransaction"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest UnauthorizedError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 402: + var dest PaymentMethodRequiredError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON402 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: + var dest AlreadyExistsError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON409 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: + var dest IdempotencyError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON422 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest InternalServerError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 502: + var dest BadGatewayError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON502 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: + var dest ServiceUnavailableError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON503 = &dest + } - return ParseSignSolanaMessageResponse(rsp) -} -func (c *ClientWithResponses) SignSolanaMessageWithResponse(ctx context.Context, address string, params *SignSolanaMessageParams, body SignSolanaMessageJSONRequestBody, reqEditors ...RequestEditorFn) (*SignSolanaMessageResponse, error) { - rsp, err := c.SignSolanaMessage(ctx, address, params, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseSignSolanaMessageResponse(rsp) + return response, nil } -// SignSolanaTransactionWithBodyWithResponse request with arbitrary body returning *SignSolanaTransactionResponse -func (c *ClientWithResponses) SignSolanaTransactionWithBodyWithResponse(ctx context.Context, address string, params *SignSolanaTransactionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SignSolanaTransactionResponse, error) { - rsp, err := c.SignSolanaTransactionWithBody(ctx, address, params, contentType, body, reqEditors...) +// ParseSignEvmTypedDataWithEndUserAccountResponse parses an HTTP response from a SignEvmTypedDataWithEndUserAccountWithResponse call +func ParseSignEvmTypedDataWithEndUserAccountResponse(rsp *http.Response) (*SignEvmTypedDataWithEndUserAccountResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseSignSolanaTransactionResponse(rsp) -} -func (c *ClientWithResponses) SignSolanaTransactionWithResponse(ctx context.Context, address string, params *SignSolanaTransactionParams, body SignSolanaTransactionJSONRequestBody, reqEditors ...RequestEditorFn) (*SignSolanaTransactionResponse, error) { - rsp, err := c.SignSolanaTransaction(ctx, address, params, body, reqEditors...) - if err != nil { - return nil, err + response := &SignEvmTypedDataWithEndUserAccountResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseSignSolanaTransactionResponse(rsp) -} -// RequestSolanaFaucetWithBodyWithResponse request with arbitrary body returning *RequestSolanaFaucetResponse -func (c *ClientWithResponses) RequestSolanaFaucetWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RequestSolanaFaucetResponse, error) { - rsp, err := c.RequestSolanaFaucetWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseRequestSolanaFaucetResponse(rsp) -} + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Signature The signature of the typed data, as a 0x-prefixed hex string. + Signature string `json:"signature"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest -func (c *ClientWithResponses) RequestSolanaFaucetWithResponse(ctx context.Context, body RequestSolanaFaucetJSONRequestBody, reqEditors ...RequestEditorFn) (*RequestSolanaFaucetResponse, error) { - rsp, err := c.RequestSolanaFaucet(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseRequestSolanaFaucetResponse(rsp) -} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest -// ListSolanaTokenBalancesWithResponse request returning *ListSolanaTokenBalancesResponse -func (c *ClientWithResponses) ListSolanaTokenBalancesWithResponse(ctx context.Context, network ListSolanaTokenBalancesNetwork, address string, params *ListSolanaTokenBalancesParams, reqEditors ...RequestEditorFn) (*ListSolanaTokenBalancesResponse, error) { - rsp, err := c.ListSolanaTokenBalances(ctx, network, address, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseListSolanaTokenBalancesResponse(rsp) -} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest UnauthorizedError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest -// SettleX402PaymentWithBodyWithResponse request with arbitrary body returning *SettleX402PaymentResponse -func (c *ClientWithResponses) SettleX402PaymentWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SettleX402PaymentResponse, error) { - rsp, err := c.SettleX402PaymentWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseSettleX402PaymentResponse(rsp) -} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 402: + var dest PaymentMethodRequiredError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON402 = &dest -func (c *ClientWithResponses) SettleX402PaymentWithResponse(ctx context.Context, body SettleX402PaymentJSONRequestBody, reqEditors ...RequestEditorFn) (*SettleX402PaymentResponse, error) { - rsp, err := c.SettleX402Payment(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseSettleX402PaymentResponse(rsp) -} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest -// SupportedX402PaymentKindsWithResponse request returning *SupportedX402PaymentKindsResponse -func (c *ClientWithResponses) SupportedX402PaymentKindsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*SupportedX402PaymentKindsResponse, error) { - rsp, err := c.SupportedX402PaymentKinds(ctx, reqEditors...) - if err != nil { - return nil, err - } - return ParseSupportedX402PaymentKindsResponse(rsp) -} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: + var dest IdempotencyError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON422 = &dest -// VerifyX402PaymentWithBodyWithResponse request with arbitrary body returning *VerifyX402PaymentResponse -func (c *ClientWithResponses) VerifyX402PaymentWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*VerifyX402PaymentResponse, error) { - rsp, err := c.VerifyX402PaymentWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseVerifyX402PaymentResponse(rsp) -} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest InternalServerError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 502: + var dest BadGatewayError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON502 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: + var dest ServiceUnavailableError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON503 = &dest -func (c *ClientWithResponses) VerifyX402PaymentWithResponse(ctx context.Context, body VerifyX402PaymentJSONRequestBody, reqEditors ...RequestEditorFn) (*VerifyX402PaymentResponse, error) { - rsp, err := c.VerifyX402Payment(ctx, body, reqEditors...) - if err != nil { - return nil, err } - return ParseVerifyX402PaymentResponse(rsp) + + return response, nil } -// ParseListDataTokenBalancesResponse parses an HTTP response from a ListDataTokenBalancesWithResponse call -func ParseListDataTokenBalancesResponse(rsp *http.Response) (*ListDataTokenBalancesResponse, error) { +// ParseSendUserOperationWithEndUserAccountResponse parses an HTTP response from a SendUserOperationWithEndUserAccountWithResponse call +func ParseSendUserOperationWithEndUserAccountResponse(rsp *http.Response) (*SendUserOperationWithEndUserAccountResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ListDataTokenBalancesResponse{ + response := &SendUserOperationWithEndUserAccountResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest struct { - // Balances The list of EVM token balances. - Balances []TokenBalance `json:"balances"` - - // NextPageToken The token for the next page of items, if any. - NextPageToken *string `json:"nextPageToken,omitempty"` - } + var dest EvmUserOperation if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -17645,6 +22032,27 @@ func ParseListDataTokenBalancesResponse(rsp *http.Response) (*ListDataTokenBalan } response.JSON400 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest UnauthorizedError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 402: + var dest PaymentMethodRequiredError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON402 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -17652,6 +22060,13 @@ func ParseListDataTokenBalancesResponse(rsp *http.Response) (*ListDataTokenBalan } response.JSON404 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON429 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest InternalServerError if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -17678,22 +22093,22 @@ func ParseListDataTokenBalancesResponse(rsp *http.Response) (*ListDataTokenBalan return response, nil } -// ParseListTokensForAccountResponse parses an HTTP response from a ListTokensForAccountWithResponse call -func ParseListTokensForAccountResponse(rsp *http.Response) (*ListTokensForAccountResponse, error) { +// ParseRevokeSpendPermissionWithEndUserAccountResponse parses an HTTP response from a RevokeSpendPermissionWithEndUserAccountWithResponse call +func ParseRevokeSpendPermissionWithEndUserAccountResponse(rsp *http.Response) (*RevokeSpendPermissionWithEndUserAccountResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ListTokensForAccountResponse{ + response := &RevokeSpendPermissionWithEndUserAccountResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest AccountTokenAddressesResponse + var dest EvmUserOperation if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -17713,12 +22128,12 @@ func ParseListTokensForAccountResponse(rsp *http.Response) (*ListTokensForAccoun } response.JSON401 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON429 = &dest + response.JSON404 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest InternalServerError @@ -17727,32 +22142,59 @@ func ParseListTokensForAccountResponse(rsp *http.Response) (*ListTokensForAccoun } response.JSON500 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 502: + var dest BadGatewayError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON502 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: + var dest ServiceUnavailableError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON503 = &dest + } return response, nil } -// ParseGetSQLGrammarResponse parses an HTTP response from a GetSQLGrammarWithResponse call -func ParseGetSQLGrammarResponse(rsp *http.Response) (*GetSQLGrammarResponse, error) { +// ParseSendEvmAssetWithEndUserAccountResponse parses an HTTP response from a SendEvmAssetWithEndUserAccountWithResponse call +func ParseSendEvmAssetWithEndUserAccountResponse(rsp *http.Response) (*SendEvmAssetWithEndUserAccountResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetSQLGrammarResponse{ + response := &SendEvmAssetWithEndUserAccountResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest string + var dest struct { + // TransactionHash The hash of the transaction, as a 0x-prefixed hex string. Populated for EOA accounts. Null for Smart Accounts (use userOpHash instead). + TransactionHash *string `json:"transactionHash"` + + // UserOpHash The hash of the user operation, as a 0x-prefixed hex string. Populated for Smart Accounts. Null for EOA accounts (use transactionHash instead). + UserOpHash *string `json:"userOpHash"` + } if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest UnauthorizedError if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -17760,12 +22202,26 @@ func ParseGetSQLGrammarResponse(rsp *http.Response) (*GetSQLGrammarResponse, err } response.JSON401 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 402: + var dest PaymentMethodRequiredError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON402 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON429 = &dest + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: + var dest IdempotencyError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON422 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest InternalServerError @@ -17774,41 +22230,51 @@ func ParseGetSQLGrammarResponse(rsp *http.Response) (*GetSQLGrammarResponse, err } response.JSON500 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 504: - var dest TimedOutError + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 502: + var dest BadGatewayError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON502 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: + var dest ServiceUnavailableError if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON504 = &dest + response.JSON503 = &dest } return response, nil } -// ParseRunSQLQueryResponse parses an HTTP response from a RunSQLQueryWithResponse call -func ParseRunSQLQueryResponse(rsp *http.Response) (*RunSQLQueryResponse, error) { +// ParseSendSolanaTransactionWithEndUserAccountResponse parses an HTTP response from a SendSolanaTransactionWithEndUserAccountWithResponse call +func ParseSendSolanaTransactionWithEndUserAccountResponse(rsp *http.Response) (*SendSolanaTransactionWithEndUserAccountResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &RunSQLQueryResponse{ + response := &SendSolanaTransactionWithEndUserAccountResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest OnchainDataResult + var dest struct { + // TransactionSignature The base58 encoded transaction signature. + TransactionSignature string `json:"transactionSignature"` + } if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest InvalidSQLQueryError + var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -17821,26 +22287,33 @@ func ParseRunSQLQueryResponse(rsp *http.Response) (*RunSQLQueryResponse, error) } response.JSON401 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 408: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 402: + var dest PaymentMethodRequiredError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON402 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON408 = &dest + response.JSON403 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON429 = &dest + response.JSON404 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 499: - var dest ClientClosedRequestError + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: + var dest IdempotencyError if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON499 = &dest + response.JSON422 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest InternalServerError @@ -17849,34 +22322,44 @@ func ParseRunSQLQueryResponse(rsp *http.Response) (*RunSQLQueryResponse, error) } response.JSON500 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 504: - var dest TimedOutError + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 502: + var dest BadGatewayError if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON504 = &dest + response.JSON502 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: + var dest ServiceUnavailableError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON503 = &dest } return response, nil } -// ParseListWebhookSubscriptionsResponse parses an HTTP response from a ListWebhookSubscriptionsWithResponse call -func ParseListWebhookSubscriptionsResponse(rsp *http.Response) (*ListWebhookSubscriptionsResponse, error) { +// ParseSignSolanaHashWithEndUserAccountResponse parses an HTTP response from a SignSolanaHashWithEndUserAccountWithResponse call +func ParseSignSolanaHashWithEndUserAccountResponse(rsp *http.Response) (*SignSolanaHashWithEndUserAccountResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ListWebhookSubscriptionsResponse{ + response := &SignSolanaHashWithEndUserAccountResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest WebhookSubscriptionListResponse + var dest struct { + // Signature The signature of the hash, as a base58 encoded string. + Signature string `json:"signature"` + } if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -17896,12 +22379,33 @@ func ParseListWebhookSubscriptionsResponse(rsp *http.Response) (*ListWebhookSubs } response.JSON401 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 402: + var dest PaymentMethodRequiredError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON402 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON429 = &dest + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: + var dest AlreadyExistsError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON409 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: + var dest IdempotencyError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON422 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest InternalServerError @@ -17910,31 +22414,48 @@ func ParseListWebhookSubscriptionsResponse(rsp *http.Response) (*ListWebhookSubs } response.JSON500 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 502: + var dest BadGatewayError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON502 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: + var dest ServiceUnavailableError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON503 = &dest + } return response, nil } -// ParseCreateWebhookSubscriptionResponse parses an HTTP response from a CreateWebhookSubscriptionWithResponse call -func ParseCreateWebhookSubscriptionResponse(rsp *http.Response) (*CreateWebhookSubscriptionResponse, error) { +// ParseSignSolanaMessageWithEndUserAccountResponse parses an HTTP response from a SignSolanaMessageWithEndUserAccountWithResponse call +func ParseSignSolanaMessageWithEndUserAccountResponse(rsp *http.Response) (*SignSolanaMessageWithEndUserAccountResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &CreateWebhookSubscriptionResponse{ + response := &SignSolanaMessageWithEndUserAccountResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: - var dest WebhookSubscriptionResponse + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Signature The signature of the message, as a base58 encoded string. + Signature string `json:"signature"` + } if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON201 = &dest + response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest Error @@ -17950,93 +22471,91 @@ func ParseCreateWebhookSubscriptionResponse(rsp *http.Response) (*CreateWebhookS } response.JSON401 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: - var dest Error + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 402: + var dest PaymentMethodRequiredError if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON429 = &dest + response.JSON402 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: - var dest InternalServerError + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON500 = &dest - - } - - return response, nil -} - -// ParseDeleteWebhookSubscriptionResponse parses an HTTP response from a DeleteWebhookSubscriptionWithResponse call -func ParseDeleteWebhookSubscriptionResponse(rsp *http.Response) (*DeleteWebhookSubscriptionResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } + response.JSON404 = &dest - response := &DeleteWebhookSubscriptionResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: + var dest AlreadyExistsError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON409 = &dest - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: - var dest UnauthorizedError + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: + var dest IdempotencyError if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON401 = &dest + response.JSON422 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: - var dest Error + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest InternalServerError if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON404 = &dest + response.JSON500 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: - var dest Error + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 502: + var dest BadGatewayError if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON429 = &dest + response.JSON502 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: - var dest InternalServerError + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: + var dest ServiceUnavailableError if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON500 = &dest + response.JSON503 = &dest } return response, nil } -// ParseGetWebhookSubscriptionResponse parses an HTTP response from a GetWebhookSubscriptionWithResponse call -func ParseGetWebhookSubscriptionResponse(rsp *http.Response) (*GetWebhookSubscriptionResponse, error) { +// ParseSignSolanaTransactionWithEndUserAccountResponse parses an HTTP response from a SignSolanaTransactionWithEndUserAccountWithResponse call +func ParseSignSolanaTransactionWithEndUserAccountResponse(rsp *http.Response) (*SignSolanaTransactionWithEndUserAccountResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetWebhookSubscriptionResponse{ + response := &SignSolanaTransactionWithEndUserAccountResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest WebhookSubscriptionResponse + var dest struct { + // SignedTransaction The base64 encoded signed transaction. + SignedTransaction string `json:"signedTransaction"` + } if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest UnauthorizedError if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -18044,6 +22563,20 @@ func ParseGetWebhookSubscriptionResponse(rsp *http.Response) (*GetWebhookSubscri } response.JSON401 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 402: + var dest PaymentMethodRequiredError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON402 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -18051,12 +22584,19 @@ func ParseGetWebhookSubscriptionResponse(rsp *http.Response) (*GetWebhookSubscri } response.JSON404 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: - var dest Error + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: + var dest AlreadyExistsError if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON429 = &dest + response.JSON409 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: + var dest IdempotencyError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON422 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest InternalServerError @@ -18065,27 +22605,44 @@ func ParseGetWebhookSubscriptionResponse(rsp *http.Response) (*GetWebhookSubscri } response.JSON500 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 502: + var dest BadGatewayError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON502 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: + var dest ServiceUnavailableError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON503 = &dest + } return response, nil } -// ParseUpdateWebhookSubscriptionResponse parses an HTTP response from a UpdateWebhookSubscriptionWithResponse call -func ParseUpdateWebhookSubscriptionResponse(rsp *http.Response) (*UpdateWebhookSubscriptionResponse, error) { +// ParseSendSolanaAssetWithEndUserAccountResponse parses an HTTP response from a SendSolanaAssetWithEndUserAccountWithResponse call +func ParseSendSolanaAssetWithEndUserAccountResponse(rsp *http.Response) (*SendSolanaAssetWithEndUserAccountResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &UpdateWebhookSubscriptionResponse{ + response := &SendSolanaAssetWithEndUserAccountResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest WebhookSubscriptionResponse + var dest struct { + // TransactionSignature The base58 encoded transaction signature. + TransactionSignature string `json:"transactionSignature"` + } if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -18105,6 +22662,13 @@ func ParseUpdateWebhookSubscriptionResponse(rsp *http.Response) (*UpdateWebhookS } response.JSON401 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 402: + var dest PaymentMethodRequiredError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON402 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -18112,12 +22676,12 @@ func ParseUpdateWebhookSubscriptionResponse(rsp *http.Response) (*UpdateWebhookS } response.JSON404 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: - var dest Error + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: + var dest IdempotencyError if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON429 = &dest + response.JSON422 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest InternalServerError @@ -18126,6 +22690,20 @@ func ParseUpdateWebhookSubscriptionResponse(rsp *http.Response) (*UpdateWebhookS } response.JSON500 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 502: + var dest BadGatewayError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON502 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: + var dest ServiceUnavailableError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON503 = &dest + } return response, nil diff --git a/java/src/main/java/com/coinbase/cdp/openapi/api/EmbeddedWalletsCoreFunctionalityApi.java b/java/src/main/java/com/coinbase/cdp/openapi/api/EmbeddedWalletsCoreFunctionalityApi.java new file mode 100644 index 000000000..950506d96 --- /dev/null +++ b/java/src/main/java/com/coinbase/cdp/openapi/api/EmbeddedWalletsCoreFunctionalityApi.java @@ -0,0 +1,1862 @@ +/* + * Coinbase Developer Platform APIs + * The Coinbase Developer Platform APIs - leading the world's transition onchain. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: cdp@coinbase.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.coinbase.cdp.openapi.api; + +import com.coinbase.cdp.openapi.ApiClient; +import com.coinbase.cdp.openapi.ApiException; +import com.coinbase.cdp.openapi.ApiResponse; +import com.coinbase.cdp.openapi.Pair; + +import com.coinbase.cdp.openapi.model.CreateEvmEip7702DelegationWithEndUserAccount201Response; +import com.coinbase.cdp.openapi.model.CreateEvmEip7702DelegationWithEndUserAccountRequest; +import com.coinbase.cdp.openapi.model.Error; +import com.coinbase.cdp.openapi.model.EvmUserOperation; +import com.coinbase.cdp.openapi.model.RevokeDelegationForEndUserRequest; +import com.coinbase.cdp.openapi.model.RevokeSpendPermissionRequest; +import com.coinbase.cdp.openapi.model.SendEvmAssetWithEndUserAccount200Response; +import com.coinbase.cdp.openapi.model.SendEvmAssetWithEndUserAccountRequest; +import com.coinbase.cdp.openapi.model.SendEvmTransactionWithEndUserAccount200Response; +import com.coinbase.cdp.openapi.model.SendEvmTransactionWithEndUserAccountRequest; +import com.coinbase.cdp.openapi.model.SendSolanaAssetWithEndUserAccountRequest; +import com.coinbase.cdp.openapi.model.SendSolanaTransactionWithEndUserAccount200Response; +import com.coinbase.cdp.openapi.model.SendSolanaTransactionWithEndUserAccountRequest; +import com.coinbase.cdp.openapi.model.SendUserOperationWithEndUserAccountRequest; +import com.coinbase.cdp.openapi.model.SignEvmHashWithEndUserAccount200Response; +import com.coinbase.cdp.openapi.model.SignEvmHashWithEndUserAccountRequest; +import com.coinbase.cdp.openapi.model.SignEvmMessageWithEndUserAccount200Response; +import com.coinbase.cdp.openapi.model.SignEvmMessageWithEndUserAccountRequest; +import com.coinbase.cdp.openapi.model.SignEvmTransactionWithEndUserAccount200Response; +import com.coinbase.cdp.openapi.model.SignEvmTransactionWithEndUserAccountRequest; +import com.coinbase.cdp.openapi.model.SignEvmTypedDataWithEndUserAccount200Response; +import com.coinbase.cdp.openapi.model.SignEvmTypedDataWithEndUserAccountRequest; +import com.coinbase.cdp.openapi.model.SignSolanaHashWithEndUserAccount200Response; +import com.coinbase.cdp.openapi.model.SignSolanaHashWithEndUserAccountRequest; +import com.coinbase.cdp.openapi.model.SignSolanaMessageWithEndUserAccount200Response; +import com.coinbase.cdp.openapi.model.SignSolanaMessageWithEndUserAccountRequest; +import com.coinbase.cdp.openapi.model.SignSolanaTransactionWithEndUserAccount200Response; +import com.coinbase.cdp.openapi.model.SignSolanaTransactionWithEndUserAccountRequest; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +import java.io.InputStream; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.OutputStream; +import java.net.http.HttpRequest; +import java.nio.channels.Channels; +import java.nio.channels.Pipe; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; + +import java.util.ArrayList; +import java.util.StringJoiner; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.function.Consumer; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class EmbeddedWalletsCoreFunctionalityApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public EmbeddedWalletsCoreFunctionalityApi() { + this(new ApiClient()); + } + + public EmbeddedWalletsCoreFunctionalityApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Create EIP-7702 delegation for end user EVM account + * Creates an EIP-7702 delegation for an end user's EVM EOA account, upgrading it with smart account capabilities. This endpoint: - Retrieves delegation artifacts from onchain - Signs the EIP-7702 authorization for delegation - Assembles and submits a Type 4 transaction - Creates an associated smart account object The delegation allows the EVM EOA to be used as a smart account, which enables batched transactions and gas sponsorship via paymaster. + * @param projectId The ID of the CDP Project. (required) + * @param userId The ID of the end user. (required) + * @param createEvmEip7702DelegationWithEndUserAccountRequest (required) + * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) + * @param xDeveloperAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @return CreateEvmEip7702DelegationWithEndUserAccount201Response + * @throws ApiException if fails to make API call + */ + public CreateEvmEip7702DelegationWithEndUserAccount201Response createEvmEip7702DelegationWithEndUserAccount(String projectId, String userId, CreateEvmEip7702DelegationWithEndUserAccountRequest createEvmEip7702DelegationWithEndUserAccountRequest, String xWalletAuth, String xIdempotencyKey, String xDeveloperAuth) throws ApiException { + ApiResponse localVarResponse = createEvmEip7702DelegationWithEndUserAccountWithHttpInfo(projectId, userId, createEvmEip7702DelegationWithEndUserAccountRequest, xWalletAuth, xIdempotencyKey, xDeveloperAuth); + return localVarResponse.getData(); + } + + /** + * Create EIP-7702 delegation for end user EVM account + * Creates an EIP-7702 delegation for an end user's EVM EOA account, upgrading it with smart account capabilities. This endpoint: - Retrieves delegation artifacts from onchain - Signs the EIP-7702 authorization for delegation - Assembles and submits a Type 4 transaction - Creates an associated smart account object The delegation allows the EVM EOA to be used as a smart account, which enables batched transactions and gas sponsorship via paymaster. + * @param projectId The ID of the CDP Project. (required) + * @param userId The ID of the end user. (required) + * @param createEvmEip7702DelegationWithEndUserAccountRequest (required) + * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) + * @param xDeveloperAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @return ApiResponse<CreateEvmEip7702DelegationWithEndUserAccount201Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse createEvmEip7702DelegationWithEndUserAccountWithHttpInfo(String projectId, String userId, CreateEvmEip7702DelegationWithEndUserAccountRequest createEvmEip7702DelegationWithEndUserAccountRequest, String xWalletAuth, String xIdempotencyKey, String xDeveloperAuth) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = createEvmEip7702DelegationWithEndUserAccountRequestBuilder(projectId, userId, createEvmEip7702DelegationWithEndUserAccountRequest, xWalletAuth, xIdempotencyKey, xDeveloperAuth); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("createEvmEip7702DelegationWithEndUserAccount", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder createEvmEip7702DelegationWithEndUserAccountRequestBuilder(String projectId, String userId, CreateEvmEip7702DelegationWithEndUserAccountRequest createEvmEip7702DelegationWithEndUserAccountRequest, String xWalletAuth, String xIdempotencyKey, String xDeveloperAuth) throws ApiException { + // verify the required parameter 'projectId' is set + if (projectId == null) { + throw new ApiException(400, "Missing the required parameter 'projectId' when calling createEvmEip7702DelegationWithEndUserAccount"); + } + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling createEvmEip7702DelegationWithEndUserAccount"); + } + // verify the required parameter 'createEvmEip7702DelegationWithEndUserAccountRequest' is set + if (createEvmEip7702DelegationWithEndUserAccountRequest == null) { + throw new ApiException(400, "Missing the required parameter 'createEvmEip7702DelegationWithEndUserAccountRequest' when calling createEvmEip7702DelegationWithEndUserAccount"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v2/embedded-wallet-api/projects/{projectId}/end-users/{userId}/evm/eip7702/delegation" + .replace("{projectId}", ApiClient.urlEncode(projectId.toString())) + .replace("{userId}", ApiClient.urlEncode(userId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + if (xWalletAuth != null) { + localVarRequestBuilder.header("X-Wallet-Auth", xWalletAuth.toString()); + } + if (xIdempotencyKey != null) { + localVarRequestBuilder.header("X-Idempotency-Key", xIdempotencyKey.toString()); + } + if (xDeveloperAuth != null) { + localVarRequestBuilder.header("X-Developer-Auth", xDeveloperAuth.toString()); + } + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(createEvmEip7702DelegationWithEndUserAccountRequest); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Revoke delegation for end user + * Revokes all active delegations for the specified end user. This operation can be performed by the end user themselves or by a developer using their API key. + * @param projectId The ID of the CDP Project. (required) + * @param userId The ID of the end user. (required) + * @param revokeDelegationForEndUserRequest (required) + * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param xDeveloperAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) + * @throws ApiException if fails to make API call + */ + public void revokeDelegationForEndUser(String projectId, String userId, RevokeDelegationForEndUserRequest revokeDelegationForEndUserRequest, String xWalletAuth, String xDeveloperAuth, String xIdempotencyKey) throws ApiException { + revokeDelegationForEndUserWithHttpInfo(projectId, userId, revokeDelegationForEndUserRequest, xWalletAuth, xDeveloperAuth, xIdempotencyKey); + } + + /** + * Revoke delegation for end user + * Revokes all active delegations for the specified end user. This operation can be performed by the end user themselves or by a developer using their API key. + * @param projectId The ID of the CDP Project. (required) + * @param userId The ID of the end user. (required) + * @param revokeDelegationForEndUserRequest (required) + * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param xDeveloperAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse revokeDelegationForEndUserWithHttpInfo(String projectId, String userId, RevokeDelegationForEndUserRequest revokeDelegationForEndUserRequest, String xWalletAuth, String xDeveloperAuth, String xIdempotencyKey) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = revokeDelegationForEndUserRequestBuilder(projectId, userId, revokeDelegationForEndUserRequest, xWalletAuth, xDeveloperAuth, xIdempotencyKey); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("revokeDelegationForEndUser", localVarResponse); + } + return new ApiResponse<>( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder revokeDelegationForEndUserRequestBuilder(String projectId, String userId, RevokeDelegationForEndUserRequest revokeDelegationForEndUserRequest, String xWalletAuth, String xDeveloperAuth, String xIdempotencyKey) throws ApiException { + // verify the required parameter 'projectId' is set + if (projectId == null) { + throw new ApiException(400, "Missing the required parameter 'projectId' when calling revokeDelegationForEndUser"); + } + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling revokeDelegationForEndUser"); + } + // verify the required parameter 'revokeDelegationForEndUserRequest' is set + if (revokeDelegationForEndUserRequest == null) { + throw new ApiException(400, "Missing the required parameter 'revokeDelegationForEndUserRequest' when calling revokeDelegationForEndUser"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v2/embedded-wallet-api/projects/{projectId}/end-users/{userId}/delegation" + .replace("{projectId}", ApiClient.urlEncode(projectId.toString())) + .replace("{userId}", ApiClient.urlEncode(userId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + if (xWalletAuth != null) { + localVarRequestBuilder.header("X-Wallet-Auth", xWalletAuth.toString()); + } + if (xDeveloperAuth != null) { + localVarRequestBuilder.header("X-Developer-Auth", xDeveloperAuth.toString()); + } + if (xIdempotencyKey != null) { + localVarRequestBuilder.header("X-Idempotency-Key", xIdempotencyKey.toString()); + } + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(revokeDelegationForEndUserRequest); + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Revoke a spend permission + * Revokes an existing spend permission. + * @param projectId The ID of the CDP Project. (required) + * @param userId The ID of the end user. (required) + * @param address The address of the Smart account this spend permission is valid for. (required) + * @param revokeSpendPermissionRequest (required) + * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) + * @return EvmUserOperation + * @throws ApiException if fails to make API call + */ + public EvmUserOperation revokeSpendPermissionWithEndUserAccount(String projectId, String userId, String address, RevokeSpendPermissionRequest revokeSpendPermissionRequest, String xWalletAuth, String xIdempotencyKey) throws ApiException { + ApiResponse localVarResponse = revokeSpendPermissionWithEndUserAccountWithHttpInfo(projectId, userId, address, revokeSpendPermissionRequest, xWalletAuth, xIdempotencyKey); + return localVarResponse.getData(); + } + + /** + * Revoke a spend permission + * Revokes an existing spend permission. + * @param projectId The ID of the CDP Project. (required) + * @param userId The ID of the end user. (required) + * @param address The address of the Smart account this spend permission is valid for. (required) + * @param revokeSpendPermissionRequest (required) + * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) + * @return ApiResponse<EvmUserOperation> + * @throws ApiException if fails to make API call + */ + public ApiResponse revokeSpendPermissionWithEndUserAccountWithHttpInfo(String projectId, String userId, String address, RevokeSpendPermissionRequest revokeSpendPermissionRequest, String xWalletAuth, String xIdempotencyKey) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = revokeSpendPermissionWithEndUserAccountRequestBuilder(projectId, userId, address, revokeSpendPermissionRequest, xWalletAuth, xIdempotencyKey); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("revokeSpendPermissionWithEndUserAccount", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder revokeSpendPermissionWithEndUserAccountRequestBuilder(String projectId, String userId, String address, RevokeSpendPermissionRequest revokeSpendPermissionRequest, String xWalletAuth, String xIdempotencyKey) throws ApiException { + // verify the required parameter 'projectId' is set + if (projectId == null) { + throw new ApiException(400, "Missing the required parameter 'projectId' when calling revokeSpendPermissionWithEndUserAccount"); + } + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling revokeSpendPermissionWithEndUserAccount"); + } + // verify the required parameter 'address' is set + if (address == null) { + throw new ApiException(400, "Missing the required parameter 'address' when calling revokeSpendPermissionWithEndUserAccount"); + } + // verify the required parameter 'revokeSpendPermissionRequest' is set + if (revokeSpendPermissionRequest == null) { + throw new ApiException(400, "Missing the required parameter 'revokeSpendPermissionRequest' when calling revokeSpendPermissionWithEndUserAccount"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v2/embedded-wallet-api/projects/{projectId}/end-users/{userId}/evm/smart-accounts/{address}/spend-permissions/revoke" + .replace("{projectId}", ApiClient.urlEncode(projectId.toString())) + .replace("{userId}", ApiClient.urlEncode(userId.toString())) + .replace("{address}", ApiClient.urlEncode(address.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + if (xWalletAuth != null) { + localVarRequestBuilder.header("X-Wallet-Auth", xWalletAuth.toString()); + } + if (xIdempotencyKey != null) { + localVarRequestBuilder.header("X-Idempotency-Key", xIdempotencyKey.toString()); + } + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(revokeSpendPermissionRequest); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Send USDC on EVM + * Sends USDC from an end user's EVM account (EOA or Smart Account) to a recipient address on a supported EVM network. This endpoint simplifies USDC transfers by automatically handling contract resolution, decimal conversion, gas estimation, and transaction encoding. The `amount` field accepts human-readable amounts as decimal strings (e.g., \"1.5\", \"25.50\"). + * @param projectId The ID of the CDP Project. (required) + * @param userId The ID of the end user. (required) + * @param address The 0x-prefixed address of the EVM account (EOA or Smart Account) to send USDC from. The address does not need to be checksummed. (required) + * @param asset The asset to send. Currently only \"usdc\" is supported. (required) + * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) + * @param xDeveloperAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param sendEvmAssetWithEndUserAccountRequest (optional) + * @return SendEvmAssetWithEndUserAccount200Response + * @throws ApiException if fails to make API call + */ + public SendEvmAssetWithEndUserAccount200Response sendEvmAssetWithEndUserAccount(String projectId, String userId, String address, String asset, String xWalletAuth, String xIdempotencyKey, String xDeveloperAuth, SendEvmAssetWithEndUserAccountRequest sendEvmAssetWithEndUserAccountRequest) throws ApiException { + ApiResponse localVarResponse = sendEvmAssetWithEndUserAccountWithHttpInfo(projectId, userId, address, asset, xWalletAuth, xIdempotencyKey, xDeveloperAuth, sendEvmAssetWithEndUserAccountRequest); + return localVarResponse.getData(); + } + + /** + * Send USDC on EVM + * Sends USDC from an end user's EVM account (EOA or Smart Account) to a recipient address on a supported EVM network. This endpoint simplifies USDC transfers by automatically handling contract resolution, decimal conversion, gas estimation, and transaction encoding. The `amount` field accepts human-readable amounts as decimal strings (e.g., \"1.5\", \"25.50\"). + * @param projectId The ID of the CDP Project. (required) + * @param userId The ID of the end user. (required) + * @param address The 0x-prefixed address of the EVM account (EOA or Smart Account) to send USDC from. The address does not need to be checksummed. (required) + * @param asset The asset to send. Currently only \"usdc\" is supported. (required) + * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) + * @param xDeveloperAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param sendEvmAssetWithEndUserAccountRequest (optional) + * @return ApiResponse<SendEvmAssetWithEndUserAccount200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse sendEvmAssetWithEndUserAccountWithHttpInfo(String projectId, String userId, String address, String asset, String xWalletAuth, String xIdempotencyKey, String xDeveloperAuth, SendEvmAssetWithEndUserAccountRequest sendEvmAssetWithEndUserAccountRequest) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = sendEvmAssetWithEndUserAccountRequestBuilder(projectId, userId, address, asset, xWalletAuth, xIdempotencyKey, xDeveloperAuth, sendEvmAssetWithEndUserAccountRequest); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("sendEvmAssetWithEndUserAccount", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder sendEvmAssetWithEndUserAccountRequestBuilder(String projectId, String userId, String address, String asset, String xWalletAuth, String xIdempotencyKey, String xDeveloperAuth, SendEvmAssetWithEndUserAccountRequest sendEvmAssetWithEndUserAccountRequest) throws ApiException { + // verify the required parameter 'projectId' is set + if (projectId == null) { + throw new ApiException(400, "Missing the required parameter 'projectId' when calling sendEvmAssetWithEndUserAccount"); + } + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling sendEvmAssetWithEndUserAccount"); + } + // verify the required parameter 'address' is set + if (address == null) { + throw new ApiException(400, "Missing the required parameter 'address' when calling sendEvmAssetWithEndUserAccount"); + } + // verify the required parameter 'asset' is set + if (asset == null) { + throw new ApiException(400, "Missing the required parameter 'asset' when calling sendEvmAssetWithEndUserAccount"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v2/embedded-wallet-api/projects/{projectId}/end-users/{userId}/evm/{address}/send/{asset}" + .replace("{projectId}", ApiClient.urlEncode(projectId.toString())) + .replace("{userId}", ApiClient.urlEncode(userId.toString())) + .replace("{address}", ApiClient.urlEncode(address.toString())) + .replace("{asset}", ApiClient.urlEncode(asset.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + if (xWalletAuth != null) { + localVarRequestBuilder.header("X-Wallet-Auth", xWalletAuth.toString()); + } + if (xIdempotencyKey != null) { + localVarRequestBuilder.header("X-Idempotency-Key", xIdempotencyKey.toString()); + } + if (xDeveloperAuth != null) { + localVarRequestBuilder.header("X-Developer-Auth", xDeveloperAuth.toString()); + } + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(sendEvmAssetWithEndUserAccountRequest); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Send a transaction with end user EVM account + * Signs a transaction with the given end user EVM account and sends it to the indicated supported network. This API handles nonce management and gas estimation, leaving the developer to provide only the minimal set of fields necessary to send the transaction. The transaction should be serialized as a hex string using [RLP](https://ethereum.org/en/developers/docs/data-structures-and-encoding/rlp/). The transaction must be an [EIP-1559 dynamic fee transaction](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1559.md). **Transaction fields and API behavior** - `to` *(Required)*: The address of the contract or account to send the transaction to. - `chainId` *(Ignored)*: The value of the `chainId` field in the transaction is ignored. The transaction will be sent to the network indicated by the `network` field in the request body. - `nonce` *(Optional)*: The nonce to use for the transaction. If not provided, the API will assign a nonce to the transaction based on the current state of the account. - `maxPriorityFeePerGas` *(Optional)*: The maximum priority fee per gas to use for the transaction. If not provided, the API will estimate a value based on current network conditions. - `maxFeePerGas` *(Optional)*: The maximum fee per gas to use for the transaction. If not provided, the API will estimate a value based on current network conditions. - `gasLimit` *(Optional)*: The gas limit to use for the transaction. If not provided, the API will estimate a value based on the `to` and `data` fields of the transaction. - `value` *(Optional)*: The amount of ETH, in wei, to send with the transaction. - `data` *(Optional)*: The data to send with the transaction; only used for contract calls. - `accessList` *(Optional)*: The access list to use for the transaction. + * @param projectId The ID of the CDP Project. (required) + * @param userId The ID of the end user. (required) + * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) + * @param xDeveloperAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param sendEvmTransactionWithEndUserAccountRequest (optional) + * @return SendEvmTransactionWithEndUserAccount200Response + * @throws ApiException if fails to make API call + */ + public SendEvmTransactionWithEndUserAccount200Response sendEvmTransactionWithEndUserAccount(String projectId, String userId, String xWalletAuth, String xIdempotencyKey, String xDeveloperAuth, SendEvmTransactionWithEndUserAccountRequest sendEvmTransactionWithEndUserAccountRequest) throws ApiException { + ApiResponse localVarResponse = sendEvmTransactionWithEndUserAccountWithHttpInfo(projectId, userId, xWalletAuth, xIdempotencyKey, xDeveloperAuth, sendEvmTransactionWithEndUserAccountRequest); + return localVarResponse.getData(); + } + + /** + * Send a transaction with end user EVM account + * Signs a transaction with the given end user EVM account and sends it to the indicated supported network. This API handles nonce management and gas estimation, leaving the developer to provide only the minimal set of fields necessary to send the transaction. The transaction should be serialized as a hex string using [RLP](https://ethereum.org/en/developers/docs/data-structures-and-encoding/rlp/). The transaction must be an [EIP-1559 dynamic fee transaction](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1559.md). **Transaction fields and API behavior** - `to` *(Required)*: The address of the contract or account to send the transaction to. - `chainId` *(Ignored)*: The value of the `chainId` field in the transaction is ignored. The transaction will be sent to the network indicated by the `network` field in the request body. - `nonce` *(Optional)*: The nonce to use for the transaction. If not provided, the API will assign a nonce to the transaction based on the current state of the account. - `maxPriorityFeePerGas` *(Optional)*: The maximum priority fee per gas to use for the transaction. If not provided, the API will estimate a value based on current network conditions. - `maxFeePerGas` *(Optional)*: The maximum fee per gas to use for the transaction. If not provided, the API will estimate a value based on current network conditions. - `gasLimit` *(Optional)*: The gas limit to use for the transaction. If not provided, the API will estimate a value based on the `to` and `data` fields of the transaction. - `value` *(Optional)*: The amount of ETH, in wei, to send with the transaction. - `data` *(Optional)*: The data to send with the transaction; only used for contract calls. - `accessList` *(Optional)*: The access list to use for the transaction. + * @param projectId The ID of the CDP Project. (required) + * @param userId The ID of the end user. (required) + * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) + * @param xDeveloperAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param sendEvmTransactionWithEndUserAccountRequest (optional) + * @return ApiResponse<SendEvmTransactionWithEndUserAccount200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse sendEvmTransactionWithEndUserAccountWithHttpInfo(String projectId, String userId, String xWalletAuth, String xIdempotencyKey, String xDeveloperAuth, SendEvmTransactionWithEndUserAccountRequest sendEvmTransactionWithEndUserAccountRequest) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = sendEvmTransactionWithEndUserAccountRequestBuilder(projectId, userId, xWalletAuth, xIdempotencyKey, xDeveloperAuth, sendEvmTransactionWithEndUserAccountRequest); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("sendEvmTransactionWithEndUserAccount", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder sendEvmTransactionWithEndUserAccountRequestBuilder(String projectId, String userId, String xWalletAuth, String xIdempotencyKey, String xDeveloperAuth, SendEvmTransactionWithEndUserAccountRequest sendEvmTransactionWithEndUserAccountRequest) throws ApiException { + // verify the required parameter 'projectId' is set + if (projectId == null) { + throw new ApiException(400, "Missing the required parameter 'projectId' when calling sendEvmTransactionWithEndUserAccount"); + } + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling sendEvmTransactionWithEndUserAccount"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v2/embedded-wallet-api/projects/{projectId}/end-users/{userId}/evm/send/transaction" + .replace("{projectId}", ApiClient.urlEncode(projectId.toString())) + .replace("{userId}", ApiClient.urlEncode(userId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + if (xWalletAuth != null) { + localVarRequestBuilder.header("X-Wallet-Auth", xWalletAuth.toString()); + } + if (xIdempotencyKey != null) { + localVarRequestBuilder.header("X-Idempotency-Key", xIdempotencyKey.toString()); + } + if (xDeveloperAuth != null) { + localVarRequestBuilder.header("X-Developer-Auth", xDeveloperAuth.toString()); + } + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(sendEvmTransactionWithEndUserAccountRequest); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Send USDC on Solana + * Sends USDC from an end user's Solana account to a recipient address on the Solana network. This endpoint simplifies USDC transfers by automatically handling mint resolution, Associated Token Account (ATA) creation, decimal conversion, and transaction encoding. The `amount` field accepts human-readable amounts as decimal strings (e.g., \"1.5\", \"25.50\"). Use the optional `createRecipientAta` parameter to control whether the sender pays for creating the recipient's Associated Token Account if it doesn't exist. + * @param projectId The ID of the CDP Project. (required) + * @param userId The ID of the end user. (required) + * @param address The base58 encoded address of the Solana account to send USDC from. (required) + * @param asset The asset to send. Currently only \"usdc\" is supported. (required) + * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) + * @param xDeveloperAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param sendSolanaAssetWithEndUserAccountRequest (optional) + * @return SendSolanaTransactionWithEndUserAccount200Response + * @throws ApiException if fails to make API call + */ + public SendSolanaTransactionWithEndUserAccount200Response sendSolanaAssetWithEndUserAccount(String projectId, String userId, String address, String asset, String xWalletAuth, String xIdempotencyKey, String xDeveloperAuth, SendSolanaAssetWithEndUserAccountRequest sendSolanaAssetWithEndUserAccountRequest) throws ApiException { + ApiResponse localVarResponse = sendSolanaAssetWithEndUserAccountWithHttpInfo(projectId, userId, address, asset, xWalletAuth, xIdempotencyKey, xDeveloperAuth, sendSolanaAssetWithEndUserAccountRequest); + return localVarResponse.getData(); + } + + /** + * Send USDC on Solana + * Sends USDC from an end user's Solana account to a recipient address on the Solana network. This endpoint simplifies USDC transfers by automatically handling mint resolution, Associated Token Account (ATA) creation, decimal conversion, and transaction encoding. The `amount` field accepts human-readable amounts as decimal strings (e.g., \"1.5\", \"25.50\"). Use the optional `createRecipientAta` parameter to control whether the sender pays for creating the recipient's Associated Token Account if it doesn't exist. + * @param projectId The ID of the CDP Project. (required) + * @param userId The ID of the end user. (required) + * @param address The base58 encoded address of the Solana account to send USDC from. (required) + * @param asset The asset to send. Currently only \"usdc\" is supported. (required) + * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) + * @param xDeveloperAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param sendSolanaAssetWithEndUserAccountRequest (optional) + * @return ApiResponse<SendSolanaTransactionWithEndUserAccount200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse sendSolanaAssetWithEndUserAccountWithHttpInfo(String projectId, String userId, String address, String asset, String xWalletAuth, String xIdempotencyKey, String xDeveloperAuth, SendSolanaAssetWithEndUserAccountRequest sendSolanaAssetWithEndUserAccountRequest) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = sendSolanaAssetWithEndUserAccountRequestBuilder(projectId, userId, address, asset, xWalletAuth, xIdempotencyKey, xDeveloperAuth, sendSolanaAssetWithEndUserAccountRequest); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("sendSolanaAssetWithEndUserAccount", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder sendSolanaAssetWithEndUserAccountRequestBuilder(String projectId, String userId, String address, String asset, String xWalletAuth, String xIdempotencyKey, String xDeveloperAuth, SendSolanaAssetWithEndUserAccountRequest sendSolanaAssetWithEndUserAccountRequest) throws ApiException { + // verify the required parameter 'projectId' is set + if (projectId == null) { + throw new ApiException(400, "Missing the required parameter 'projectId' when calling sendSolanaAssetWithEndUserAccount"); + } + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling sendSolanaAssetWithEndUserAccount"); + } + // verify the required parameter 'address' is set + if (address == null) { + throw new ApiException(400, "Missing the required parameter 'address' when calling sendSolanaAssetWithEndUserAccount"); + } + // verify the required parameter 'asset' is set + if (asset == null) { + throw new ApiException(400, "Missing the required parameter 'asset' when calling sendSolanaAssetWithEndUserAccount"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v2/embedded-wallet-api/projects/{projectId}/end-users/{userId}/solana/{address}/send/{asset}" + .replace("{projectId}", ApiClient.urlEncode(projectId.toString())) + .replace("{userId}", ApiClient.urlEncode(userId.toString())) + .replace("{address}", ApiClient.urlEncode(address.toString())) + .replace("{asset}", ApiClient.urlEncode(asset.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + if (xWalletAuth != null) { + localVarRequestBuilder.header("X-Wallet-Auth", xWalletAuth.toString()); + } + if (xIdempotencyKey != null) { + localVarRequestBuilder.header("X-Idempotency-Key", xIdempotencyKey.toString()); + } + if (xDeveloperAuth != null) { + localVarRequestBuilder.header("X-Developer-Auth", xDeveloperAuth.toString()); + } + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(sendSolanaAssetWithEndUserAccountRequest); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Send a transaction with end user Solana account + * Signs a transaction with the given end user Solana account and sends it to the indicated supported network. The API handles recent blockhash management and fee estimation, leaving the developer to provide only the minimal set of fields necessary to send the transaction. The unsigned transaction should be serialized into a byte array and then encoded as base64. **Transaction types** The following transaction types are supported: * [Legacy transactions](https://solana.com/developers/guides/advanced/versions#current-transaction-versions) * [Versioned transactions](https://solana.com/developers/guides/advanced/versions) **Instruction Batching** To batch multiple operations, include multiple instructions within a single transaction. All instructions within a transaction are executed atomically - if any instruction fails, the entire transaction fails and is rolled back. **Network Support** The following Solana networks are supported: * `solana` - Solana Mainnet * `solana-devnet` - Solana Devnet The developer is responsible for ensuring that the unsigned transaction is valid, as the API will not validate the transaction. + * @param projectId The ID of the CDP Project. (required) + * @param userId The ID of the end user. (required) + * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) + * @param xDeveloperAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param sendSolanaTransactionWithEndUserAccountRequest (optional) + * @return SendSolanaTransactionWithEndUserAccount200Response + * @throws ApiException if fails to make API call + */ + public SendSolanaTransactionWithEndUserAccount200Response sendSolanaTransactionWithEndUserAccount(String projectId, String userId, String xWalletAuth, String xIdempotencyKey, String xDeveloperAuth, SendSolanaTransactionWithEndUserAccountRequest sendSolanaTransactionWithEndUserAccountRequest) throws ApiException { + ApiResponse localVarResponse = sendSolanaTransactionWithEndUserAccountWithHttpInfo(projectId, userId, xWalletAuth, xIdempotencyKey, xDeveloperAuth, sendSolanaTransactionWithEndUserAccountRequest); + return localVarResponse.getData(); + } + + /** + * Send a transaction with end user Solana account + * Signs a transaction with the given end user Solana account and sends it to the indicated supported network. The API handles recent blockhash management and fee estimation, leaving the developer to provide only the minimal set of fields necessary to send the transaction. The unsigned transaction should be serialized into a byte array and then encoded as base64. **Transaction types** The following transaction types are supported: * [Legacy transactions](https://solana.com/developers/guides/advanced/versions#current-transaction-versions) * [Versioned transactions](https://solana.com/developers/guides/advanced/versions) **Instruction Batching** To batch multiple operations, include multiple instructions within a single transaction. All instructions within a transaction are executed atomically - if any instruction fails, the entire transaction fails and is rolled back. **Network Support** The following Solana networks are supported: * `solana` - Solana Mainnet * `solana-devnet` - Solana Devnet The developer is responsible for ensuring that the unsigned transaction is valid, as the API will not validate the transaction. + * @param projectId The ID of the CDP Project. (required) + * @param userId The ID of the end user. (required) + * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) + * @param xDeveloperAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param sendSolanaTransactionWithEndUserAccountRequest (optional) + * @return ApiResponse<SendSolanaTransactionWithEndUserAccount200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse sendSolanaTransactionWithEndUserAccountWithHttpInfo(String projectId, String userId, String xWalletAuth, String xIdempotencyKey, String xDeveloperAuth, SendSolanaTransactionWithEndUserAccountRequest sendSolanaTransactionWithEndUserAccountRequest) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = sendSolanaTransactionWithEndUserAccountRequestBuilder(projectId, userId, xWalletAuth, xIdempotencyKey, xDeveloperAuth, sendSolanaTransactionWithEndUserAccountRequest); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("sendSolanaTransactionWithEndUserAccount", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder sendSolanaTransactionWithEndUserAccountRequestBuilder(String projectId, String userId, String xWalletAuth, String xIdempotencyKey, String xDeveloperAuth, SendSolanaTransactionWithEndUserAccountRequest sendSolanaTransactionWithEndUserAccountRequest) throws ApiException { + // verify the required parameter 'projectId' is set + if (projectId == null) { + throw new ApiException(400, "Missing the required parameter 'projectId' when calling sendSolanaTransactionWithEndUserAccount"); + } + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling sendSolanaTransactionWithEndUserAccount"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v2/embedded-wallet-api/projects/{projectId}/end-users/{userId}/solana/send/transaction" + .replace("{projectId}", ApiClient.urlEncode(projectId.toString())) + .replace("{userId}", ApiClient.urlEncode(userId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + if (xWalletAuth != null) { + localVarRequestBuilder.header("X-Wallet-Auth", xWalletAuth.toString()); + } + if (xIdempotencyKey != null) { + localVarRequestBuilder.header("X-Idempotency-Key", xIdempotencyKey.toString()); + } + if (xDeveloperAuth != null) { + localVarRequestBuilder.header("X-Developer-Auth", xDeveloperAuth.toString()); + } + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(sendSolanaTransactionWithEndUserAccountRequest); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Send a user operation for end user Smart Account + * Prepares, signs, and sends a user operation for an end user's Smart Account. + * @param projectId The ID of the CDP Project. (required) + * @param userId The ID of the end user. (required) + * @param address The address of the EVM Smart Account to execute the user operation from. (required) + * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) + * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param xDeveloperAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param sendUserOperationWithEndUserAccountRequest (optional) + * @return EvmUserOperation + * @throws ApiException if fails to make API call + */ + public EvmUserOperation sendUserOperationWithEndUserAccount(String projectId, String userId, String address, String xIdempotencyKey, String xWalletAuth, String xDeveloperAuth, SendUserOperationWithEndUserAccountRequest sendUserOperationWithEndUserAccountRequest) throws ApiException { + ApiResponse localVarResponse = sendUserOperationWithEndUserAccountWithHttpInfo(projectId, userId, address, xIdempotencyKey, xWalletAuth, xDeveloperAuth, sendUserOperationWithEndUserAccountRequest); + return localVarResponse.getData(); + } + + /** + * Send a user operation for end user Smart Account + * Prepares, signs, and sends a user operation for an end user's Smart Account. + * @param projectId The ID of the CDP Project. (required) + * @param userId The ID of the end user. (required) + * @param address The address of the EVM Smart Account to execute the user operation from. (required) + * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) + * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param xDeveloperAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param sendUserOperationWithEndUserAccountRequest (optional) + * @return ApiResponse<EvmUserOperation> + * @throws ApiException if fails to make API call + */ + public ApiResponse sendUserOperationWithEndUserAccountWithHttpInfo(String projectId, String userId, String address, String xIdempotencyKey, String xWalletAuth, String xDeveloperAuth, SendUserOperationWithEndUserAccountRequest sendUserOperationWithEndUserAccountRequest) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = sendUserOperationWithEndUserAccountRequestBuilder(projectId, userId, address, xIdempotencyKey, xWalletAuth, xDeveloperAuth, sendUserOperationWithEndUserAccountRequest); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("sendUserOperationWithEndUserAccount", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder sendUserOperationWithEndUserAccountRequestBuilder(String projectId, String userId, String address, String xIdempotencyKey, String xWalletAuth, String xDeveloperAuth, SendUserOperationWithEndUserAccountRequest sendUserOperationWithEndUserAccountRequest) throws ApiException { + // verify the required parameter 'projectId' is set + if (projectId == null) { + throw new ApiException(400, "Missing the required parameter 'projectId' when calling sendUserOperationWithEndUserAccount"); + } + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling sendUserOperationWithEndUserAccount"); + } + // verify the required parameter 'address' is set + if (address == null) { + throw new ApiException(400, "Missing the required parameter 'address' when calling sendUserOperationWithEndUserAccount"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v2/embedded-wallet-api/projects/{projectId}/end-users/{userId}/evm/smart-accounts/{address}/send" + .replace("{projectId}", ApiClient.urlEncode(projectId.toString())) + .replace("{userId}", ApiClient.urlEncode(userId.toString())) + .replace("{address}", ApiClient.urlEncode(address.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + if (xIdempotencyKey != null) { + localVarRequestBuilder.header("X-Idempotency-Key", xIdempotencyKey.toString()); + } + if (xWalletAuth != null) { + localVarRequestBuilder.header("X-Wallet-Auth", xWalletAuth.toString()); + } + if (xDeveloperAuth != null) { + localVarRequestBuilder.header("X-Developer-Auth", xDeveloperAuth.toString()); + } + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(sendUserOperationWithEndUserAccountRequest); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Sign a hash with end user EVM account + * Signs an arbitrary 32 byte hash with the end user's given EVM account. + * @param projectId The ID of the CDP Project. (required) + * @param userId The ID of the end user. (required) + * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) + * @param xDeveloperAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param signEvmHashWithEndUserAccountRequest (optional) + * @return SignEvmHashWithEndUserAccount200Response + * @throws ApiException if fails to make API call + */ + public SignEvmHashWithEndUserAccount200Response signEvmHashWithEndUserAccount(String projectId, String userId, String xWalletAuth, String xIdempotencyKey, String xDeveloperAuth, SignEvmHashWithEndUserAccountRequest signEvmHashWithEndUserAccountRequest) throws ApiException { + ApiResponse localVarResponse = signEvmHashWithEndUserAccountWithHttpInfo(projectId, userId, xWalletAuth, xIdempotencyKey, xDeveloperAuth, signEvmHashWithEndUserAccountRequest); + return localVarResponse.getData(); + } + + /** + * Sign a hash with end user EVM account + * Signs an arbitrary 32 byte hash with the end user's given EVM account. + * @param projectId The ID of the CDP Project. (required) + * @param userId The ID of the end user. (required) + * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) + * @param xDeveloperAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param signEvmHashWithEndUserAccountRequest (optional) + * @return ApiResponse<SignEvmHashWithEndUserAccount200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse signEvmHashWithEndUserAccountWithHttpInfo(String projectId, String userId, String xWalletAuth, String xIdempotencyKey, String xDeveloperAuth, SignEvmHashWithEndUserAccountRequest signEvmHashWithEndUserAccountRequest) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = signEvmHashWithEndUserAccountRequestBuilder(projectId, userId, xWalletAuth, xIdempotencyKey, xDeveloperAuth, signEvmHashWithEndUserAccountRequest); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("signEvmHashWithEndUserAccount", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder signEvmHashWithEndUserAccountRequestBuilder(String projectId, String userId, String xWalletAuth, String xIdempotencyKey, String xDeveloperAuth, SignEvmHashWithEndUserAccountRequest signEvmHashWithEndUserAccountRequest) throws ApiException { + // verify the required parameter 'projectId' is set + if (projectId == null) { + throw new ApiException(400, "Missing the required parameter 'projectId' when calling signEvmHashWithEndUserAccount"); + } + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling signEvmHashWithEndUserAccount"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v2/embedded-wallet-api/projects/{projectId}/end-users/{userId}/evm/sign" + .replace("{projectId}", ApiClient.urlEncode(projectId.toString())) + .replace("{userId}", ApiClient.urlEncode(userId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + if (xWalletAuth != null) { + localVarRequestBuilder.header("X-Wallet-Auth", xWalletAuth.toString()); + } + if (xIdempotencyKey != null) { + localVarRequestBuilder.header("X-Idempotency-Key", xIdempotencyKey.toString()); + } + if (xDeveloperAuth != null) { + localVarRequestBuilder.header("X-Developer-Auth", xDeveloperAuth.toString()); + } + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(signEvmHashWithEndUserAccountRequest); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Sign an EIP-191 message with end user EVM account + * Signs an [EIP-191](https://eips.ethereum.org/EIPS/eip-191) message with the given end user EVM account. Per the specification, the message in the request body is prepended with `0x19 <0x45 (E)> <thereum Signed Message:\\n\" + len(message)>` before being signed. + * @param projectId The ID of the CDP Project. (required) + * @param userId The ID of the end user. (required) + * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) + * @param xDeveloperAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param signEvmMessageWithEndUserAccountRequest (optional) + * @return SignEvmMessageWithEndUserAccount200Response + * @throws ApiException if fails to make API call + */ + public SignEvmMessageWithEndUserAccount200Response signEvmMessageWithEndUserAccount(String projectId, String userId, String xWalletAuth, String xIdempotencyKey, String xDeveloperAuth, SignEvmMessageWithEndUserAccountRequest signEvmMessageWithEndUserAccountRequest) throws ApiException { + ApiResponse localVarResponse = signEvmMessageWithEndUserAccountWithHttpInfo(projectId, userId, xWalletAuth, xIdempotencyKey, xDeveloperAuth, signEvmMessageWithEndUserAccountRequest); + return localVarResponse.getData(); + } + + /** + * Sign an EIP-191 message with end user EVM account + * Signs an [EIP-191](https://eips.ethereum.org/EIPS/eip-191) message with the given end user EVM account. Per the specification, the message in the request body is prepended with `0x19 <0x45 (E)> <thereum Signed Message:\\n\" + len(message)>` before being signed. + * @param projectId The ID of the CDP Project. (required) + * @param userId The ID of the end user. (required) + * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) + * @param xDeveloperAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param signEvmMessageWithEndUserAccountRequest (optional) + * @return ApiResponse<SignEvmMessageWithEndUserAccount200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse signEvmMessageWithEndUserAccountWithHttpInfo(String projectId, String userId, String xWalletAuth, String xIdempotencyKey, String xDeveloperAuth, SignEvmMessageWithEndUserAccountRequest signEvmMessageWithEndUserAccountRequest) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = signEvmMessageWithEndUserAccountRequestBuilder(projectId, userId, xWalletAuth, xIdempotencyKey, xDeveloperAuth, signEvmMessageWithEndUserAccountRequest); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("signEvmMessageWithEndUserAccount", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder signEvmMessageWithEndUserAccountRequestBuilder(String projectId, String userId, String xWalletAuth, String xIdempotencyKey, String xDeveloperAuth, SignEvmMessageWithEndUserAccountRequest signEvmMessageWithEndUserAccountRequest) throws ApiException { + // verify the required parameter 'projectId' is set + if (projectId == null) { + throw new ApiException(400, "Missing the required parameter 'projectId' when calling signEvmMessageWithEndUserAccount"); + } + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling signEvmMessageWithEndUserAccount"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v2/embedded-wallet-api/projects/{projectId}/end-users/{userId}/evm/sign/message" + .replace("{projectId}", ApiClient.urlEncode(projectId.toString())) + .replace("{userId}", ApiClient.urlEncode(userId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + if (xWalletAuth != null) { + localVarRequestBuilder.header("X-Wallet-Auth", xWalletAuth.toString()); + } + if (xIdempotencyKey != null) { + localVarRequestBuilder.header("X-Idempotency-Key", xIdempotencyKey.toString()); + } + if (xDeveloperAuth != null) { + localVarRequestBuilder.header("X-Developer-Auth", xDeveloperAuth.toString()); + } + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(signEvmMessageWithEndUserAccountRequest); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Sign a transaction with end user EVM account + * Signs a transaction with the given end user EVM account. The transaction should be serialized as a hex string using [RLP](https://ethereum.org/en/developers/docs/data-structures-and-encoding/rlp/). The transaction must be an [EIP-1559 dynamic fee transaction](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1559.md). The developer is responsible for ensuring that the unsigned transaction is valid, as the API will not validate the transaction. + * @param projectId The ID of the CDP Project. (required) + * @param userId The ID of the end user. (required) + * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) + * @param xDeveloperAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param signEvmTransactionWithEndUserAccountRequest (optional) + * @return SignEvmTransactionWithEndUserAccount200Response + * @throws ApiException if fails to make API call + */ + public SignEvmTransactionWithEndUserAccount200Response signEvmTransactionWithEndUserAccount(String projectId, String userId, String xWalletAuth, String xIdempotencyKey, String xDeveloperAuth, SignEvmTransactionWithEndUserAccountRequest signEvmTransactionWithEndUserAccountRequest) throws ApiException { + ApiResponse localVarResponse = signEvmTransactionWithEndUserAccountWithHttpInfo(projectId, userId, xWalletAuth, xIdempotencyKey, xDeveloperAuth, signEvmTransactionWithEndUserAccountRequest); + return localVarResponse.getData(); + } + + /** + * Sign a transaction with end user EVM account + * Signs a transaction with the given end user EVM account. The transaction should be serialized as a hex string using [RLP](https://ethereum.org/en/developers/docs/data-structures-and-encoding/rlp/). The transaction must be an [EIP-1559 dynamic fee transaction](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1559.md). The developer is responsible for ensuring that the unsigned transaction is valid, as the API will not validate the transaction. + * @param projectId The ID of the CDP Project. (required) + * @param userId The ID of the end user. (required) + * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) + * @param xDeveloperAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param signEvmTransactionWithEndUserAccountRequest (optional) + * @return ApiResponse<SignEvmTransactionWithEndUserAccount200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse signEvmTransactionWithEndUserAccountWithHttpInfo(String projectId, String userId, String xWalletAuth, String xIdempotencyKey, String xDeveloperAuth, SignEvmTransactionWithEndUserAccountRequest signEvmTransactionWithEndUserAccountRequest) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = signEvmTransactionWithEndUserAccountRequestBuilder(projectId, userId, xWalletAuth, xIdempotencyKey, xDeveloperAuth, signEvmTransactionWithEndUserAccountRequest); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("signEvmTransactionWithEndUserAccount", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder signEvmTransactionWithEndUserAccountRequestBuilder(String projectId, String userId, String xWalletAuth, String xIdempotencyKey, String xDeveloperAuth, SignEvmTransactionWithEndUserAccountRequest signEvmTransactionWithEndUserAccountRequest) throws ApiException { + // verify the required parameter 'projectId' is set + if (projectId == null) { + throw new ApiException(400, "Missing the required parameter 'projectId' when calling signEvmTransactionWithEndUserAccount"); + } + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling signEvmTransactionWithEndUserAccount"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v2/embedded-wallet-api/projects/{projectId}/end-users/{userId}/evm/sign/transaction" + .replace("{projectId}", ApiClient.urlEncode(projectId.toString())) + .replace("{userId}", ApiClient.urlEncode(userId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + if (xWalletAuth != null) { + localVarRequestBuilder.header("X-Wallet-Auth", xWalletAuth.toString()); + } + if (xIdempotencyKey != null) { + localVarRequestBuilder.header("X-Idempotency-Key", xIdempotencyKey.toString()); + } + if (xDeveloperAuth != null) { + localVarRequestBuilder.header("X-Developer-Auth", xDeveloperAuth.toString()); + } + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(signEvmTransactionWithEndUserAccountRequest); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Sign EIP-712 typed data with end user EVM account + * Signs [EIP-712](https://eips.ethereum.org/EIPS/eip-712) typed data with the given end user EVM account. + * @param projectId The ID of the CDP Project. (required) + * @param userId The ID of the end user. (required) + * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) + * @param xDeveloperAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param signEvmTypedDataWithEndUserAccountRequest (optional) + * @return SignEvmTypedDataWithEndUserAccount200Response + * @throws ApiException if fails to make API call + */ + public SignEvmTypedDataWithEndUserAccount200Response signEvmTypedDataWithEndUserAccount(String projectId, String userId, String xWalletAuth, String xIdempotencyKey, String xDeveloperAuth, SignEvmTypedDataWithEndUserAccountRequest signEvmTypedDataWithEndUserAccountRequest) throws ApiException { + ApiResponse localVarResponse = signEvmTypedDataWithEndUserAccountWithHttpInfo(projectId, userId, xWalletAuth, xIdempotencyKey, xDeveloperAuth, signEvmTypedDataWithEndUserAccountRequest); + return localVarResponse.getData(); + } + + /** + * Sign EIP-712 typed data with end user EVM account + * Signs [EIP-712](https://eips.ethereum.org/EIPS/eip-712) typed data with the given end user EVM account. + * @param projectId The ID of the CDP Project. (required) + * @param userId The ID of the end user. (required) + * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) + * @param xDeveloperAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param signEvmTypedDataWithEndUserAccountRequest (optional) + * @return ApiResponse<SignEvmTypedDataWithEndUserAccount200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse signEvmTypedDataWithEndUserAccountWithHttpInfo(String projectId, String userId, String xWalletAuth, String xIdempotencyKey, String xDeveloperAuth, SignEvmTypedDataWithEndUserAccountRequest signEvmTypedDataWithEndUserAccountRequest) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = signEvmTypedDataWithEndUserAccountRequestBuilder(projectId, userId, xWalletAuth, xIdempotencyKey, xDeveloperAuth, signEvmTypedDataWithEndUserAccountRequest); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("signEvmTypedDataWithEndUserAccount", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder signEvmTypedDataWithEndUserAccountRequestBuilder(String projectId, String userId, String xWalletAuth, String xIdempotencyKey, String xDeveloperAuth, SignEvmTypedDataWithEndUserAccountRequest signEvmTypedDataWithEndUserAccountRequest) throws ApiException { + // verify the required parameter 'projectId' is set + if (projectId == null) { + throw new ApiException(400, "Missing the required parameter 'projectId' when calling signEvmTypedDataWithEndUserAccount"); + } + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling signEvmTypedDataWithEndUserAccount"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v2/embedded-wallet-api/projects/{projectId}/end-users/{userId}/evm/sign/typed-data" + .replace("{projectId}", ApiClient.urlEncode(projectId.toString())) + .replace("{userId}", ApiClient.urlEncode(userId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + if (xWalletAuth != null) { + localVarRequestBuilder.header("X-Wallet-Auth", xWalletAuth.toString()); + } + if (xIdempotencyKey != null) { + localVarRequestBuilder.header("X-Idempotency-Key", xIdempotencyKey.toString()); + } + if (xDeveloperAuth != null) { + localVarRequestBuilder.header("X-Developer-Auth", xDeveloperAuth.toString()); + } + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(signEvmTypedDataWithEndUserAccountRequest); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Sign a hash with end user Solana account + * Signs an arbitrary 32 byte hash with the end user's given Solana account. + * @param projectId The ID of the CDP Project. (required) + * @param userId The ID of the end user. (required) + * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) + * @param xDeveloperAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param signSolanaHashWithEndUserAccountRequest (optional) + * @return SignSolanaHashWithEndUserAccount200Response + * @throws ApiException if fails to make API call + */ + public SignSolanaHashWithEndUserAccount200Response signSolanaHashWithEndUserAccount(String projectId, String userId, String xWalletAuth, String xIdempotencyKey, String xDeveloperAuth, SignSolanaHashWithEndUserAccountRequest signSolanaHashWithEndUserAccountRequest) throws ApiException { + ApiResponse localVarResponse = signSolanaHashWithEndUserAccountWithHttpInfo(projectId, userId, xWalletAuth, xIdempotencyKey, xDeveloperAuth, signSolanaHashWithEndUserAccountRequest); + return localVarResponse.getData(); + } + + /** + * Sign a hash with end user Solana account + * Signs an arbitrary 32 byte hash with the end user's given Solana account. + * @param projectId The ID of the CDP Project. (required) + * @param userId The ID of the end user. (required) + * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) + * @param xDeveloperAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param signSolanaHashWithEndUserAccountRequest (optional) + * @return ApiResponse<SignSolanaHashWithEndUserAccount200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse signSolanaHashWithEndUserAccountWithHttpInfo(String projectId, String userId, String xWalletAuth, String xIdempotencyKey, String xDeveloperAuth, SignSolanaHashWithEndUserAccountRequest signSolanaHashWithEndUserAccountRequest) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = signSolanaHashWithEndUserAccountRequestBuilder(projectId, userId, xWalletAuth, xIdempotencyKey, xDeveloperAuth, signSolanaHashWithEndUserAccountRequest); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("signSolanaHashWithEndUserAccount", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder signSolanaHashWithEndUserAccountRequestBuilder(String projectId, String userId, String xWalletAuth, String xIdempotencyKey, String xDeveloperAuth, SignSolanaHashWithEndUserAccountRequest signSolanaHashWithEndUserAccountRequest) throws ApiException { + // verify the required parameter 'projectId' is set + if (projectId == null) { + throw new ApiException(400, "Missing the required parameter 'projectId' when calling signSolanaHashWithEndUserAccount"); + } + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling signSolanaHashWithEndUserAccount"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v2/embedded-wallet-api/projects/{projectId}/end-users/{userId}/solana/sign" + .replace("{projectId}", ApiClient.urlEncode(projectId.toString())) + .replace("{userId}", ApiClient.urlEncode(userId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + if (xWalletAuth != null) { + localVarRequestBuilder.header("X-Wallet-Auth", xWalletAuth.toString()); + } + if (xIdempotencyKey != null) { + localVarRequestBuilder.header("X-Idempotency-Key", xIdempotencyKey.toString()); + } + if (xDeveloperAuth != null) { + localVarRequestBuilder.header("X-Developer-Auth", xDeveloperAuth.toString()); + } + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(signSolanaHashWithEndUserAccountRequest); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Sign a Base64 encoded message + * Signs an arbitrary Base64 encoded message with the given Solana account. **WARNING:** Never sign a message that you didn't generate as it may put your funds at risk. + * @param projectId The ID of the CDP Project. (required) + * @param userId The ID of the end user. (required) + * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) + * @param xDeveloperAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param signSolanaMessageWithEndUserAccountRequest (optional) + * @return SignSolanaMessageWithEndUserAccount200Response + * @throws ApiException if fails to make API call + */ + public SignSolanaMessageWithEndUserAccount200Response signSolanaMessageWithEndUserAccount(String projectId, String userId, String xWalletAuth, String xIdempotencyKey, String xDeveloperAuth, SignSolanaMessageWithEndUserAccountRequest signSolanaMessageWithEndUserAccountRequest) throws ApiException { + ApiResponse localVarResponse = signSolanaMessageWithEndUserAccountWithHttpInfo(projectId, userId, xWalletAuth, xIdempotencyKey, xDeveloperAuth, signSolanaMessageWithEndUserAccountRequest); + return localVarResponse.getData(); + } + + /** + * Sign a Base64 encoded message + * Signs an arbitrary Base64 encoded message with the given Solana account. **WARNING:** Never sign a message that you didn't generate as it may put your funds at risk. + * @param projectId The ID of the CDP Project. (required) + * @param userId The ID of the end user. (required) + * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) + * @param xDeveloperAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param signSolanaMessageWithEndUserAccountRequest (optional) + * @return ApiResponse<SignSolanaMessageWithEndUserAccount200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse signSolanaMessageWithEndUserAccountWithHttpInfo(String projectId, String userId, String xWalletAuth, String xIdempotencyKey, String xDeveloperAuth, SignSolanaMessageWithEndUserAccountRequest signSolanaMessageWithEndUserAccountRequest) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = signSolanaMessageWithEndUserAccountRequestBuilder(projectId, userId, xWalletAuth, xIdempotencyKey, xDeveloperAuth, signSolanaMessageWithEndUserAccountRequest); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("signSolanaMessageWithEndUserAccount", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder signSolanaMessageWithEndUserAccountRequestBuilder(String projectId, String userId, String xWalletAuth, String xIdempotencyKey, String xDeveloperAuth, SignSolanaMessageWithEndUserAccountRequest signSolanaMessageWithEndUserAccountRequest) throws ApiException { + // verify the required parameter 'projectId' is set + if (projectId == null) { + throw new ApiException(400, "Missing the required parameter 'projectId' when calling signSolanaMessageWithEndUserAccount"); + } + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling signSolanaMessageWithEndUserAccount"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v2/embedded-wallet-api/projects/{projectId}/end-users/{userId}/solana/sign/message" + .replace("{projectId}", ApiClient.urlEncode(projectId.toString())) + .replace("{userId}", ApiClient.urlEncode(userId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + if (xWalletAuth != null) { + localVarRequestBuilder.header("X-Wallet-Auth", xWalletAuth.toString()); + } + if (xIdempotencyKey != null) { + localVarRequestBuilder.header("X-Idempotency-Key", xIdempotencyKey.toString()); + } + if (xDeveloperAuth != null) { + localVarRequestBuilder.header("X-Developer-Auth", xDeveloperAuth.toString()); + } + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(signSolanaMessageWithEndUserAccountRequest); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Sign a transaction with end user Solana account + * Signs a transaction with the given end user Solana account. The unsigned transaction should be serialized into a byte array and then encoded as base64. **Transaction types** The following transaction types are supported: * [Legacy transactions](https://solana-labs.github.io/solana-web3.js/classes/Transaction.html) * [Versioned transactions](https://solana-labs.github.io/solana-web3.js/classes/VersionedTransaction.html) The developer is responsible for ensuring that the unsigned transaction is valid, as the API will not validate the transaction. + * @param projectId The ID of the CDP Project. (required) + * @param userId The ID of the end user. (required) + * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) + * @param xDeveloperAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param signSolanaTransactionWithEndUserAccountRequest (optional) + * @return SignSolanaTransactionWithEndUserAccount200Response + * @throws ApiException if fails to make API call + */ + public SignSolanaTransactionWithEndUserAccount200Response signSolanaTransactionWithEndUserAccount(String projectId, String userId, String xWalletAuth, String xIdempotencyKey, String xDeveloperAuth, SignSolanaTransactionWithEndUserAccountRequest signSolanaTransactionWithEndUserAccountRequest) throws ApiException { + ApiResponse localVarResponse = signSolanaTransactionWithEndUserAccountWithHttpInfo(projectId, userId, xWalletAuth, xIdempotencyKey, xDeveloperAuth, signSolanaTransactionWithEndUserAccountRequest); + return localVarResponse.getData(); + } + + /** + * Sign a transaction with end user Solana account + * Signs a transaction with the given end user Solana account. The unsigned transaction should be serialized into a byte array and then encoded as base64. **Transaction types** The following transaction types are supported: * [Legacy transactions](https://solana-labs.github.io/solana-web3.js/classes/Transaction.html) * [Versioned transactions](https://solana-labs.github.io/solana-web3.js/classes/VersionedTransaction.html) The developer is responsible for ensuring that the unsigned transaction is valid, as the API will not validate the transaction. + * @param projectId The ID of the CDP Project. (required) + * @param userId The ID of the end user. (required) + * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) + * @param xDeveloperAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param signSolanaTransactionWithEndUserAccountRequest (optional) + * @return ApiResponse<SignSolanaTransactionWithEndUserAccount200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse signSolanaTransactionWithEndUserAccountWithHttpInfo(String projectId, String userId, String xWalletAuth, String xIdempotencyKey, String xDeveloperAuth, SignSolanaTransactionWithEndUserAccountRequest signSolanaTransactionWithEndUserAccountRequest) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = signSolanaTransactionWithEndUserAccountRequestBuilder(projectId, userId, xWalletAuth, xIdempotencyKey, xDeveloperAuth, signSolanaTransactionWithEndUserAccountRequest); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("signSolanaTransactionWithEndUserAccount", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder signSolanaTransactionWithEndUserAccountRequestBuilder(String projectId, String userId, String xWalletAuth, String xIdempotencyKey, String xDeveloperAuth, SignSolanaTransactionWithEndUserAccountRequest signSolanaTransactionWithEndUserAccountRequest) throws ApiException { + // verify the required parameter 'projectId' is set + if (projectId == null) { + throw new ApiException(400, "Missing the required parameter 'projectId' when calling signSolanaTransactionWithEndUserAccount"); + } + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling signSolanaTransactionWithEndUserAccount"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v2/embedded-wallet-api/projects/{projectId}/end-users/{userId}/solana/sign/transaction" + .replace("{projectId}", ApiClient.urlEncode(projectId.toString())) + .replace("{userId}", ApiClient.urlEncode(userId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + if (xWalletAuth != null) { + localVarRequestBuilder.header("X-Wallet-Auth", xWalletAuth.toString()); + } + if (xIdempotencyKey != null) { + localVarRequestBuilder.header("X-Idempotency-Key", xIdempotencyKey.toString()); + } + if (xDeveloperAuth != null) { + localVarRequestBuilder.header("X-Developer-Auth", xDeveloperAuth.toString()); + } + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(signSolanaTransactionWithEndUserAccountRequest); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + +} diff --git a/java/src/main/java/com/coinbase/cdp/openapi/api/EmbeddedWalletsUnderDevelopmentApi.java b/java/src/main/java/com/coinbase/cdp/openapi/api/EmbeddedWalletsUnderDevelopmentApi.java new file mode 100644 index 000000000..be653a18e --- /dev/null +++ b/java/src/main/java/com/coinbase/cdp/openapi/api/EmbeddedWalletsUnderDevelopmentApi.java @@ -0,0 +1,1919 @@ +/* + * Coinbase Developer Platform APIs + * The Coinbase Developer Platform APIs - leading the world's transition onchain. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: cdp@coinbase.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.coinbase.cdp.openapi.api; + +import com.coinbase.cdp.openapi.ApiClient; +import com.coinbase.cdp.openapi.ApiException; +import com.coinbase.cdp.openapi.ApiResponse; +import com.coinbase.cdp.openapi.Pair; + +import com.coinbase.cdp.openapi.model.CreateDelegationForEndUser201Response; +import com.coinbase.cdp.openapi.model.CreateDelegationForEndUserRequest; +import com.coinbase.cdp.openapi.model.CreateEvmEip7702DelegationWithEndUserAccount201Response; +import com.coinbase.cdp.openapi.model.CreateEvmEip7702DelegationWithEndUserAccountRequest; +import com.coinbase.cdp.openapi.model.Error; +import com.coinbase.cdp.openapi.model.EvmUserOperation; +import com.coinbase.cdp.openapi.model.RevokeSpendPermissionRequest; +import com.coinbase.cdp.openapi.model.SendEvmAssetWithEndUserAccount200Response; +import com.coinbase.cdp.openapi.model.SendEvmAssetWithEndUserAccountRequest; +import com.coinbase.cdp.openapi.model.SendEvmTransactionWithEndUserAccount200Response; +import com.coinbase.cdp.openapi.model.SendEvmTransactionWithEndUserAccountRequest; +import com.coinbase.cdp.openapi.model.SendSolanaAssetWithEndUserAccountRequest; +import com.coinbase.cdp.openapi.model.SendSolanaTransactionWithEndUserAccount200Response; +import com.coinbase.cdp.openapi.model.SendSolanaTransactionWithEndUserAccountRequest; +import com.coinbase.cdp.openapi.model.SendUserOperationWithEndUserAccountRequest; +import com.coinbase.cdp.openapi.model.SignEvmHashWithEndUserAccount200Response; +import com.coinbase.cdp.openapi.model.SignEvmHashWithEndUserAccountRequest; +import com.coinbase.cdp.openapi.model.SignEvmMessageWithEndUserAccount200Response; +import com.coinbase.cdp.openapi.model.SignEvmMessageWithEndUserAccountRequest; +import com.coinbase.cdp.openapi.model.SignEvmTransactionWithEndUserAccount200Response; +import com.coinbase.cdp.openapi.model.SignEvmTransactionWithEndUserAccountRequest; +import com.coinbase.cdp.openapi.model.SignEvmTypedDataWithEndUserAccount200Response; +import com.coinbase.cdp.openapi.model.SignEvmTypedDataWithEndUserAccountRequest; +import com.coinbase.cdp.openapi.model.SignSolanaHashWithEndUserAccount200Response; +import com.coinbase.cdp.openapi.model.SignSolanaHashWithEndUserAccountRequest; +import com.coinbase.cdp.openapi.model.SignSolanaMessageWithEndUserAccount200Response; +import com.coinbase.cdp.openapi.model.SignSolanaMessageWithEndUserAccountRequest; +import com.coinbase.cdp.openapi.model.SignSolanaTransactionWithEndUserAccount200Response; +import com.coinbase.cdp.openapi.model.SignSolanaTransactionWithEndUserAccountRequest; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +import java.io.InputStream; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.OutputStream; +import java.net.http.HttpRequest; +import java.nio.channels.Channels; +import java.nio.channels.Pipe; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; + +import java.util.ArrayList; +import java.util.StringJoiner; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.function.Consumer; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class EmbeddedWalletsUnderDevelopmentApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public EmbeddedWalletsUnderDevelopmentApi() { + this(new ApiClient()); + } + + public EmbeddedWalletsUnderDevelopmentApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Create delegation for end user + * Creates a delegation that allows a developer to sign on behalf of an end user for the specified duration. The end user must be authenticated to authorize this delegation. + * @param projectId The ID of the CDP Project. (required) + * @param userId The ID of the end user. (required) + * @param createDelegationForEndUserRequest (required) + * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) + * @return CreateDelegationForEndUser201Response + * @throws ApiException if fails to make API call + */ + public CreateDelegationForEndUser201Response createDelegationForEndUser(String projectId, String userId, CreateDelegationForEndUserRequest createDelegationForEndUserRequest, String xWalletAuth, String xIdempotencyKey) throws ApiException { + ApiResponse localVarResponse = createDelegationForEndUserWithHttpInfo(projectId, userId, createDelegationForEndUserRequest, xWalletAuth, xIdempotencyKey); + return localVarResponse.getData(); + } + + /** + * Create delegation for end user + * Creates a delegation that allows a developer to sign on behalf of an end user for the specified duration. The end user must be authenticated to authorize this delegation. + * @param projectId The ID of the CDP Project. (required) + * @param userId The ID of the end user. (required) + * @param createDelegationForEndUserRequest (required) + * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) + * @return ApiResponse<CreateDelegationForEndUser201Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse createDelegationForEndUserWithHttpInfo(String projectId, String userId, CreateDelegationForEndUserRequest createDelegationForEndUserRequest, String xWalletAuth, String xIdempotencyKey) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = createDelegationForEndUserRequestBuilder(projectId, userId, createDelegationForEndUserRequest, xWalletAuth, xIdempotencyKey); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("createDelegationForEndUser", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder createDelegationForEndUserRequestBuilder(String projectId, String userId, CreateDelegationForEndUserRequest createDelegationForEndUserRequest, String xWalletAuth, String xIdempotencyKey) throws ApiException { + // verify the required parameter 'projectId' is set + if (projectId == null) { + throw new ApiException(400, "Missing the required parameter 'projectId' when calling createDelegationForEndUser"); + } + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling createDelegationForEndUser"); + } + // verify the required parameter 'createDelegationForEndUserRequest' is set + if (createDelegationForEndUserRequest == null) { + throw new ApiException(400, "Missing the required parameter 'createDelegationForEndUserRequest' when calling createDelegationForEndUser"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v2/embedded-wallet-api/projects/{projectId}/end-users/{userId}/delegations" + .replace("{projectId}", ApiClient.urlEncode(projectId.toString())) + .replace("{userId}", ApiClient.urlEncode(userId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + if (xWalletAuth != null) { + localVarRequestBuilder.header("X-Wallet-Auth", xWalletAuth.toString()); + } + if (xIdempotencyKey != null) { + localVarRequestBuilder.header("X-Idempotency-Key", xIdempotencyKey.toString()); + } + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(createDelegationForEndUserRequest); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Create EIP-7702 delegation for end user EVM account + * Creates an EIP-7702 delegation for an end user's EVM EOA account, upgrading it with smart account capabilities. This endpoint: - Retrieves delegation artifacts from onchain - Signs the EIP-7702 authorization for delegation - Assembles and submits a Type 4 transaction - Creates an associated smart account object The delegation allows the EVM EOA to be used as a smart account, which enables batched transactions and gas sponsorship via paymaster. + * @param projectId The ID of the CDP Project. (required) + * @param userId The ID of the end user. (required) + * @param createEvmEip7702DelegationWithEndUserAccountRequest (required) + * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) + * @return CreateEvmEip7702DelegationWithEndUserAccount201Response + * @throws ApiException if fails to make API call + */ + public CreateEvmEip7702DelegationWithEndUserAccount201Response createEvmEip7702DelegationWithEndUserAccount(String projectId, String userId, CreateEvmEip7702DelegationWithEndUserAccountRequest createEvmEip7702DelegationWithEndUserAccountRequest, String xWalletAuth, String xIdempotencyKey) throws ApiException { + ApiResponse localVarResponse = createEvmEip7702DelegationWithEndUserAccountWithHttpInfo(projectId, userId, createEvmEip7702DelegationWithEndUserAccountRequest, xWalletAuth, xIdempotencyKey); + return localVarResponse.getData(); + } + + /** + * Create EIP-7702 delegation for end user EVM account + * Creates an EIP-7702 delegation for an end user's EVM EOA account, upgrading it with smart account capabilities. This endpoint: - Retrieves delegation artifacts from onchain - Signs the EIP-7702 authorization for delegation - Assembles and submits a Type 4 transaction - Creates an associated smart account object The delegation allows the EVM EOA to be used as a smart account, which enables batched transactions and gas sponsorship via paymaster. + * @param projectId The ID of the CDP Project. (required) + * @param userId The ID of the end user. (required) + * @param createEvmEip7702DelegationWithEndUserAccountRequest (required) + * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) + * @return ApiResponse<CreateEvmEip7702DelegationWithEndUserAccount201Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse createEvmEip7702DelegationWithEndUserAccountWithHttpInfo(String projectId, String userId, CreateEvmEip7702DelegationWithEndUserAccountRequest createEvmEip7702DelegationWithEndUserAccountRequest, String xWalletAuth, String xIdempotencyKey) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = createEvmEip7702DelegationWithEndUserAccountRequestBuilder(projectId, userId, createEvmEip7702DelegationWithEndUserAccountRequest, xWalletAuth, xIdempotencyKey); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("createEvmEip7702DelegationWithEndUserAccount", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder createEvmEip7702DelegationWithEndUserAccountRequestBuilder(String projectId, String userId, CreateEvmEip7702DelegationWithEndUserAccountRequest createEvmEip7702DelegationWithEndUserAccountRequest, String xWalletAuth, String xIdempotencyKey) throws ApiException { + // verify the required parameter 'projectId' is set + if (projectId == null) { + throw new ApiException(400, "Missing the required parameter 'projectId' when calling createEvmEip7702DelegationWithEndUserAccount"); + } + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling createEvmEip7702DelegationWithEndUserAccount"); + } + // verify the required parameter 'createEvmEip7702DelegationWithEndUserAccountRequest' is set + if (createEvmEip7702DelegationWithEndUserAccountRequest == null) { + throw new ApiException(400, "Missing the required parameter 'createEvmEip7702DelegationWithEndUserAccountRequest' when calling createEvmEip7702DelegationWithEndUserAccount"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v2/embedded-wallet-api/projects/{projectId}/end-users/{userId}/evm/eip7702/delegation" + .replace("{projectId}", ApiClient.urlEncode(projectId.toString())) + .replace("{userId}", ApiClient.urlEncode(userId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + if (xWalletAuth != null) { + localVarRequestBuilder.header("X-Wallet-Auth", xWalletAuth.toString()); + } + if (xIdempotencyKey != null) { + localVarRequestBuilder.header("X-Idempotency-Key", xIdempotencyKey.toString()); + } + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(createEvmEip7702DelegationWithEndUserAccountRequest); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Revoke delegation for end user + * Revokes all active delegations for the specified end user. This operation can be performed by the end user themselves or by a developer using their API key. + * @param projectId The ID of the CDP Project. (required) + * @param userId The ID of the end user. (required) + * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) + * @throws ApiException if fails to make API call + */ + public void revokeDelegationForEndUser(String projectId, String userId, String xWalletAuth, String xIdempotencyKey) throws ApiException { + revokeDelegationForEndUserWithHttpInfo(projectId, userId, xWalletAuth, xIdempotencyKey); + } + + /** + * Revoke delegation for end user + * Revokes all active delegations for the specified end user. This operation can be performed by the end user themselves or by a developer using their API key. + * @param projectId The ID of the CDP Project. (required) + * @param userId The ID of the end user. (required) + * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse revokeDelegationForEndUserWithHttpInfo(String projectId, String userId, String xWalletAuth, String xIdempotencyKey) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = revokeDelegationForEndUserRequestBuilder(projectId, userId, xWalletAuth, xIdempotencyKey); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("revokeDelegationForEndUser", localVarResponse); + } + return new ApiResponse<>( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder revokeDelegationForEndUserRequestBuilder(String projectId, String userId, String xWalletAuth, String xIdempotencyKey) throws ApiException { + // verify the required parameter 'projectId' is set + if (projectId == null) { + throw new ApiException(400, "Missing the required parameter 'projectId' when calling revokeDelegationForEndUser"); + } + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling revokeDelegationForEndUser"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v2/embedded-wallet-api/projects/{projectId}/end-users/{userId}/delegations" + .replace("{projectId}", ApiClient.urlEncode(projectId.toString())) + .replace("{userId}", ApiClient.urlEncode(userId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + if (xWalletAuth != null) { + localVarRequestBuilder.header("X-Wallet-Auth", xWalletAuth.toString()); + } + if (xIdempotencyKey != null) { + localVarRequestBuilder.header("X-Idempotency-Key", xIdempotencyKey.toString()); + } + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Revoke a spend permission + * Revokes an existing spend permission. + * @param projectId The ID of the CDP Project. (required) + * @param userId The ID of the end user. (required) + * @param address The address of the Smart account this spend permission is valid for. (required) + * @param revokeSpendPermissionRequest (required) + * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) + * @return EvmUserOperation + * @throws ApiException if fails to make API call + */ + public EvmUserOperation revokeSpendPermissionWithEndUserAccount(String projectId, String userId, String address, RevokeSpendPermissionRequest revokeSpendPermissionRequest, String xWalletAuth, String xIdempotencyKey) throws ApiException { + ApiResponse localVarResponse = revokeSpendPermissionWithEndUserAccountWithHttpInfo(projectId, userId, address, revokeSpendPermissionRequest, xWalletAuth, xIdempotencyKey); + return localVarResponse.getData(); + } + + /** + * Revoke a spend permission + * Revokes an existing spend permission. + * @param projectId The ID of the CDP Project. (required) + * @param userId The ID of the end user. (required) + * @param address The address of the Smart account this spend permission is valid for. (required) + * @param revokeSpendPermissionRequest (required) + * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) + * @return ApiResponse<EvmUserOperation> + * @throws ApiException if fails to make API call + */ + public ApiResponse revokeSpendPermissionWithEndUserAccountWithHttpInfo(String projectId, String userId, String address, RevokeSpendPermissionRequest revokeSpendPermissionRequest, String xWalletAuth, String xIdempotencyKey) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = revokeSpendPermissionWithEndUserAccountRequestBuilder(projectId, userId, address, revokeSpendPermissionRequest, xWalletAuth, xIdempotencyKey); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("revokeSpendPermissionWithEndUserAccount", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder revokeSpendPermissionWithEndUserAccountRequestBuilder(String projectId, String userId, String address, RevokeSpendPermissionRequest revokeSpendPermissionRequest, String xWalletAuth, String xIdempotencyKey) throws ApiException { + // verify the required parameter 'projectId' is set + if (projectId == null) { + throw new ApiException(400, "Missing the required parameter 'projectId' when calling revokeSpendPermissionWithEndUserAccount"); + } + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling revokeSpendPermissionWithEndUserAccount"); + } + // verify the required parameter 'address' is set + if (address == null) { + throw new ApiException(400, "Missing the required parameter 'address' when calling revokeSpendPermissionWithEndUserAccount"); + } + // verify the required parameter 'revokeSpendPermissionRequest' is set + if (revokeSpendPermissionRequest == null) { + throw new ApiException(400, "Missing the required parameter 'revokeSpendPermissionRequest' when calling revokeSpendPermissionWithEndUserAccount"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v2/embedded-wallet-api/projects/{projectId}/end-users/{userId}/evm/smart-accounts/{address}/spend-permissions/revoke" + .replace("{projectId}", ApiClient.urlEncode(projectId.toString())) + .replace("{userId}", ApiClient.urlEncode(userId.toString())) + .replace("{address}", ApiClient.urlEncode(address.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + if (xWalletAuth != null) { + localVarRequestBuilder.header("X-Wallet-Auth", xWalletAuth.toString()); + } + if (xIdempotencyKey != null) { + localVarRequestBuilder.header("X-Idempotency-Key", xIdempotencyKey.toString()); + } + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(revokeSpendPermissionRequest); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Send USDC on EVM + * Sends USDC from an end user's EVM account (EOA or Smart Account) to a recipient address on a supported EVM network. This endpoint simplifies USDC transfers by automatically handling contract resolution, decimal conversion, gas estimation, and transaction encoding. The `amount` field accepts human-readable amounts as decimal strings (e.g., \"1.5\", \"25.50\"). + * @param projectId The ID of the CDP Project. (required) + * @param userId The ID of the end user. (required) + * @param address The 0x-prefixed address of the EVM account (EOA or Smart Account) to send USDC from. The address does not need to be checksummed. (required) + * @param asset The asset to send. Currently only \"usdc\" is supported. (required) + * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) + * @param sendEvmAssetWithEndUserAccountRequest (optional) + * @return SendEvmAssetWithEndUserAccount200Response + * @throws ApiException if fails to make API call + */ + public SendEvmAssetWithEndUserAccount200Response sendEvmAssetWithEndUserAccount(String projectId, String userId, String address, String asset, String xWalletAuth, String xIdempotencyKey, SendEvmAssetWithEndUserAccountRequest sendEvmAssetWithEndUserAccountRequest) throws ApiException { + ApiResponse localVarResponse = sendEvmAssetWithEndUserAccountWithHttpInfo(projectId, userId, address, asset, xWalletAuth, xIdempotencyKey, sendEvmAssetWithEndUserAccountRequest); + return localVarResponse.getData(); + } + + /** + * Send USDC on EVM + * Sends USDC from an end user's EVM account (EOA or Smart Account) to a recipient address on a supported EVM network. This endpoint simplifies USDC transfers by automatically handling contract resolution, decimal conversion, gas estimation, and transaction encoding. The `amount` field accepts human-readable amounts as decimal strings (e.g., \"1.5\", \"25.50\"). + * @param projectId The ID of the CDP Project. (required) + * @param userId The ID of the end user. (required) + * @param address The 0x-prefixed address of the EVM account (EOA or Smart Account) to send USDC from. The address does not need to be checksummed. (required) + * @param asset The asset to send. Currently only \"usdc\" is supported. (required) + * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) + * @param sendEvmAssetWithEndUserAccountRequest (optional) + * @return ApiResponse<SendEvmAssetWithEndUserAccount200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse sendEvmAssetWithEndUserAccountWithHttpInfo(String projectId, String userId, String address, String asset, String xWalletAuth, String xIdempotencyKey, SendEvmAssetWithEndUserAccountRequest sendEvmAssetWithEndUserAccountRequest) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = sendEvmAssetWithEndUserAccountRequestBuilder(projectId, userId, address, asset, xWalletAuth, xIdempotencyKey, sendEvmAssetWithEndUserAccountRequest); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("sendEvmAssetWithEndUserAccount", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder sendEvmAssetWithEndUserAccountRequestBuilder(String projectId, String userId, String address, String asset, String xWalletAuth, String xIdempotencyKey, SendEvmAssetWithEndUserAccountRequest sendEvmAssetWithEndUserAccountRequest) throws ApiException { + // verify the required parameter 'projectId' is set + if (projectId == null) { + throw new ApiException(400, "Missing the required parameter 'projectId' when calling sendEvmAssetWithEndUserAccount"); + } + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling sendEvmAssetWithEndUserAccount"); + } + // verify the required parameter 'address' is set + if (address == null) { + throw new ApiException(400, "Missing the required parameter 'address' when calling sendEvmAssetWithEndUserAccount"); + } + // verify the required parameter 'asset' is set + if (asset == null) { + throw new ApiException(400, "Missing the required parameter 'asset' when calling sendEvmAssetWithEndUserAccount"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v2/embedded-wallet-api/projects/{projectId}/end-users/{userId}/evm/{address}/send/{asset}" + .replace("{projectId}", ApiClient.urlEncode(projectId.toString())) + .replace("{userId}", ApiClient.urlEncode(userId.toString())) + .replace("{address}", ApiClient.urlEncode(address.toString())) + .replace("{asset}", ApiClient.urlEncode(asset.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + if (xWalletAuth != null) { + localVarRequestBuilder.header("X-Wallet-Auth", xWalletAuth.toString()); + } + if (xIdempotencyKey != null) { + localVarRequestBuilder.header("X-Idempotency-Key", xIdempotencyKey.toString()); + } + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(sendEvmAssetWithEndUserAccountRequest); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Send a transaction with end user EVM account + * Signs a transaction with the given end user EVM account and sends it to the indicated supported network. This API handles nonce management and gas estimation, leaving the developer to provide only the minimal set of fields necessary to send the transaction. The transaction should be serialized as a hex string using [RLP](https://ethereum.org/en/developers/docs/data-structures-and-encoding/rlp/). The transaction must be an [EIP-1559 dynamic fee transaction](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1559.md). **Transaction fields and API behavior** - `to` *(Required)*: The address of the contract or account to send the transaction to. - `chainId` *(Ignored)*: The value of the `chainId` field in the transaction is ignored. The transaction will be sent to the network indicated by the `network` field in the request body. - `nonce` *(Optional)*: The nonce to use for the transaction. If not provided, the API will assign a nonce to the transaction based on the current state of the account. - `maxPriorityFeePerGas` *(Optional)*: The maximum priority fee per gas to use for the transaction. If not provided, the API will estimate a value based on current network conditions. - `maxFeePerGas` *(Optional)*: The maximum fee per gas to use for the transaction. If not provided, the API will estimate a value based on current network conditions. - `gasLimit` *(Optional)*: The gas limit to use for the transaction. If not provided, the API will estimate a value based on the `to` and `data` fields of the transaction. - `value` *(Optional)*: The amount of ETH, in wei, to send with the transaction. - `data` *(Optional)*: The data to send with the transaction; only used for contract calls. - `accessList` *(Optional)*: The access list to use for the transaction. + * @param projectId The ID of the CDP Project. (required) + * @param userId The ID of the end user. (required) + * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) + * @param sendEvmTransactionWithEndUserAccountRequest (optional) + * @return SendEvmTransactionWithEndUserAccount200Response + * @throws ApiException if fails to make API call + */ + public SendEvmTransactionWithEndUserAccount200Response sendEvmTransactionWithEndUserAccount(String projectId, String userId, String xWalletAuth, String xIdempotencyKey, SendEvmTransactionWithEndUserAccountRequest sendEvmTransactionWithEndUserAccountRequest) throws ApiException { + ApiResponse localVarResponse = sendEvmTransactionWithEndUserAccountWithHttpInfo(projectId, userId, xWalletAuth, xIdempotencyKey, sendEvmTransactionWithEndUserAccountRequest); + return localVarResponse.getData(); + } + + /** + * Send a transaction with end user EVM account + * Signs a transaction with the given end user EVM account and sends it to the indicated supported network. This API handles nonce management and gas estimation, leaving the developer to provide only the minimal set of fields necessary to send the transaction. The transaction should be serialized as a hex string using [RLP](https://ethereum.org/en/developers/docs/data-structures-and-encoding/rlp/). The transaction must be an [EIP-1559 dynamic fee transaction](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1559.md). **Transaction fields and API behavior** - `to` *(Required)*: The address of the contract or account to send the transaction to. - `chainId` *(Ignored)*: The value of the `chainId` field in the transaction is ignored. The transaction will be sent to the network indicated by the `network` field in the request body. - `nonce` *(Optional)*: The nonce to use for the transaction. If not provided, the API will assign a nonce to the transaction based on the current state of the account. - `maxPriorityFeePerGas` *(Optional)*: The maximum priority fee per gas to use for the transaction. If not provided, the API will estimate a value based on current network conditions. - `maxFeePerGas` *(Optional)*: The maximum fee per gas to use for the transaction. If not provided, the API will estimate a value based on current network conditions. - `gasLimit` *(Optional)*: The gas limit to use for the transaction. If not provided, the API will estimate a value based on the `to` and `data` fields of the transaction. - `value` *(Optional)*: The amount of ETH, in wei, to send with the transaction. - `data` *(Optional)*: The data to send with the transaction; only used for contract calls. - `accessList` *(Optional)*: The access list to use for the transaction. + * @param projectId The ID of the CDP Project. (required) + * @param userId The ID of the end user. (required) + * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) + * @param sendEvmTransactionWithEndUserAccountRequest (optional) + * @return ApiResponse<SendEvmTransactionWithEndUserAccount200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse sendEvmTransactionWithEndUserAccountWithHttpInfo(String projectId, String userId, String xWalletAuth, String xIdempotencyKey, SendEvmTransactionWithEndUserAccountRequest sendEvmTransactionWithEndUserAccountRequest) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = sendEvmTransactionWithEndUserAccountRequestBuilder(projectId, userId, xWalletAuth, xIdempotencyKey, sendEvmTransactionWithEndUserAccountRequest); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("sendEvmTransactionWithEndUserAccount", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder sendEvmTransactionWithEndUserAccountRequestBuilder(String projectId, String userId, String xWalletAuth, String xIdempotencyKey, SendEvmTransactionWithEndUserAccountRequest sendEvmTransactionWithEndUserAccountRequest) throws ApiException { + // verify the required parameter 'projectId' is set + if (projectId == null) { + throw new ApiException(400, "Missing the required parameter 'projectId' when calling sendEvmTransactionWithEndUserAccount"); + } + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling sendEvmTransactionWithEndUserAccount"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v2/embedded-wallet-api/projects/{projectId}/end-users/{userId}/evm/send/transaction" + .replace("{projectId}", ApiClient.urlEncode(projectId.toString())) + .replace("{userId}", ApiClient.urlEncode(userId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + if (xWalletAuth != null) { + localVarRequestBuilder.header("X-Wallet-Auth", xWalletAuth.toString()); + } + if (xIdempotencyKey != null) { + localVarRequestBuilder.header("X-Idempotency-Key", xIdempotencyKey.toString()); + } + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(sendEvmTransactionWithEndUserAccountRequest); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Send USDC on Solana + * Sends USDC from an end user's Solana account to a recipient address on the Solana network. This endpoint simplifies USDC transfers by automatically handling mint resolution, Associated Token Account (ATA) creation, decimal conversion, and transaction encoding. The `amount` field accepts human-readable amounts as decimal strings (e.g., \"1.5\", \"25.50\"). Use the optional `createRecipientAta` parameter to control whether the sender pays for creating the recipient's Associated Token Account if it doesn't exist. + * @param projectId The ID of the CDP Project. (required) + * @param userId The ID of the end user. (required) + * @param address The base58 encoded address of the Solana account to send USDC from. (required) + * @param asset The asset to send. Currently only \"usdc\" is supported. (required) + * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) + * @param xDeveloperAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param sendSolanaAssetWithEndUserAccountRequest (optional) + * @return SendSolanaTransactionWithEndUserAccount200Response + * @throws ApiException if fails to make API call + */ + public SendSolanaTransactionWithEndUserAccount200Response sendSolanaAssetWithEndUserAccount(String projectId, String userId, String address, String asset, String xWalletAuth, String xIdempotencyKey, String xDeveloperAuth, SendSolanaAssetWithEndUserAccountRequest sendSolanaAssetWithEndUserAccountRequest) throws ApiException { + ApiResponse localVarResponse = sendSolanaAssetWithEndUserAccountWithHttpInfo(projectId, userId, address, asset, xWalletAuth, xIdempotencyKey, xDeveloperAuth, sendSolanaAssetWithEndUserAccountRequest); + return localVarResponse.getData(); + } + + /** + * Send USDC on Solana + * Sends USDC from an end user's Solana account to a recipient address on the Solana network. This endpoint simplifies USDC transfers by automatically handling mint resolution, Associated Token Account (ATA) creation, decimal conversion, and transaction encoding. The `amount` field accepts human-readable amounts as decimal strings (e.g., \"1.5\", \"25.50\"). Use the optional `createRecipientAta` parameter to control whether the sender pays for creating the recipient's Associated Token Account if it doesn't exist. + * @param projectId The ID of the CDP Project. (required) + * @param userId The ID of the end user. (required) + * @param address The base58 encoded address of the Solana account to send USDC from. (required) + * @param asset The asset to send. Currently only \"usdc\" is supported. (required) + * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) + * @param xDeveloperAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param sendSolanaAssetWithEndUserAccountRequest (optional) + * @return ApiResponse<SendSolanaTransactionWithEndUserAccount200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse sendSolanaAssetWithEndUserAccountWithHttpInfo(String projectId, String userId, String address, String asset, String xWalletAuth, String xIdempotencyKey, String xDeveloperAuth, SendSolanaAssetWithEndUserAccountRequest sendSolanaAssetWithEndUserAccountRequest) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = sendSolanaAssetWithEndUserAccountRequestBuilder(projectId, userId, address, asset, xWalletAuth, xIdempotencyKey, xDeveloperAuth, sendSolanaAssetWithEndUserAccountRequest); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("sendSolanaAssetWithEndUserAccount", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder sendSolanaAssetWithEndUserAccountRequestBuilder(String projectId, String userId, String address, String asset, String xWalletAuth, String xIdempotencyKey, String xDeveloperAuth, SendSolanaAssetWithEndUserAccountRequest sendSolanaAssetWithEndUserAccountRequest) throws ApiException { + // verify the required parameter 'projectId' is set + if (projectId == null) { + throw new ApiException(400, "Missing the required parameter 'projectId' when calling sendSolanaAssetWithEndUserAccount"); + } + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling sendSolanaAssetWithEndUserAccount"); + } + // verify the required parameter 'address' is set + if (address == null) { + throw new ApiException(400, "Missing the required parameter 'address' when calling sendSolanaAssetWithEndUserAccount"); + } + // verify the required parameter 'asset' is set + if (asset == null) { + throw new ApiException(400, "Missing the required parameter 'asset' when calling sendSolanaAssetWithEndUserAccount"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v2/embedded-wallet-api/projects/{projectId}/end-users/{userId}/solana/{address}/send/{asset}" + .replace("{projectId}", ApiClient.urlEncode(projectId.toString())) + .replace("{userId}", ApiClient.urlEncode(userId.toString())) + .replace("{address}", ApiClient.urlEncode(address.toString())) + .replace("{asset}", ApiClient.urlEncode(asset.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + if (xWalletAuth != null) { + localVarRequestBuilder.header("X-Wallet-Auth", xWalletAuth.toString()); + } + if (xIdempotencyKey != null) { + localVarRequestBuilder.header("X-Idempotency-Key", xIdempotencyKey.toString()); + } + if (xDeveloperAuth != null) { + localVarRequestBuilder.header("X-Developer-Auth", xDeveloperAuth.toString()); + } + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(sendSolanaAssetWithEndUserAccountRequest); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Send a transaction with end user Solana account + * Signs a transaction with the given end user Solana account and sends it to the indicated supported network. The API handles recent blockhash management and fee estimation, leaving the developer to provide only the minimal set of fields necessary to send the transaction. The unsigned transaction should be serialized into a byte array and then encoded as base64. **Transaction types** The following transaction types are supported: * [Legacy transactions](https://solana.com/developers/guides/advanced/versions#current-transaction-versions) * [Versioned transactions](https://solana.com/developers/guides/advanced/versions) **Instruction Batching** To batch multiple operations, include multiple instructions within a single transaction. All instructions within a transaction are executed atomically - if any instruction fails, the entire transaction fails and is rolled back. **Network Support** The following Solana networks are supported: * `solana` - Solana Mainnet * `solana-devnet` - Solana Devnet The developer is responsible for ensuring that the unsigned transaction is valid, as the API will not validate the transaction. + * @param projectId The ID of the CDP Project. (required) + * @param userId The ID of the end user. (required) + * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) + * @param xDeveloperAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param sendSolanaTransactionWithEndUserAccountRequest (optional) + * @return SendSolanaTransactionWithEndUserAccount200Response + * @throws ApiException if fails to make API call + */ + public SendSolanaTransactionWithEndUserAccount200Response sendSolanaTransactionWithEndUserAccount(String projectId, String userId, String xWalletAuth, String xIdempotencyKey, String xDeveloperAuth, SendSolanaTransactionWithEndUserAccountRequest sendSolanaTransactionWithEndUserAccountRequest) throws ApiException { + ApiResponse localVarResponse = sendSolanaTransactionWithEndUserAccountWithHttpInfo(projectId, userId, xWalletAuth, xIdempotencyKey, xDeveloperAuth, sendSolanaTransactionWithEndUserAccountRequest); + return localVarResponse.getData(); + } + + /** + * Send a transaction with end user Solana account + * Signs a transaction with the given end user Solana account and sends it to the indicated supported network. The API handles recent blockhash management and fee estimation, leaving the developer to provide only the minimal set of fields necessary to send the transaction. The unsigned transaction should be serialized into a byte array and then encoded as base64. **Transaction types** The following transaction types are supported: * [Legacy transactions](https://solana.com/developers/guides/advanced/versions#current-transaction-versions) * [Versioned transactions](https://solana.com/developers/guides/advanced/versions) **Instruction Batching** To batch multiple operations, include multiple instructions within a single transaction. All instructions within a transaction are executed atomically - if any instruction fails, the entire transaction fails and is rolled back. **Network Support** The following Solana networks are supported: * `solana` - Solana Mainnet * `solana-devnet` - Solana Devnet The developer is responsible for ensuring that the unsigned transaction is valid, as the API will not validate the transaction. + * @param projectId The ID of the CDP Project. (required) + * @param userId The ID of the end user. (required) + * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) + * @param xDeveloperAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param sendSolanaTransactionWithEndUserAccountRequest (optional) + * @return ApiResponse<SendSolanaTransactionWithEndUserAccount200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse sendSolanaTransactionWithEndUserAccountWithHttpInfo(String projectId, String userId, String xWalletAuth, String xIdempotencyKey, String xDeveloperAuth, SendSolanaTransactionWithEndUserAccountRequest sendSolanaTransactionWithEndUserAccountRequest) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = sendSolanaTransactionWithEndUserAccountRequestBuilder(projectId, userId, xWalletAuth, xIdempotencyKey, xDeveloperAuth, sendSolanaTransactionWithEndUserAccountRequest); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("sendSolanaTransactionWithEndUserAccount", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder sendSolanaTransactionWithEndUserAccountRequestBuilder(String projectId, String userId, String xWalletAuth, String xIdempotencyKey, String xDeveloperAuth, SendSolanaTransactionWithEndUserAccountRequest sendSolanaTransactionWithEndUserAccountRequest) throws ApiException { + // verify the required parameter 'projectId' is set + if (projectId == null) { + throw new ApiException(400, "Missing the required parameter 'projectId' when calling sendSolanaTransactionWithEndUserAccount"); + } + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling sendSolanaTransactionWithEndUserAccount"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v2/embedded-wallet-api/projects/{projectId}/end-users/{userId}/solana/send/transaction" + .replace("{projectId}", ApiClient.urlEncode(projectId.toString())) + .replace("{userId}", ApiClient.urlEncode(userId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + if (xWalletAuth != null) { + localVarRequestBuilder.header("X-Wallet-Auth", xWalletAuth.toString()); + } + if (xIdempotencyKey != null) { + localVarRequestBuilder.header("X-Idempotency-Key", xIdempotencyKey.toString()); + } + if (xDeveloperAuth != null) { + localVarRequestBuilder.header("X-Developer-Auth", xDeveloperAuth.toString()); + } + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(sendSolanaTransactionWithEndUserAccountRequest); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Send a user operation for end user Smart Account + * Prepares, signs, and sends a user operation for an end user's Smart Account. + * @param projectId The ID of the CDP Project. (required) + * @param userId The ID of the end user. (required) + * @param address The address of the EVM Smart Account to execute the user operation from. (required) + * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) + * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param sendUserOperationWithEndUserAccountRequest (optional) + * @return EvmUserOperation + * @throws ApiException if fails to make API call + */ + public EvmUserOperation sendUserOperationWithEndUserAccount(String projectId, String userId, String address, String xIdempotencyKey, String xWalletAuth, SendUserOperationWithEndUserAccountRequest sendUserOperationWithEndUserAccountRequest) throws ApiException { + ApiResponse localVarResponse = sendUserOperationWithEndUserAccountWithHttpInfo(projectId, userId, address, xIdempotencyKey, xWalletAuth, sendUserOperationWithEndUserAccountRequest); + return localVarResponse.getData(); + } + + /** + * Send a user operation for end user Smart Account + * Prepares, signs, and sends a user operation for an end user's Smart Account. + * @param projectId The ID of the CDP Project. (required) + * @param userId The ID of the end user. (required) + * @param address The address of the EVM Smart Account to execute the user operation from. (required) + * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) + * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param sendUserOperationWithEndUserAccountRequest (optional) + * @return ApiResponse<EvmUserOperation> + * @throws ApiException if fails to make API call + */ + public ApiResponse sendUserOperationWithEndUserAccountWithHttpInfo(String projectId, String userId, String address, String xIdempotencyKey, String xWalletAuth, SendUserOperationWithEndUserAccountRequest sendUserOperationWithEndUserAccountRequest) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = sendUserOperationWithEndUserAccountRequestBuilder(projectId, userId, address, xIdempotencyKey, xWalletAuth, sendUserOperationWithEndUserAccountRequest); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("sendUserOperationWithEndUserAccount", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder sendUserOperationWithEndUserAccountRequestBuilder(String projectId, String userId, String address, String xIdempotencyKey, String xWalletAuth, SendUserOperationWithEndUserAccountRequest sendUserOperationWithEndUserAccountRequest) throws ApiException { + // verify the required parameter 'projectId' is set + if (projectId == null) { + throw new ApiException(400, "Missing the required parameter 'projectId' when calling sendUserOperationWithEndUserAccount"); + } + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling sendUserOperationWithEndUserAccount"); + } + // verify the required parameter 'address' is set + if (address == null) { + throw new ApiException(400, "Missing the required parameter 'address' when calling sendUserOperationWithEndUserAccount"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v2/embedded-wallet-api/projects/{projectId}/end-users/{userId}/evm/smart-accounts/{address}/send" + .replace("{projectId}", ApiClient.urlEncode(projectId.toString())) + .replace("{userId}", ApiClient.urlEncode(userId.toString())) + .replace("{address}", ApiClient.urlEncode(address.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + if (xIdempotencyKey != null) { + localVarRequestBuilder.header("X-Idempotency-Key", xIdempotencyKey.toString()); + } + if (xWalletAuth != null) { + localVarRequestBuilder.header("X-Wallet-Auth", xWalletAuth.toString()); + } + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(sendUserOperationWithEndUserAccountRequest); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Sign a hash with end user EVM account + * Signs an arbitrary 32 byte hash with the end user's given EVM account. + * @param projectId The ID of the CDP Project. (required) + * @param userId The ID of the end user. (required) + * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) + * @param xDeveloperAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param signEvmHashWithEndUserAccountRequest (optional) + * @return SignEvmHashWithEndUserAccount200Response + * @throws ApiException if fails to make API call + */ + public SignEvmHashWithEndUserAccount200Response signEvmHashWithEndUserAccount(String projectId, String userId, String xWalletAuth, String xIdempotencyKey, String xDeveloperAuth, SignEvmHashWithEndUserAccountRequest signEvmHashWithEndUserAccountRequest) throws ApiException { + ApiResponse localVarResponse = signEvmHashWithEndUserAccountWithHttpInfo(projectId, userId, xWalletAuth, xIdempotencyKey, xDeveloperAuth, signEvmHashWithEndUserAccountRequest); + return localVarResponse.getData(); + } + + /** + * Sign a hash with end user EVM account + * Signs an arbitrary 32 byte hash with the end user's given EVM account. + * @param projectId The ID of the CDP Project. (required) + * @param userId The ID of the end user. (required) + * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) + * @param xDeveloperAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param signEvmHashWithEndUserAccountRequest (optional) + * @return ApiResponse<SignEvmHashWithEndUserAccount200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse signEvmHashWithEndUserAccountWithHttpInfo(String projectId, String userId, String xWalletAuth, String xIdempotencyKey, String xDeveloperAuth, SignEvmHashWithEndUserAccountRequest signEvmHashWithEndUserAccountRequest) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = signEvmHashWithEndUserAccountRequestBuilder(projectId, userId, xWalletAuth, xIdempotencyKey, xDeveloperAuth, signEvmHashWithEndUserAccountRequest); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("signEvmHashWithEndUserAccount", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder signEvmHashWithEndUserAccountRequestBuilder(String projectId, String userId, String xWalletAuth, String xIdempotencyKey, String xDeveloperAuth, SignEvmHashWithEndUserAccountRequest signEvmHashWithEndUserAccountRequest) throws ApiException { + // verify the required parameter 'projectId' is set + if (projectId == null) { + throw new ApiException(400, "Missing the required parameter 'projectId' when calling signEvmHashWithEndUserAccount"); + } + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling signEvmHashWithEndUserAccount"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v2/embedded-wallet-api/projects/{projectId}/end-users/{userId}/evm/sign" + .replace("{projectId}", ApiClient.urlEncode(projectId.toString())) + .replace("{userId}", ApiClient.urlEncode(userId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + if (xWalletAuth != null) { + localVarRequestBuilder.header("X-Wallet-Auth", xWalletAuth.toString()); + } + if (xIdempotencyKey != null) { + localVarRequestBuilder.header("X-Idempotency-Key", xIdempotencyKey.toString()); + } + if (xDeveloperAuth != null) { + localVarRequestBuilder.header("X-Developer-Auth", xDeveloperAuth.toString()); + } + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(signEvmHashWithEndUserAccountRequest); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Sign an EIP-191 message with end user EVM account + * Signs an [EIP-191](https://eips.ethereum.org/EIPS/eip-191) message with the given end user EVM account. Per the specification, the message in the request body is prepended with `0x19 <0x45 (E)> <thereum Signed Message:\\n\" + len(message)>` before being signed. + * @param projectId The ID of the CDP Project. (required) + * @param userId The ID of the end user. (required) + * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) + * @param signEvmMessageWithEndUserAccountRequest (optional) + * @return SignEvmMessageWithEndUserAccount200Response + * @throws ApiException if fails to make API call + */ + public SignEvmMessageWithEndUserAccount200Response signEvmMessageWithEndUserAccount(String projectId, String userId, String xWalletAuth, String xIdempotencyKey, SignEvmMessageWithEndUserAccountRequest signEvmMessageWithEndUserAccountRequest) throws ApiException { + ApiResponse localVarResponse = signEvmMessageWithEndUserAccountWithHttpInfo(projectId, userId, xWalletAuth, xIdempotencyKey, signEvmMessageWithEndUserAccountRequest); + return localVarResponse.getData(); + } + + /** + * Sign an EIP-191 message with end user EVM account + * Signs an [EIP-191](https://eips.ethereum.org/EIPS/eip-191) message with the given end user EVM account. Per the specification, the message in the request body is prepended with `0x19 <0x45 (E)> <thereum Signed Message:\\n\" + len(message)>` before being signed. + * @param projectId The ID of the CDP Project. (required) + * @param userId The ID of the end user. (required) + * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) + * @param signEvmMessageWithEndUserAccountRequest (optional) + * @return ApiResponse<SignEvmMessageWithEndUserAccount200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse signEvmMessageWithEndUserAccountWithHttpInfo(String projectId, String userId, String xWalletAuth, String xIdempotencyKey, SignEvmMessageWithEndUserAccountRequest signEvmMessageWithEndUserAccountRequest) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = signEvmMessageWithEndUserAccountRequestBuilder(projectId, userId, xWalletAuth, xIdempotencyKey, signEvmMessageWithEndUserAccountRequest); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("signEvmMessageWithEndUserAccount", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder signEvmMessageWithEndUserAccountRequestBuilder(String projectId, String userId, String xWalletAuth, String xIdempotencyKey, SignEvmMessageWithEndUserAccountRequest signEvmMessageWithEndUserAccountRequest) throws ApiException { + // verify the required parameter 'projectId' is set + if (projectId == null) { + throw new ApiException(400, "Missing the required parameter 'projectId' when calling signEvmMessageWithEndUserAccount"); + } + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling signEvmMessageWithEndUserAccount"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v2/embedded-wallet-api/projects/{projectId}/end-users/{userId}/evm/sign/message" + .replace("{projectId}", ApiClient.urlEncode(projectId.toString())) + .replace("{userId}", ApiClient.urlEncode(userId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + if (xWalletAuth != null) { + localVarRequestBuilder.header("X-Wallet-Auth", xWalletAuth.toString()); + } + if (xIdempotencyKey != null) { + localVarRequestBuilder.header("X-Idempotency-Key", xIdempotencyKey.toString()); + } + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(signEvmMessageWithEndUserAccountRequest); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Sign a transaction with end user EVM account + * Signs a transaction with the given end user EVM account. The transaction should be serialized as a hex string using [RLP](https://ethereum.org/en/developers/docs/data-structures-and-encoding/rlp/). The transaction must be an [EIP-1559 dynamic fee transaction](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1559.md). The developer is responsible for ensuring that the unsigned transaction is valid, as the API will not validate the transaction. + * @param projectId The ID of the CDP Project. (required) + * @param userId The ID of the end user. (required) + * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) + * @param signEvmTransactionWithEndUserAccountRequest (optional) + * @return SignEvmTransactionWithEndUserAccount200Response + * @throws ApiException if fails to make API call + */ + public SignEvmTransactionWithEndUserAccount200Response signEvmTransactionWithEndUserAccount(String projectId, String userId, String xWalletAuth, String xIdempotencyKey, SignEvmTransactionWithEndUserAccountRequest signEvmTransactionWithEndUserAccountRequest) throws ApiException { + ApiResponse localVarResponse = signEvmTransactionWithEndUserAccountWithHttpInfo(projectId, userId, xWalletAuth, xIdempotencyKey, signEvmTransactionWithEndUserAccountRequest); + return localVarResponse.getData(); + } + + /** + * Sign a transaction with end user EVM account + * Signs a transaction with the given end user EVM account. The transaction should be serialized as a hex string using [RLP](https://ethereum.org/en/developers/docs/data-structures-and-encoding/rlp/). The transaction must be an [EIP-1559 dynamic fee transaction](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1559.md). The developer is responsible for ensuring that the unsigned transaction is valid, as the API will not validate the transaction. + * @param projectId The ID of the CDP Project. (required) + * @param userId The ID of the end user. (required) + * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) + * @param signEvmTransactionWithEndUserAccountRequest (optional) + * @return ApiResponse<SignEvmTransactionWithEndUserAccount200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse signEvmTransactionWithEndUserAccountWithHttpInfo(String projectId, String userId, String xWalletAuth, String xIdempotencyKey, SignEvmTransactionWithEndUserAccountRequest signEvmTransactionWithEndUserAccountRequest) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = signEvmTransactionWithEndUserAccountRequestBuilder(projectId, userId, xWalletAuth, xIdempotencyKey, signEvmTransactionWithEndUserAccountRequest); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("signEvmTransactionWithEndUserAccount", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder signEvmTransactionWithEndUserAccountRequestBuilder(String projectId, String userId, String xWalletAuth, String xIdempotencyKey, SignEvmTransactionWithEndUserAccountRequest signEvmTransactionWithEndUserAccountRequest) throws ApiException { + // verify the required parameter 'projectId' is set + if (projectId == null) { + throw new ApiException(400, "Missing the required parameter 'projectId' when calling signEvmTransactionWithEndUserAccount"); + } + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling signEvmTransactionWithEndUserAccount"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v2/embedded-wallet-api/projects/{projectId}/end-users/{userId}/evm/sign/transaction" + .replace("{projectId}", ApiClient.urlEncode(projectId.toString())) + .replace("{userId}", ApiClient.urlEncode(userId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + if (xWalletAuth != null) { + localVarRequestBuilder.header("X-Wallet-Auth", xWalletAuth.toString()); + } + if (xIdempotencyKey != null) { + localVarRequestBuilder.header("X-Idempotency-Key", xIdempotencyKey.toString()); + } + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(signEvmTransactionWithEndUserAccountRequest); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Sign EIP-712 typed data with end user EVM account + * Signs [EIP-712](https://eips.ethereum.org/EIPS/eip-712) typed data with the given end user EVM account. + * @param projectId The ID of the CDP Project. (required) + * @param userId The ID of the end user. (required) + * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) + * @param signEvmTypedDataWithEndUserAccountRequest (optional) + * @return SignEvmTypedDataWithEndUserAccount200Response + * @throws ApiException if fails to make API call + */ + public SignEvmTypedDataWithEndUserAccount200Response signEvmTypedDataWithEndUserAccount(String projectId, String userId, String xWalletAuth, String xIdempotencyKey, SignEvmTypedDataWithEndUserAccountRequest signEvmTypedDataWithEndUserAccountRequest) throws ApiException { + ApiResponse localVarResponse = signEvmTypedDataWithEndUserAccountWithHttpInfo(projectId, userId, xWalletAuth, xIdempotencyKey, signEvmTypedDataWithEndUserAccountRequest); + return localVarResponse.getData(); + } + + /** + * Sign EIP-712 typed data with end user EVM account + * Signs [EIP-712](https://eips.ethereum.org/EIPS/eip-712) typed data with the given end user EVM account. + * @param projectId The ID of the CDP Project. (required) + * @param userId The ID of the end user. (required) + * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) + * @param signEvmTypedDataWithEndUserAccountRequest (optional) + * @return ApiResponse<SignEvmTypedDataWithEndUserAccount200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse signEvmTypedDataWithEndUserAccountWithHttpInfo(String projectId, String userId, String xWalletAuth, String xIdempotencyKey, SignEvmTypedDataWithEndUserAccountRequest signEvmTypedDataWithEndUserAccountRequest) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = signEvmTypedDataWithEndUserAccountRequestBuilder(projectId, userId, xWalletAuth, xIdempotencyKey, signEvmTypedDataWithEndUserAccountRequest); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("signEvmTypedDataWithEndUserAccount", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder signEvmTypedDataWithEndUserAccountRequestBuilder(String projectId, String userId, String xWalletAuth, String xIdempotencyKey, SignEvmTypedDataWithEndUserAccountRequest signEvmTypedDataWithEndUserAccountRequest) throws ApiException { + // verify the required parameter 'projectId' is set + if (projectId == null) { + throw new ApiException(400, "Missing the required parameter 'projectId' when calling signEvmTypedDataWithEndUserAccount"); + } + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling signEvmTypedDataWithEndUserAccount"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v2/embedded-wallet-api/projects/{projectId}/end-users/{userId}/evm/sign/typed-data" + .replace("{projectId}", ApiClient.urlEncode(projectId.toString())) + .replace("{userId}", ApiClient.urlEncode(userId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + if (xWalletAuth != null) { + localVarRequestBuilder.header("X-Wallet-Auth", xWalletAuth.toString()); + } + if (xIdempotencyKey != null) { + localVarRequestBuilder.header("X-Idempotency-Key", xIdempotencyKey.toString()); + } + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(signEvmTypedDataWithEndUserAccountRequest); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Sign a hash with end user Solana account + * Signs an arbitrary 32 byte hash with the end user's given Solana account. + * @param projectId The ID of the CDP Project. (required) + * @param userId The ID of the end user. (required) + * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) + * @param xDeveloperAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param signSolanaHashWithEndUserAccountRequest (optional) + * @return SignSolanaHashWithEndUserAccount200Response + * @throws ApiException if fails to make API call + */ + public SignSolanaHashWithEndUserAccount200Response signSolanaHashWithEndUserAccount(String projectId, String userId, String xWalletAuth, String xIdempotencyKey, String xDeveloperAuth, SignSolanaHashWithEndUserAccountRequest signSolanaHashWithEndUserAccountRequest) throws ApiException { + ApiResponse localVarResponse = signSolanaHashWithEndUserAccountWithHttpInfo(projectId, userId, xWalletAuth, xIdempotencyKey, xDeveloperAuth, signSolanaHashWithEndUserAccountRequest); + return localVarResponse.getData(); + } + + /** + * Sign a hash with end user Solana account + * Signs an arbitrary 32 byte hash with the end user's given Solana account. + * @param projectId The ID of the CDP Project. (required) + * @param userId The ID of the end user. (required) + * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) + * @param xDeveloperAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param signSolanaHashWithEndUserAccountRequest (optional) + * @return ApiResponse<SignSolanaHashWithEndUserAccount200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse signSolanaHashWithEndUserAccountWithHttpInfo(String projectId, String userId, String xWalletAuth, String xIdempotencyKey, String xDeveloperAuth, SignSolanaHashWithEndUserAccountRequest signSolanaHashWithEndUserAccountRequest) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = signSolanaHashWithEndUserAccountRequestBuilder(projectId, userId, xWalletAuth, xIdempotencyKey, xDeveloperAuth, signSolanaHashWithEndUserAccountRequest); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("signSolanaHashWithEndUserAccount", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder signSolanaHashWithEndUserAccountRequestBuilder(String projectId, String userId, String xWalletAuth, String xIdempotencyKey, String xDeveloperAuth, SignSolanaHashWithEndUserAccountRequest signSolanaHashWithEndUserAccountRequest) throws ApiException { + // verify the required parameter 'projectId' is set + if (projectId == null) { + throw new ApiException(400, "Missing the required parameter 'projectId' when calling signSolanaHashWithEndUserAccount"); + } + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling signSolanaHashWithEndUserAccount"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v2/embedded-wallet-api/projects/{projectId}/end-users/{userId}/solana/sign" + .replace("{projectId}", ApiClient.urlEncode(projectId.toString())) + .replace("{userId}", ApiClient.urlEncode(userId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + if (xWalletAuth != null) { + localVarRequestBuilder.header("X-Wallet-Auth", xWalletAuth.toString()); + } + if (xIdempotencyKey != null) { + localVarRequestBuilder.header("X-Idempotency-Key", xIdempotencyKey.toString()); + } + if (xDeveloperAuth != null) { + localVarRequestBuilder.header("X-Developer-Auth", xDeveloperAuth.toString()); + } + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(signSolanaHashWithEndUserAccountRequest); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Sign a Base64 encoded message + * Signs an arbitrary Base64 encoded message with the given Solana account. **WARNING:** Never sign a message that you didn't generate as it may put your funds at risk. + * @param projectId The ID of the CDP Project. (required) + * @param userId The ID of the end user. (required) + * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) + * @param signSolanaMessageWithEndUserAccountRequest (optional) + * @return SignSolanaMessageWithEndUserAccount200Response + * @throws ApiException if fails to make API call + */ + public SignSolanaMessageWithEndUserAccount200Response signSolanaMessageWithEndUserAccount(String projectId, String userId, String xWalletAuth, String xIdempotencyKey, SignSolanaMessageWithEndUserAccountRequest signSolanaMessageWithEndUserAccountRequest) throws ApiException { + ApiResponse localVarResponse = signSolanaMessageWithEndUserAccountWithHttpInfo(projectId, userId, xWalletAuth, xIdempotencyKey, signSolanaMessageWithEndUserAccountRequest); + return localVarResponse.getData(); + } + + /** + * Sign a Base64 encoded message + * Signs an arbitrary Base64 encoded message with the given Solana account. **WARNING:** Never sign a message that you didn't generate as it may put your funds at risk. + * @param projectId The ID of the CDP Project. (required) + * @param userId The ID of the end user. (required) + * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) + * @param signSolanaMessageWithEndUserAccountRequest (optional) + * @return ApiResponse<SignSolanaMessageWithEndUserAccount200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse signSolanaMessageWithEndUserAccountWithHttpInfo(String projectId, String userId, String xWalletAuth, String xIdempotencyKey, SignSolanaMessageWithEndUserAccountRequest signSolanaMessageWithEndUserAccountRequest) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = signSolanaMessageWithEndUserAccountRequestBuilder(projectId, userId, xWalletAuth, xIdempotencyKey, signSolanaMessageWithEndUserAccountRequest); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("signSolanaMessageWithEndUserAccount", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder signSolanaMessageWithEndUserAccountRequestBuilder(String projectId, String userId, String xWalletAuth, String xIdempotencyKey, SignSolanaMessageWithEndUserAccountRequest signSolanaMessageWithEndUserAccountRequest) throws ApiException { + // verify the required parameter 'projectId' is set + if (projectId == null) { + throw new ApiException(400, "Missing the required parameter 'projectId' when calling signSolanaMessageWithEndUserAccount"); + } + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling signSolanaMessageWithEndUserAccount"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v2/embedded-wallet-api/projects/{projectId}/end-users/{userId}/solana/sign/message" + .replace("{projectId}", ApiClient.urlEncode(projectId.toString())) + .replace("{userId}", ApiClient.urlEncode(userId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + if (xWalletAuth != null) { + localVarRequestBuilder.header("X-Wallet-Auth", xWalletAuth.toString()); + } + if (xIdempotencyKey != null) { + localVarRequestBuilder.header("X-Idempotency-Key", xIdempotencyKey.toString()); + } + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(signSolanaMessageWithEndUserAccountRequest); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Sign a transaction with end user Solana account + * Signs a transaction with the given end user Solana account. The unsigned transaction should be serialized into a byte array and then encoded as base64. **Transaction types** The following transaction types are supported: * [Legacy transactions](https://solana-labs.github.io/solana-web3.js/classes/Transaction.html) * [Versioned transactions](https://solana-labs.github.io/solana-web3.js/classes/VersionedTransaction.html) The developer is responsible for ensuring that the unsigned transaction is valid, as the API will not validate the transaction. + * @param projectId The ID of the CDP Project. (required) + * @param userId The ID of the end user. (required) + * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) + * @param xDeveloperAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param signSolanaTransactionWithEndUserAccountRequest (optional) + * @return SignSolanaTransactionWithEndUserAccount200Response + * @throws ApiException if fails to make API call + */ + public SignSolanaTransactionWithEndUserAccount200Response signSolanaTransactionWithEndUserAccount(String projectId, String userId, String xWalletAuth, String xIdempotencyKey, String xDeveloperAuth, SignSolanaTransactionWithEndUserAccountRequest signSolanaTransactionWithEndUserAccountRequest) throws ApiException { + ApiResponse localVarResponse = signSolanaTransactionWithEndUserAccountWithHttpInfo(projectId, userId, xWalletAuth, xIdempotencyKey, xDeveloperAuth, signSolanaTransactionWithEndUserAccountRequest); + return localVarResponse.getData(); + } + + /** + * Sign a transaction with end user Solana account + * Signs a transaction with the given end user Solana account. The unsigned transaction should be serialized into a byte array and then encoded as base64. **Transaction types** The following transaction types are supported: * [Legacy transactions](https://solana-labs.github.io/solana-web3.js/classes/Transaction.html) * [Versioned transactions](https://solana-labs.github.io/solana-web3.js/classes/VersionedTransaction.html) The developer is responsible for ensuring that the unsigned transaction is valid, as the API will not validate the transaction. + * @param projectId The ID of the CDP Project. (required) + * @param userId The ID of the end user. (required) + * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) + * @param xDeveloperAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) + * @param signSolanaTransactionWithEndUserAccountRequest (optional) + * @return ApiResponse<SignSolanaTransactionWithEndUserAccount200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse signSolanaTransactionWithEndUserAccountWithHttpInfo(String projectId, String userId, String xWalletAuth, String xIdempotencyKey, String xDeveloperAuth, SignSolanaTransactionWithEndUserAccountRequest signSolanaTransactionWithEndUserAccountRequest) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = signSolanaTransactionWithEndUserAccountRequestBuilder(projectId, userId, xWalletAuth, xIdempotencyKey, xDeveloperAuth, signSolanaTransactionWithEndUserAccountRequest); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("signSolanaTransactionWithEndUserAccount", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder signSolanaTransactionWithEndUserAccountRequestBuilder(String projectId, String userId, String xWalletAuth, String xIdempotencyKey, String xDeveloperAuth, SignSolanaTransactionWithEndUserAccountRequest signSolanaTransactionWithEndUserAccountRequest) throws ApiException { + // verify the required parameter 'projectId' is set + if (projectId == null) { + throw new ApiException(400, "Missing the required parameter 'projectId' when calling signSolanaTransactionWithEndUserAccount"); + } + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling signSolanaTransactionWithEndUserAccount"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v2/embedded-wallet-api/projects/{projectId}/end-users/{userId}/solana/sign/transaction" + .replace("{projectId}", ApiClient.urlEncode(projectId.toString())) + .replace("{userId}", ApiClient.urlEncode(userId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + if (xWalletAuth != null) { + localVarRequestBuilder.header("X-Wallet-Auth", xWalletAuth.toString()); + } + if (xIdempotencyKey != null) { + localVarRequestBuilder.header("X-Idempotency-Key", xIdempotencyKey.toString()); + } + if (xDeveloperAuth != null) { + localVarRequestBuilder.header("X-Developer-Auth", xDeveloperAuth.toString()); + } + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(signSolanaTransactionWithEndUserAccountRequest); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + +} diff --git a/java/src/main/java/com/coinbase/cdp/openapi/api/EvmAccountsApi.java b/java/src/main/java/com/coinbase/cdp/openapi/api/EvmAccountsApi.java index 77aa9ba87..ccab947c1 100644 --- a/java/src/main/java/com/coinbase/cdp/openapi/api/EvmAccountsApi.java +++ b/java/src/main/java/com/coinbase/cdp/openapi/api/EvmAccountsApi.java @@ -18,8 +18,8 @@ import com.coinbase.cdp.openapi.Pair; import com.coinbase.cdp.openapi.model.CreateEvmAccountRequest; -import com.coinbase.cdp.openapi.model.CreateEvmEip7702Delegation201Response; import com.coinbase.cdp.openapi.model.CreateEvmEip7702DelegationRequest; +import com.coinbase.cdp.openapi.model.CreateEvmEip7702DelegationWithEndUserAccount201Response; import com.coinbase.cdp.openapi.model.EIP712Message; import com.coinbase.cdp.openapi.model.Error; import com.coinbase.cdp.openapi.model.EvmAccount; @@ -28,15 +28,15 @@ import com.coinbase.cdp.openapi.model.ExportEvmAccountRequest; import com.coinbase.cdp.openapi.model.ImportEvmAccountRequest; import com.coinbase.cdp.openapi.model.ListEvmAccounts200Response; -import com.coinbase.cdp.openapi.model.SendEvmTransaction200Response; import com.coinbase.cdp.openapi.model.SendEvmTransactionRequest; -import com.coinbase.cdp.openapi.model.SignEvmHash200Response; +import com.coinbase.cdp.openapi.model.SendEvmTransactionWithEndUserAccount200Response; import com.coinbase.cdp.openapi.model.SignEvmHashRequest; -import com.coinbase.cdp.openapi.model.SignEvmMessage200Response; +import com.coinbase.cdp.openapi.model.SignEvmHashWithEndUserAccount200Response; import com.coinbase.cdp.openapi.model.SignEvmMessageRequest; -import com.coinbase.cdp.openapi.model.SignEvmTransaction200Response; +import com.coinbase.cdp.openapi.model.SignEvmMessageWithEndUserAccount200Response; import com.coinbase.cdp.openapi.model.SignEvmTransactionRequest; -import com.coinbase.cdp.openapi.model.SignEvmTypedData200Response; +import com.coinbase.cdp.openapi.model.SignEvmTransactionWithEndUserAccount200Response; +import com.coinbase.cdp.openapi.model.SignEvmTypedDataWithEndUserAccount200Response; import java.util.UUID; import com.coinbase.cdp.openapi.model.UpdateEvmAccountRequest; @@ -204,11 +204,11 @@ private HttpRequest.Builder createEvmAccountRequestBuilder(String xWalletAuth, S * @param createEvmEip7702DelegationRequest (required) * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) - * @return CreateEvmEip7702Delegation201Response + * @return CreateEvmEip7702DelegationWithEndUserAccount201Response * @throws ApiException if fails to make API call */ - public CreateEvmEip7702Delegation201Response createEvmEip7702Delegation(String address, CreateEvmEip7702DelegationRequest createEvmEip7702DelegationRequest, String xWalletAuth, String xIdempotencyKey) throws ApiException { - ApiResponse localVarResponse = createEvmEip7702DelegationWithHttpInfo(address, createEvmEip7702DelegationRequest, xWalletAuth, xIdempotencyKey); + public CreateEvmEip7702DelegationWithEndUserAccount201Response createEvmEip7702Delegation(String address, CreateEvmEip7702DelegationRequest createEvmEip7702DelegationRequest, String xWalletAuth, String xIdempotencyKey) throws ApiException { + ApiResponse localVarResponse = createEvmEip7702DelegationWithHttpInfo(address, createEvmEip7702DelegationRequest, xWalletAuth, xIdempotencyKey); return localVarResponse.getData(); } @@ -219,10 +219,10 @@ public CreateEvmEip7702Delegation201Response createEvmEip7702Delegation(String a * @param createEvmEip7702DelegationRequest (required) * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) - * @return ApiResponse<CreateEvmEip7702Delegation201Response> + * @return ApiResponse<CreateEvmEip7702DelegationWithEndUserAccount201Response> * @throws ApiException if fails to make API call */ - public ApiResponse createEvmEip7702DelegationWithHttpInfo(String address, CreateEvmEip7702DelegationRequest createEvmEip7702DelegationRequest, String xWalletAuth, String xIdempotencyKey) throws ApiException { + public ApiResponse createEvmEip7702DelegationWithHttpInfo(String address, CreateEvmEip7702DelegationRequest createEvmEip7702DelegationRequest, String xWalletAuth, String xIdempotencyKey) throws ApiException { HttpRequest.Builder localVarRequestBuilder = createEvmEip7702DelegationRequestBuilder(address, createEvmEip7702DelegationRequest, xWalletAuth, xIdempotencyKey); try { HttpResponse localVarResponse = memberVarHttpClient.send( @@ -236,7 +236,7 @@ public ApiResponse createEvmEip7702Delega throw getApiException("createEvmEip7702Delegation", localVarResponse); } if (localVarResponse.body() == null) { - return new ApiResponse( + return new ApiResponse( localVarResponse.statusCode(), localVarResponse.headers().map(), null @@ -246,10 +246,10 @@ public ApiResponse createEvmEip7702Delega String responseBody = new String(localVarResponse.body().readAllBytes()); localVarResponse.body().close(); - return new ApiResponse( + return new ApiResponse( localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) ); } finally { } @@ -959,11 +959,11 @@ private HttpRequest.Builder listEvmAccountsRequestBuilder(Integer pageSize, Stri * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) * @param sendEvmTransactionRequest (optional) - * @return SendEvmTransaction200Response + * @return SendEvmTransactionWithEndUserAccount200Response * @throws ApiException if fails to make API call */ - public SendEvmTransaction200Response sendEvmTransaction(String address, String xWalletAuth, String xIdempotencyKey, SendEvmTransactionRequest sendEvmTransactionRequest) throws ApiException { - ApiResponse localVarResponse = sendEvmTransactionWithHttpInfo(address, xWalletAuth, xIdempotencyKey, sendEvmTransactionRequest); + public SendEvmTransactionWithEndUserAccount200Response sendEvmTransaction(String address, String xWalletAuth, String xIdempotencyKey, SendEvmTransactionRequest sendEvmTransactionRequest) throws ApiException { + ApiResponse localVarResponse = sendEvmTransactionWithHttpInfo(address, xWalletAuth, xIdempotencyKey, sendEvmTransactionRequest); return localVarResponse.getData(); } @@ -974,10 +974,10 @@ public SendEvmTransaction200Response sendEvmTransaction(String address, String x * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) * @param sendEvmTransactionRequest (optional) - * @return ApiResponse<SendEvmTransaction200Response> + * @return ApiResponse<SendEvmTransactionWithEndUserAccount200Response> * @throws ApiException if fails to make API call */ - public ApiResponse sendEvmTransactionWithHttpInfo(String address, String xWalletAuth, String xIdempotencyKey, SendEvmTransactionRequest sendEvmTransactionRequest) throws ApiException { + public ApiResponse sendEvmTransactionWithHttpInfo(String address, String xWalletAuth, String xIdempotencyKey, SendEvmTransactionRequest sendEvmTransactionRequest) throws ApiException { HttpRequest.Builder localVarRequestBuilder = sendEvmTransactionRequestBuilder(address, xWalletAuth, xIdempotencyKey, sendEvmTransactionRequest); try { HttpResponse localVarResponse = memberVarHttpClient.send( @@ -991,7 +991,7 @@ public ApiResponse sendEvmTransactionWithHttpInfo throw getApiException("sendEvmTransaction", localVarResponse); } if (localVarResponse.body() == null) { - return new ApiResponse( + return new ApiResponse( localVarResponse.statusCode(), localVarResponse.headers().map(), null @@ -1001,10 +1001,10 @@ public ApiResponse sendEvmTransactionWithHttpInfo String responseBody = new String(localVarResponse.body().readAllBytes()); localVarResponse.body().close(); - return new ApiResponse( + return new ApiResponse( localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) ); } finally { } @@ -1061,11 +1061,11 @@ private HttpRequest.Builder sendEvmTransactionRequestBuilder(String address, Str * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) * @param signEvmHashRequest (optional) - * @return SignEvmHash200Response + * @return SignEvmHashWithEndUserAccount200Response * @throws ApiException if fails to make API call */ - public SignEvmHash200Response signEvmHash(String address, String xWalletAuth, String xIdempotencyKey, SignEvmHashRequest signEvmHashRequest) throws ApiException { - ApiResponse localVarResponse = signEvmHashWithHttpInfo(address, xWalletAuth, xIdempotencyKey, signEvmHashRequest); + public SignEvmHashWithEndUserAccount200Response signEvmHash(String address, String xWalletAuth, String xIdempotencyKey, SignEvmHashRequest signEvmHashRequest) throws ApiException { + ApiResponse localVarResponse = signEvmHashWithHttpInfo(address, xWalletAuth, xIdempotencyKey, signEvmHashRequest); return localVarResponse.getData(); } @@ -1076,10 +1076,10 @@ public SignEvmHash200Response signEvmHash(String address, String xWalletAuth, St * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) * @param signEvmHashRequest (optional) - * @return ApiResponse<SignEvmHash200Response> + * @return ApiResponse<SignEvmHashWithEndUserAccount200Response> * @throws ApiException if fails to make API call */ - public ApiResponse signEvmHashWithHttpInfo(String address, String xWalletAuth, String xIdempotencyKey, SignEvmHashRequest signEvmHashRequest) throws ApiException { + public ApiResponse signEvmHashWithHttpInfo(String address, String xWalletAuth, String xIdempotencyKey, SignEvmHashRequest signEvmHashRequest) throws ApiException { HttpRequest.Builder localVarRequestBuilder = signEvmHashRequestBuilder(address, xWalletAuth, xIdempotencyKey, signEvmHashRequest); try { HttpResponse localVarResponse = memberVarHttpClient.send( @@ -1093,7 +1093,7 @@ public ApiResponse signEvmHashWithHttpInfo(String addres throw getApiException("signEvmHash", localVarResponse); } if (localVarResponse.body() == null) { - return new ApiResponse( + return new ApiResponse( localVarResponse.statusCode(), localVarResponse.headers().map(), null @@ -1103,10 +1103,10 @@ public ApiResponse signEvmHashWithHttpInfo(String addres String responseBody = new String(localVarResponse.body().readAllBytes()); localVarResponse.body().close(); - return new ApiResponse( + return new ApiResponse( localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) ); } finally { } @@ -1163,11 +1163,11 @@ private HttpRequest.Builder signEvmHashRequestBuilder(String address, String xWa * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) * @param signEvmMessageRequest (optional) - * @return SignEvmMessage200Response + * @return SignEvmMessageWithEndUserAccount200Response * @throws ApiException if fails to make API call */ - public SignEvmMessage200Response signEvmMessage(String address, String xWalletAuth, String xIdempotencyKey, SignEvmMessageRequest signEvmMessageRequest) throws ApiException { - ApiResponse localVarResponse = signEvmMessageWithHttpInfo(address, xWalletAuth, xIdempotencyKey, signEvmMessageRequest); + public SignEvmMessageWithEndUserAccount200Response signEvmMessage(String address, String xWalletAuth, String xIdempotencyKey, SignEvmMessageRequest signEvmMessageRequest) throws ApiException { + ApiResponse localVarResponse = signEvmMessageWithHttpInfo(address, xWalletAuth, xIdempotencyKey, signEvmMessageRequest); return localVarResponse.getData(); } @@ -1178,10 +1178,10 @@ public SignEvmMessage200Response signEvmMessage(String address, String xWalletAu * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) * @param signEvmMessageRequest (optional) - * @return ApiResponse<SignEvmMessage200Response> + * @return ApiResponse<SignEvmMessageWithEndUserAccount200Response> * @throws ApiException if fails to make API call */ - public ApiResponse signEvmMessageWithHttpInfo(String address, String xWalletAuth, String xIdempotencyKey, SignEvmMessageRequest signEvmMessageRequest) throws ApiException { + public ApiResponse signEvmMessageWithHttpInfo(String address, String xWalletAuth, String xIdempotencyKey, SignEvmMessageRequest signEvmMessageRequest) throws ApiException { HttpRequest.Builder localVarRequestBuilder = signEvmMessageRequestBuilder(address, xWalletAuth, xIdempotencyKey, signEvmMessageRequest); try { HttpResponse localVarResponse = memberVarHttpClient.send( @@ -1195,7 +1195,7 @@ public ApiResponse signEvmMessageWithHttpInfo(String throw getApiException("signEvmMessage", localVarResponse); } if (localVarResponse.body() == null) { - return new ApiResponse( + return new ApiResponse( localVarResponse.statusCode(), localVarResponse.headers().map(), null @@ -1205,10 +1205,10 @@ public ApiResponse signEvmMessageWithHttpInfo(String String responseBody = new String(localVarResponse.body().readAllBytes()); localVarResponse.body().close(); - return new ApiResponse( + return new ApiResponse( localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) ); } finally { } @@ -1265,11 +1265,11 @@ private HttpRequest.Builder signEvmMessageRequestBuilder(String address, String * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) * @param signEvmTransactionRequest (optional) - * @return SignEvmTransaction200Response + * @return SignEvmTransactionWithEndUserAccount200Response * @throws ApiException if fails to make API call */ - public SignEvmTransaction200Response signEvmTransaction(String address, String xWalletAuth, String xIdempotencyKey, SignEvmTransactionRequest signEvmTransactionRequest) throws ApiException { - ApiResponse localVarResponse = signEvmTransactionWithHttpInfo(address, xWalletAuth, xIdempotencyKey, signEvmTransactionRequest); + public SignEvmTransactionWithEndUserAccount200Response signEvmTransaction(String address, String xWalletAuth, String xIdempotencyKey, SignEvmTransactionRequest signEvmTransactionRequest) throws ApiException { + ApiResponse localVarResponse = signEvmTransactionWithHttpInfo(address, xWalletAuth, xIdempotencyKey, signEvmTransactionRequest); return localVarResponse.getData(); } @@ -1280,10 +1280,10 @@ public SignEvmTransaction200Response signEvmTransaction(String address, String x * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) * @param signEvmTransactionRequest (optional) - * @return ApiResponse<SignEvmTransaction200Response> + * @return ApiResponse<SignEvmTransactionWithEndUserAccount200Response> * @throws ApiException if fails to make API call */ - public ApiResponse signEvmTransactionWithHttpInfo(String address, String xWalletAuth, String xIdempotencyKey, SignEvmTransactionRequest signEvmTransactionRequest) throws ApiException { + public ApiResponse signEvmTransactionWithHttpInfo(String address, String xWalletAuth, String xIdempotencyKey, SignEvmTransactionRequest signEvmTransactionRequest) throws ApiException { HttpRequest.Builder localVarRequestBuilder = signEvmTransactionRequestBuilder(address, xWalletAuth, xIdempotencyKey, signEvmTransactionRequest); try { HttpResponse localVarResponse = memberVarHttpClient.send( @@ -1297,7 +1297,7 @@ public ApiResponse signEvmTransactionWithHttpInfo throw getApiException("signEvmTransaction", localVarResponse); } if (localVarResponse.body() == null) { - return new ApiResponse( + return new ApiResponse( localVarResponse.statusCode(), localVarResponse.headers().map(), null @@ -1307,10 +1307,10 @@ public ApiResponse signEvmTransactionWithHttpInfo String responseBody = new String(localVarResponse.body().readAllBytes()); localVarResponse.body().close(); - return new ApiResponse( + return new ApiResponse( localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) ); } finally { } @@ -1367,11 +1367,11 @@ private HttpRequest.Builder signEvmTransactionRequestBuilder(String address, Str * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) * @param eiP712Message (optional) - * @return SignEvmTypedData200Response + * @return SignEvmTypedDataWithEndUserAccount200Response * @throws ApiException if fails to make API call */ - public SignEvmTypedData200Response signEvmTypedData(String address, String xWalletAuth, String xIdempotencyKey, EIP712Message eiP712Message) throws ApiException { - ApiResponse localVarResponse = signEvmTypedDataWithHttpInfo(address, xWalletAuth, xIdempotencyKey, eiP712Message); + public SignEvmTypedDataWithEndUserAccount200Response signEvmTypedData(String address, String xWalletAuth, String xIdempotencyKey, EIP712Message eiP712Message) throws ApiException { + ApiResponse localVarResponse = signEvmTypedDataWithHttpInfo(address, xWalletAuth, xIdempotencyKey, eiP712Message); return localVarResponse.getData(); } @@ -1382,10 +1382,10 @@ public SignEvmTypedData200Response signEvmTypedData(String address, String xWall * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) * @param eiP712Message (optional) - * @return ApiResponse<SignEvmTypedData200Response> + * @return ApiResponse<SignEvmTypedDataWithEndUserAccount200Response> * @throws ApiException if fails to make API call */ - public ApiResponse signEvmTypedDataWithHttpInfo(String address, String xWalletAuth, String xIdempotencyKey, EIP712Message eiP712Message) throws ApiException { + public ApiResponse signEvmTypedDataWithHttpInfo(String address, String xWalletAuth, String xIdempotencyKey, EIP712Message eiP712Message) throws ApiException { HttpRequest.Builder localVarRequestBuilder = signEvmTypedDataRequestBuilder(address, xWalletAuth, xIdempotencyKey, eiP712Message); try { HttpResponse localVarResponse = memberVarHttpClient.send( @@ -1399,7 +1399,7 @@ public ApiResponse signEvmTypedDataWithHttpInfo(Str throw getApiException("signEvmTypedData", localVarResponse); } if (localVarResponse.body() == null) { - return new ApiResponse( + return new ApiResponse( localVarResponse.statusCode(), localVarResponse.headers().map(), null @@ -1409,10 +1409,10 @@ public ApiResponse signEvmTypedDataWithHttpInfo(Str String responseBody = new String(localVarResponse.body().readAllBytes()); localVarResponse.body().close(); - return new ApiResponse( + return new ApiResponse( localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) ); } finally { } diff --git a/java/src/main/java/com/coinbase/cdp/openapi/api/EvmSmartAccountsApi.java b/java/src/main/java/com/coinbase/cdp/openapi/api/EvmSmartAccountsApi.java index 17ca850cd..d89e6e9d4 100644 --- a/java/src/main/java/com/coinbase/cdp/openapi/api/EvmSmartAccountsApi.java +++ b/java/src/main/java/com/coinbase/cdp/openapi/api/EvmSmartAccountsApi.java @@ -21,12 +21,12 @@ import com.coinbase.cdp.openapi.model.CreateSpendPermissionRequest; import com.coinbase.cdp.openapi.model.Error; import com.coinbase.cdp.openapi.model.EvmSmartAccount; +import com.coinbase.cdp.openapi.model.EvmSpendPermissionsRevokeSpendPermissionRequest; import com.coinbase.cdp.openapi.model.EvmUserOperation; import com.coinbase.cdp.openapi.model.ListEvmSmartAccounts200Response; import com.coinbase.cdp.openapi.model.ListSpendPermissions200Response; import com.coinbase.cdp.openapi.model.PrepareAndSendUserOperationRequest; import com.coinbase.cdp.openapi.model.PrepareUserOperationRequest; -import com.coinbase.cdp.openapi.model.RevokeSpendPermissionRequest; import com.coinbase.cdp.openapi.model.SendUserOperationRequest; import com.coinbase.cdp.openapi.model.UpdateEvmSmartAccountRequest; @@ -948,14 +948,14 @@ private HttpRequest.Builder prepareUserOperationRequestBuilder(String address, P * Revoke a spend permission * Revokes an existing spend permission. * @param address The address of the Smart account this spend permission is valid for. (required) - * @param revokeSpendPermissionRequest (required) + * @param evmSpendPermissionsRevokeSpendPermissionRequest (required) * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) * @return EvmUserOperation * @throws ApiException if fails to make API call */ - public EvmUserOperation revokeSpendPermission(String address, RevokeSpendPermissionRequest revokeSpendPermissionRequest, String xWalletAuth, String xIdempotencyKey) throws ApiException { - ApiResponse localVarResponse = revokeSpendPermissionWithHttpInfo(address, revokeSpendPermissionRequest, xWalletAuth, xIdempotencyKey); + public EvmUserOperation revokeSpendPermission(String address, EvmSpendPermissionsRevokeSpendPermissionRequest evmSpendPermissionsRevokeSpendPermissionRequest, String xWalletAuth, String xIdempotencyKey) throws ApiException { + ApiResponse localVarResponse = revokeSpendPermissionWithHttpInfo(address, evmSpendPermissionsRevokeSpendPermissionRequest, xWalletAuth, xIdempotencyKey); return localVarResponse.getData(); } @@ -963,14 +963,14 @@ public EvmUserOperation revokeSpendPermission(String address, RevokeSpendPermiss * Revoke a spend permission * Revokes an existing spend permission. * @param address The address of the Smart account this spend permission is valid for. (required) - * @param revokeSpendPermissionRequest (required) + * @param evmSpendPermissionsRevokeSpendPermissionRequest (required) * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) * @return ApiResponse<EvmUserOperation> * @throws ApiException if fails to make API call */ - public ApiResponse revokeSpendPermissionWithHttpInfo(String address, RevokeSpendPermissionRequest revokeSpendPermissionRequest, String xWalletAuth, String xIdempotencyKey) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = revokeSpendPermissionRequestBuilder(address, revokeSpendPermissionRequest, xWalletAuth, xIdempotencyKey); + public ApiResponse revokeSpendPermissionWithHttpInfo(String address, EvmSpendPermissionsRevokeSpendPermissionRequest evmSpendPermissionsRevokeSpendPermissionRequest, String xWalletAuth, String xIdempotencyKey) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = revokeSpendPermissionRequestBuilder(address, evmSpendPermissionsRevokeSpendPermissionRequest, xWalletAuth, xIdempotencyKey); try { HttpResponse localVarResponse = memberVarHttpClient.send( localVarRequestBuilder.build(), @@ -1009,14 +1009,14 @@ public ApiResponse revokeSpendPermissionWithHttpInfo(String ad } } - private HttpRequest.Builder revokeSpendPermissionRequestBuilder(String address, RevokeSpendPermissionRequest revokeSpendPermissionRequest, String xWalletAuth, String xIdempotencyKey) throws ApiException { + private HttpRequest.Builder revokeSpendPermissionRequestBuilder(String address, EvmSpendPermissionsRevokeSpendPermissionRequest evmSpendPermissionsRevokeSpendPermissionRequest, String xWalletAuth, String xIdempotencyKey) throws ApiException { // verify the required parameter 'address' is set if (address == null) { throw new ApiException(400, "Missing the required parameter 'address' when calling revokeSpendPermission"); } - // verify the required parameter 'revokeSpendPermissionRequest' is set - if (revokeSpendPermissionRequest == null) { - throw new ApiException(400, "Missing the required parameter 'revokeSpendPermissionRequest' when calling revokeSpendPermission"); + // verify the required parameter 'evmSpendPermissionsRevokeSpendPermissionRequest' is set + if (evmSpendPermissionsRevokeSpendPermissionRequest == null) { + throw new ApiException(400, "Missing the required parameter 'evmSpendPermissionsRevokeSpendPermissionRequest' when calling revokeSpendPermission"); } HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -1036,7 +1036,7 @@ private HttpRequest.Builder revokeSpendPermissionRequestBuilder(String address, localVarRequestBuilder.header("Accept", "application/json"); try { - byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(revokeSpendPermissionRequest); + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(evmSpendPermissionsRevokeSpendPermissionRequest); localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); } catch (IOException e) { throw new ApiException(e); diff --git a/java/src/main/java/com/coinbase/cdp/openapi/api/FaucetsApi.java b/java/src/main/java/com/coinbase/cdp/openapi/api/FaucetsApi.java index a150686a5..305996d45 100644 --- a/java/src/main/java/com/coinbase/cdp/openapi/api/FaucetsApi.java +++ b/java/src/main/java/com/coinbase/cdp/openapi/api/FaucetsApi.java @@ -172,7 +172,7 @@ private HttpRequest.Builder requestEvmFaucetRequestBuilder(RequestEvmFaucetReque /** * Request funds on Solana devnet - * Request funds from the CDP Faucet on Solana devnet. Faucets are available for SOL. To prevent abuse, we enforce rate limits within a rolling 24-hour window to control the amount of funds that can be requested. These limits are applied at both the CDP Project level and the blockchain address level. A single blockchain address cannot exceed the specified limits, even if multiple users submit requests to the same address. | Token | Amount per Faucet Request |Rolling 24-hour window Rate Limits| |:-----:|:-------------------------:|:--------------------------------:| | SOL | 0.00125 SOL | 0.0125 SOL | | USDC | 1 USDC | 10 USDC | + * Request funds from the CDP Faucet on Solana devnet. Faucets are available for SOL, USDC, and CBTUSD. To prevent abuse, we enforce rate limits within a rolling 24-hour window to control the amount of funds that can be requested. These limits are applied at both the CDP Project level and the blockchain address level. A single blockchain address cannot exceed the specified limits, even if multiple users submit requests to the same address. | Token | Amount per Faucet Request |Rolling 24-hour window Rate Limits| |:-----: |:-------------------------:|:--------------------------------:| | SOL | 0.00125 SOL | 0.0125 SOL | | USDC | 1 USDC | 10 USDC | | CBTUSD | 1 CBTUSD | 10 CBTUSD | * @param requestSolanaFaucetRequest (optional) * @return RequestSolanaFaucet200Response * @throws ApiException if fails to make API call @@ -184,7 +184,7 @@ public RequestSolanaFaucet200Response requestSolanaFaucet(RequestSolanaFaucetReq /** * Request funds on Solana devnet - * Request funds from the CDP Faucet on Solana devnet. Faucets are available for SOL. To prevent abuse, we enforce rate limits within a rolling 24-hour window to control the amount of funds that can be requested. These limits are applied at both the CDP Project level and the blockchain address level. A single blockchain address cannot exceed the specified limits, even if multiple users submit requests to the same address. | Token | Amount per Faucet Request |Rolling 24-hour window Rate Limits| |:-----:|:-------------------------:|:--------------------------------:| | SOL | 0.00125 SOL | 0.0125 SOL | | USDC | 1 USDC | 10 USDC | + * Request funds from the CDP Faucet on Solana devnet. Faucets are available for SOL, USDC, and CBTUSD. To prevent abuse, we enforce rate limits within a rolling 24-hour window to control the amount of funds that can be requested. These limits are applied at both the CDP Project level and the blockchain address level. A single blockchain address cannot exceed the specified limits, even if multiple users submit requests to the same address. | Token | Amount per Faucet Request |Rolling 24-hour window Rate Limits| |:-----: |:-------------------------:|:--------------------------------:| | SOL | 0.00125 SOL | 0.0125 SOL | | USDC | 1 USDC | 10 USDC | | CBTUSD | 1 CBTUSD | 10 CBTUSD | * @param requestSolanaFaucetRequest (optional) * @return ApiResponse<RequestSolanaFaucet200Response> * @throws ApiException if fails to make API call diff --git a/java/src/main/java/com/coinbase/cdp/openapi/api/SolanaAccountsApi.java b/java/src/main/java/com/coinbase/cdp/openapi/api/SolanaAccountsApi.java index dbd849af9..3ca7dbdd3 100644 --- a/java/src/main/java/com/coinbase/cdp/openapi/api/SolanaAccountsApi.java +++ b/java/src/main/java/com/coinbase/cdp/openapi/api/SolanaAccountsApi.java @@ -23,12 +23,12 @@ import com.coinbase.cdp.openapi.model.ExportSolanaAccount200Response; import com.coinbase.cdp.openapi.model.ImportSolanaAccountRequest; import com.coinbase.cdp.openapi.model.ListSolanaAccounts200Response; -import com.coinbase.cdp.openapi.model.SendSolanaTransaction200Response; import com.coinbase.cdp.openapi.model.SendSolanaTransactionRequest; -import com.coinbase.cdp.openapi.model.SignSolanaMessage200Response; +import com.coinbase.cdp.openapi.model.SendSolanaTransactionWithEndUserAccount200Response; import com.coinbase.cdp.openapi.model.SignSolanaMessageRequest; -import com.coinbase.cdp.openapi.model.SignSolanaTransaction200Response; +import com.coinbase.cdp.openapi.model.SignSolanaMessageWithEndUserAccount200Response; import com.coinbase.cdp.openapi.model.SignSolanaTransactionRequest; +import com.coinbase.cdp.openapi.model.SignSolanaTransactionWithEndUserAccount200Response; import com.coinbase.cdp.openapi.model.SolanaAccount; import com.coinbase.cdp.openapi.model.UpdateSolanaAccountRequest; @@ -760,11 +760,11 @@ private HttpRequest.Builder listSolanaAccountsRequestBuilder(Integer pageSize, S * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) * @param sendSolanaTransactionRequest (optional) - * @return SendSolanaTransaction200Response + * @return SendSolanaTransactionWithEndUserAccount200Response * @throws ApiException if fails to make API call */ - public SendSolanaTransaction200Response sendSolanaTransaction(String xWalletAuth, String xIdempotencyKey, SendSolanaTransactionRequest sendSolanaTransactionRequest) throws ApiException { - ApiResponse localVarResponse = sendSolanaTransactionWithHttpInfo(xWalletAuth, xIdempotencyKey, sendSolanaTransactionRequest); + public SendSolanaTransactionWithEndUserAccount200Response sendSolanaTransaction(String xWalletAuth, String xIdempotencyKey, SendSolanaTransactionRequest sendSolanaTransactionRequest) throws ApiException { + ApiResponse localVarResponse = sendSolanaTransactionWithHttpInfo(xWalletAuth, xIdempotencyKey, sendSolanaTransactionRequest); return localVarResponse.getData(); } @@ -774,10 +774,10 @@ public SendSolanaTransaction200Response sendSolanaTransaction(String xWalletAuth * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) * @param sendSolanaTransactionRequest (optional) - * @return ApiResponse<SendSolanaTransaction200Response> + * @return ApiResponse<SendSolanaTransactionWithEndUserAccount200Response> * @throws ApiException if fails to make API call */ - public ApiResponse sendSolanaTransactionWithHttpInfo(String xWalletAuth, String xIdempotencyKey, SendSolanaTransactionRequest sendSolanaTransactionRequest) throws ApiException { + public ApiResponse sendSolanaTransactionWithHttpInfo(String xWalletAuth, String xIdempotencyKey, SendSolanaTransactionRequest sendSolanaTransactionRequest) throws ApiException { HttpRequest.Builder localVarRequestBuilder = sendSolanaTransactionRequestBuilder(xWalletAuth, xIdempotencyKey, sendSolanaTransactionRequest); try { HttpResponse localVarResponse = memberVarHttpClient.send( @@ -791,7 +791,7 @@ public ApiResponse sendSolanaTransactionWithHt throw getApiException("sendSolanaTransaction", localVarResponse); } if (localVarResponse.body() == null) { - return new ApiResponse( + return new ApiResponse( localVarResponse.statusCode(), localVarResponse.headers().map(), null @@ -801,10 +801,10 @@ public ApiResponse sendSolanaTransactionWithHt String responseBody = new String(localVarResponse.body().readAllBytes()); localVarResponse.body().close(); - return new ApiResponse( + return new ApiResponse( localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) ); } finally { } @@ -856,11 +856,11 @@ private HttpRequest.Builder sendSolanaTransactionRequestBuilder(String xWalletAu * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) * @param signSolanaMessageRequest (optional) - * @return SignSolanaMessage200Response + * @return SignSolanaMessageWithEndUserAccount200Response * @throws ApiException if fails to make API call */ - public SignSolanaMessage200Response signSolanaMessage(String address, String xWalletAuth, String xIdempotencyKey, SignSolanaMessageRequest signSolanaMessageRequest) throws ApiException { - ApiResponse localVarResponse = signSolanaMessageWithHttpInfo(address, xWalletAuth, xIdempotencyKey, signSolanaMessageRequest); + public SignSolanaMessageWithEndUserAccount200Response signSolanaMessage(String address, String xWalletAuth, String xIdempotencyKey, SignSolanaMessageRequest signSolanaMessageRequest) throws ApiException { + ApiResponse localVarResponse = signSolanaMessageWithHttpInfo(address, xWalletAuth, xIdempotencyKey, signSolanaMessageRequest); return localVarResponse.getData(); } @@ -871,10 +871,10 @@ public SignSolanaMessage200Response signSolanaMessage(String address, String xWa * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) * @param signSolanaMessageRequest (optional) - * @return ApiResponse<SignSolanaMessage200Response> + * @return ApiResponse<SignSolanaMessageWithEndUserAccount200Response> * @throws ApiException if fails to make API call */ - public ApiResponse signSolanaMessageWithHttpInfo(String address, String xWalletAuth, String xIdempotencyKey, SignSolanaMessageRequest signSolanaMessageRequest) throws ApiException { + public ApiResponse signSolanaMessageWithHttpInfo(String address, String xWalletAuth, String xIdempotencyKey, SignSolanaMessageRequest signSolanaMessageRequest) throws ApiException { HttpRequest.Builder localVarRequestBuilder = signSolanaMessageRequestBuilder(address, xWalletAuth, xIdempotencyKey, signSolanaMessageRequest); try { HttpResponse localVarResponse = memberVarHttpClient.send( @@ -888,7 +888,7 @@ public ApiResponse signSolanaMessageWithHttpInfo(S throw getApiException("signSolanaMessage", localVarResponse); } if (localVarResponse.body() == null) { - return new ApiResponse( + return new ApiResponse( localVarResponse.statusCode(), localVarResponse.headers().map(), null @@ -898,10 +898,10 @@ public ApiResponse signSolanaMessageWithHttpInfo(S String responseBody = new String(localVarResponse.body().readAllBytes()); localVarResponse.body().close(); - return new ApiResponse( + return new ApiResponse( localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) ); } finally { } @@ -958,11 +958,11 @@ private HttpRequest.Builder signSolanaMessageRequestBuilder(String address, Stri * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) * @param signSolanaTransactionRequest (optional) - * @return SignSolanaTransaction200Response + * @return SignSolanaTransactionWithEndUserAccount200Response * @throws ApiException if fails to make API call */ - public SignSolanaTransaction200Response signSolanaTransaction(String address, String xWalletAuth, String xIdempotencyKey, SignSolanaTransactionRequest signSolanaTransactionRequest) throws ApiException { - ApiResponse localVarResponse = signSolanaTransactionWithHttpInfo(address, xWalletAuth, xIdempotencyKey, signSolanaTransactionRequest); + public SignSolanaTransactionWithEndUserAccount200Response signSolanaTransaction(String address, String xWalletAuth, String xIdempotencyKey, SignSolanaTransactionRequest signSolanaTransactionRequest) throws ApiException { + ApiResponse localVarResponse = signSolanaTransactionWithHttpInfo(address, xWalletAuth, xIdempotencyKey, signSolanaTransactionRequest); return localVarResponse.getData(); } @@ -973,10 +973,10 @@ public SignSolanaTransaction200Response signSolanaTransaction(String address, St * @param xWalletAuth A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. (optional) * @param xIdempotencyKey An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. (optional) * @param signSolanaTransactionRequest (optional) - * @return ApiResponse<SignSolanaTransaction200Response> + * @return ApiResponse<SignSolanaTransactionWithEndUserAccount200Response> * @throws ApiException if fails to make API call */ - public ApiResponse signSolanaTransactionWithHttpInfo(String address, String xWalletAuth, String xIdempotencyKey, SignSolanaTransactionRequest signSolanaTransactionRequest) throws ApiException { + public ApiResponse signSolanaTransactionWithHttpInfo(String address, String xWalletAuth, String xIdempotencyKey, SignSolanaTransactionRequest signSolanaTransactionRequest) throws ApiException { HttpRequest.Builder localVarRequestBuilder = signSolanaTransactionRequestBuilder(address, xWalletAuth, xIdempotencyKey, signSolanaTransactionRequest); try { HttpResponse localVarResponse = memberVarHttpClient.send( @@ -990,7 +990,7 @@ public ApiResponse signSolanaTransactionWithHt throw getApiException("signSolanaTransaction", localVarResponse); } if (localVarResponse.body() == null) { - return new ApiResponse( + return new ApiResponse( localVarResponse.statusCode(), localVarResponse.headers().map(), null @@ -1000,10 +1000,10 @@ public ApiResponse signSolanaTransactionWithHt String responseBody = new String(localVarResponse.body().readAllBytes()); localVarResponse.body().close(); - return new ApiResponse( + return new ApiResponse( localVarResponse.statusCode(), localVarResponse.headers().map(), - responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) ); } finally { } diff --git a/java/src/main/java/com/coinbase/cdp/openapi/api/SqlApiApi.java b/java/src/main/java/com/coinbase/cdp/openapi/api/SqlApiApi.java new file mode 100644 index 000000000..1db4386a0 --- /dev/null +++ b/java/src/main/java/com/coinbase/cdp/openapi/api/SqlApiApi.java @@ -0,0 +1,252 @@ +/* + * Coinbase Developer Platform APIs + * The Coinbase Developer Platform APIs - leading the world's transition onchain. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: cdp@coinbase.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.coinbase.cdp.openapi.api; + +import com.coinbase.cdp.openapi.ApiClient; +import com.coinbase.cdp.openapi.ApiException; +import com.coinbase.cdp.openapi.ApiResponse; +import com.coinbase.cdp.openapi.Pair; + +import com.coinbase.cdp.openapi.model.Error; +import com.coinbase.cdp.openapi.model.OnchainDataQuery; +import com.coinbase.cdp.openapi.model.OnchainDataResult; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +import java.io.InputStream; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.OutputStream; +import java.net.http.HttpRequest; +import java.nio.channels.Channels; +import java.nio.channels.Pipe; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; + +import java.util.ArrayList; +import java.util.StringJoiner; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.function.Consumer; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class SqlApiApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public SqlApiApi() { + this(new ApiClient()); + } + + public SqlApiApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Get SQL grammar + * Retrieve the SQL grammar for the SQL API. The SQL queries that are supported by the SQL API are defined in ANTLR4 grammar which is evaluated by server before executing the query. This ensures the safety and soundness of the SQL query before execution. This endpoint returns the ANTLR4 grammar that is used to evaluate the SQL queries so that developers can understand the SQL API and build SQL queries with high confidence and correctness. LLMs interact well with ANTLR4 grammar. You can feed the grammar directly into the LLMs to help generate SQL queries. + * @return String + * @throws ApiException if fails to make API call + */ + public String getSQLGrammar() throws ApiException { + ApiResponse localVarResponse = getSQLGrammarWithHttpInfo(); + return localVarResponse.getData(); + } + + /** + * Get SQL grammar + * Retrieve the SQL grammar for the SQL API. The SQL queries that are supported by the SQL API are defined in ANTLR4 grammar which is evaluated by server before executing the query. This ensures the safety and soundness of the SQL query before execution. This endpoint returns the ANTLR4 grammar that is used to evaluate the SQL queries so that developers can understand the SQL API and build SQL queries with high confidence and correctness. LLMs interact well with ANTLR4 grammar. You can feed the grammar directly into the LLMs to help generate SQL queries. + * @return ApiResponse<String> + * @throws ApiException if fails to make API call + */ + public ApiResponse getSQLGrammarWithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getSQLGrammarRequestBuilder(); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("getSQLGrammar", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getSQLGrammarRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v2/data/query/grammar"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Run SQL Query + * Run a read-only SQL query against indexed blockchain data including transactions, events, and decoded logs. This endpoint provides direct SQL access to comprehensive blockchain data across supported networks. Queries are executed against optimized data structures for high-performance analytics. ### Allowed Queries - Standard SQL syntax (CoinbaSeQL dialect, based on ClickHouse dialect) - Read-only queries (SELECT statements) - No DDL or DML operations - Query that follow limits (defined below) ### Supported Tables - `<network>.events` - Base mainnet decoded event logs with parameters, event signature, topics, and more. - `<network>.transactions` - Base mainnet transaction data including hash, block number, gas usage. - `<network>.blocks` - Base mainnet block information. - `<network>.encoded_logs` - Encoded log data of event logs that aren't able to be decoded by our event decoder (ex: log0 opcode). - `<network>.decoded_user_operations` - Decoded user operations data including hash, block number, gas usage, builder codes, entrypoint version, and more. - `<network>.transaction_attributions` - Information about the attributions of a transaction to a builder and associated builder codes. ### Supported Networks - Base Mainnet: `base` - Base Sepolia: `base_sepolia` So for example, valid tables are: `base.events`, `base_sepolia.events`, `base.transactions`, etc. ### Query Limits - Maximum result set: 50,000 rows - Maximum query length: 10,000 characters - Maximum on-disk data to read: 100GB - Maximum memory usage: 15GB - Query timeout: 30 seconds - Maximum JOINs: 12 ### Query Caching By default, each query result is returned from cache so long as the result is from an identical query and less than 750ms old. This freshness tolerance can be modified upwards, to a maximum of 900000ms (i.e. 900s, 15m). This can be helpful for users who wish to reduce expensive calls to the SQL API by reusing cached results. + * @param onchainDataQuery (required) + * @return OnchainDataResult + * @throws ApiException if fails to make API call + */ + public OnchainDataResult runSQLQuery(OnchainDataQuery onchainDataQuery) throws ApiException { + ApiResponse localVarResponse = runSQLQueryWithHttpInfo(onchainDataQuery); + return localVarResponse.getData(); + } + + /** + * Run SQL Query + * Run a read-only SQL query against indexed blockchain data including transactions, events, and decoded logs. This endpoint provides direct SQL access to comprehensive blockchain data across supported networks. Queries are executed against optimized data structures for high-performance analytics. ### Allowed Queries - Standard SQL syntax (CoinbaSeQL dialect, based on ClickHouse dialect) - Read-only queries (SELECT statements) - No DDL or DML operations - Query that follow limits (defined below) ### Supported Tables - `<network>.events` - Base mainnet decoded event logs with parameters, event signature, topics, and more. - `<network>.transactions` - Base mainnet transaction data including hash, block number, gas usage. - `<network>.blocks` - Base mainnet block information. - `<network>.encoded_logs` - Encoded log data of event logs that aren't able to be decoded by our event decoder (ex: log0 opcode). - `<network>.decoded_user_operations` - Decoded user operations data including hash, block number, gas usage, builder codes, entrypoint version, and more. - `<network>.transaction_attributions` - Information about the attributions of a transaction to a builder and associated builder codes. ### Supported Networks - Base Mainnet: `base` - Base Sepolia: `base_sepolia` So for example, valid tables are: `base.events`, `base_sepolia.events`, `base.transactions`, etc. ### Query Limits - Maximum result set: 50,000 rows - Maximum query length: 10,000 characters - Maximum on-disk data to read: 100GB - Maximum memory usage: 15GB - Query timeout: 30 seconds - Maximum JOINs: 12 ### Query Caching By default, each query result is returned from cache so long as the result is from an identical query and less than 750ms old. This freshness tolerance can be modified upwards, to a maximum of 900000ms (i.e. 900s, 15m). This can be helpful for users who wish to reduce expensive calls to the SQL API by reusing cached results. + * @param onchainDataQuery (required) + * @return ApiResponse<OnchainDataResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse runSQLQueryWithHttpInfo(OnchainDataQuery onchainDataQuery) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = runSQLQueryRequestBuilder(onchainDataQuery); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("runSQLQuery", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder runSQLQueryRequestBuilder(OnchainDataQuery onchainDataQuery) throws ApiException { + // verify the required parameter 'onchainDataQuery' is set + if (onchainDataQuery == null) { + throw new ApiException(400, "Missing the required parameter 'onchainDataQuery' when calling runSQLQuery"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/v2/data/query/run"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(onchainDataQuery); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + +} diff --git a/java/src/main/java/com/coinbase/cdp/openapi/model/CreateDelegationForEndUser201Response.java b/java/src/main/java/com/coinbase/cdp/openapi/model/CreateDelegationForEndUser201Response.java new file mode 100644 index 000000000..b38d92574 --- /dev/null +++ b/java/src/main/java/com/coinbase/cdp/openapi/model/CreateDelegationForEndUser201Response.java @@ -0,0 +1,206 @@ +/* + * Coinbase Developer Platform APIs + * The Coinbase Developer Platform APIs - leading the world's transition onchain. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: cdp@coinbase.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.coinbase.cdp.openapi.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.coinbase.cdp.openapi.ApiClient; +/** + * CreateDelegationForEndUser201Response + */ +@JsonPropertyOrder({ + CreateDelegationForEndUser201Response.JSON_PROPERTY_DELEGATION_ID +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class CreateDelegationForEndUser201Response { + public static final String JSON_PROPERTY_DELEGATION_ID = "delegationId"; + @jakarta.annotation.Nonnull + private UUID delegationId; + + public CreateDelegationForEndUser201Response() { + } + + public CreateDelegationForEndUser201Response delegationId(@jakarta.annotation.Nonnull UUID delegationId) { + this.delegationId = delegationId; + return this; + } + + /** + * The unique identifier for the delegation. + * @return delegationId + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_DELEGATION_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UUID getDelegationId() { + return delegationId; + } + + + @JsonProperty(JSON_PROPERTY_DELEGATION_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setDelegationId(@jakarta.annotation.Nonnull UUID delegationId) { + this.delegationId = delegationId; + } + + + /** + * Return true if this createDelegationForEndUser_201_response object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateDelegationForEndUser201Response createDelegationForEndUser201Response = (CreateDelegationForEndUser201Response) o; + return Objects.equals(this.delegationId, createDelegationForEndUser201Response.delegationId); + } + + @Override + public int hashCode() { + return Objects.hash(delegationId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateDelegationForEndUser201Response {\n"); + sb.append(" delegationId: ").append(toIndentedString(delegationId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `delegationId` to the URL query string + if (getDelegationId() != null) { + joiner.add(String.format("%sdelegationId%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getDelegationId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } + + public static class Builder { + + private CreateDelegationForEndUser201Response instance; + + public Builder() { + this(new CreateDelegationForEndUser201Response()); + } + + protected Builder(CreateDelegationForEndUser201Response instance) { + this.instance = instance; + } + + public CreateDelegationForEndUser201Response.Builder delegationId(UUID delegationId) { + this.instance.delegationId = delegationId; + return this; + } + + + /** + * returns a built CreateDelegationForEndUser201Response instance. + * + * The builder is not reusable. + */ + public CreateDelegationForEndUser201Response build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static CreateDelegationForEndUser201Response.Builder builder() { + return new CreateDelegationForEndUser201Response.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public CreateDelegationForEndUser201Response.Builder toBuilder() { + return new CreateDelegationForEndUser201Response.Builder() + .delegationId(getDelegationId()); + } + +} + diff --git a/java/src/main/java/com/coinbase/cdp/openapi/model/CreateDelegationForEndUserRequest.java b/java/src/main/java/com/coinbase/cdp/openapi/model/CreateDelegationForEndUserRequest.java new file mode 100644 index 000000000..bd8d535a8 --- /dev/null +++ b/java/src/main/java/com/coinbase/cdp/openapi/model/CreateDelegationForEndUserRequest.java @@ -0,0 +1,247 @@ +/* + * Coinbase Developer Platform APIs + * The Coinbase Developer Platform APIs - leading the world's transition onchain. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: cdp@coinbase.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.coinbase.cdp.openapi.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.time.OffsetDateTime; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.coinbase.cdp.openapi.ApiClient; +/** + * CreateDelegationForEndUserRequest + */ +@JsonPropertyOrder({ + CreateDelegationForEndUserRequest.JSON_PROPERTY_EXPIRES_AT, + CreateDelegationForEndUserRequest.JSON_PROPERTY_WALLET_SECRET_ID +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class CreateDelegationForEndUserRequest { + public static final String JSON_PROPERTY_EXPIRES_AT = "expiresAt"; + @jakarta.annotation.Nonnull + private OffsetDateTime expiresAt; + + public static final String JSON_PROPERTY_WALLET_SECRET_ID = "walletSecretId"; + @jakarta.annotation.Nonnull + private String walletSecretId; + + public CreateDelegationForEndUserRequest() { + } + + public CreateDelegationForEndUserRequest expiresAt(@jakarta.annotation.Nonnull OffsetDateTime expiresAt) { + this.expiresAt = expiresAt; + return this; + } + + /** + * The date until which the delegation is valid. + * @return expiresAt + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getExpiresAt() { + return expiresAt; + } + + + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setExpiresAt(@jakarta.annotation.Nonnull OffsetDateTime expiresAt) { + this.expiresAt = expiresAt; + } + + + public CreateDelegationForEndUserRequest walletSecretId(@jakarta.annotation.Nonnull String walletSecretId) { + this.walletSecretId = walletSecretId; + return this; + } + + /** + * The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header. + * @return walletSecretId + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_WALLET_SECRET_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getWalletSecretId() { + return walletSecretId; + } + + + @JsonProperty(JSON_PROPERTY_WALLET_SECRET_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setWalletSecretId(@jakarta.annotation.Nonnull String walletSecretId) { + this.walletSecretId = walletSecretId; + } + + + /** + * Return true if this createDelegationForEndUser_request object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateDelegationForEndUserRequest createDelegationForEndUserRequest = (CreateDelegationForEndUserRequest) o; + return Objects.equals(this.expiresAt, createDelegationForEndUserRequest.expiresAt) && + Objects.equals(this.walletSecretId, createDelegationForEndUserRequest.walletSecretId); + } + + @Override + public int hashCode() { + return Objects.hash(expiresAt, walletSecretId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateDelegationForEndUserRequest {\n"); + sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); + sb.append(" walletSecretId: ").append(toIndentedString(walletSecretId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `expiresAt` to the URL query string + if (getExpiresAt() != null) { + joiner.add(String.format("%sexpiresAt%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getExpiresAt()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `walletSecretId` to the URL query string + if (getWalletSecretId() != null) { + joiner.add(String.format("%swalletSecretId%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getWalletSecretId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } + + public static class Builder { + + private CreateDelegationForEndUserRequest instance; + + public Builder() { + this(new CreateDelegationForEndUserRequest()); + } + + protected Builder(CreateDelegationForEndUserRequest instance) { + this.instance = instance; + } + + public CreateDelegationForEndUserRequest.Builder expiresAt(OffsetDateTime expiresAt) { + this.instance.expiresAt = expiresAt; + return this; + } + public CreateDelegationForEndUserRequest.Builder walletSecretId(String walletSecretId) { + this.instance.walletSecretId = walletSecretId; + return this; + } + + + /** + * returns a built CreateDelegationForEndUserRequest instance. + * + * The builder is not reusable. + */ + public CreateDelegationForEndUserRequest build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static CreateDelegationForEndUserRequest.Builder builder() { + return new CreateDelegationForEndUserRequest.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public CreateDelegationForEndUserRequest.Builder toBuilder() { + return new CreateDelegationForEndUserRequest.Builder() + .expiresAt(getExpiresAt()) + .walletSecretId(getWalletSecretId()); + } + +} + diff --git a/java/src/main/java/com/coinbase/cdp/openapi/model/CreateEvmEip7702DelegationWithEndUserAccount201Response.java b/java/src/main/java/com/coinbase/cdp/openapi/model/CreateEvmEip7702DelegationWithEndUserAccount201Response.java new file mode 100644 index 000000000..7278db8ca --- /dev/null +++ b/java/src/main/java/com/coinbase/cdp/openapi/model/CreateEvmEip7702DelegationWithEndUserAccount201Response.java @@ -0,0 +1,206 @@ +/* + * Coinbase Developer Platform APIs + * The Coinbase Developer Platform APIs - leading the world's transition onchain. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: cdp@coinbase.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.coinbase.cdp.openapi.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.coinbase.cdp.openapi.ApiClient; +/** + * CreateEvmEip7702DelegationWithEndUserAccount201Response + */ +@JsonPropertyOrder({ + CreateEvmEip7702DelegationWithEndUserAccount201Response.JSON_PROPERTY_DELEGATION_OPERATION_ID +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class CreateEvmEip7702DelegationWithEndUserAccount201Response { + public static final String JSON_PROPERTY_DELEGATION_OPERATION_ID = "delegationOperationId"; + @jakarta.annotation.Nonnull + private UUID delegationOperationId; + + public CreateEvmEip7702DelegationWithEndUserAccount201Response() { + } + + public CreateEvmEip7702DelegationWithEndUserAccount201Response delegationOperationId(@jakarta.annotation.Nonnull UUID delegationOperationId) { + this.delegationOperationId = delegationOperationId; + return this; + } + + /** + * The unique identifier for the delegation operation. Use this to poll the operation status. + * @return delegationOperationId + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_DELEGATION_OPERATION_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UUID getDelegationOperationId() { + return delegationOperationId; + } + + + @JsonProperty(JSON_PROPERTY_DELEGATION_OPERATION_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setDelegationOperationId(@jakarta.annotation.Nonnull UUID delegationOperationId) { + this.delegationOperationId = delegationOperationId; + } + + + /** + * Return true if this createEvmEip7702DelegationWithEndUserAccount_201_response object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateEvmEip7702DelegationWithEndUserAccount201Response createEvmEip7702DelegationWithEndUserAccount201Response = (CreateEvmEip7702DelegationWithEndUserAccount201Response) o; + return Objects.equals(this.delegationOperationId, createEvmEip7702DelegationWithEndUserAccount201Response.delegationOperationId); + } + + @Override + public int hashCode() { + return Objects.hash(delegationOperationId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateEvmEip7702DelegationWithEndUserAccount201Response {\n"); + sb.append(" delegationOperationId: ").append(toIndentedString(delegationOperationId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `delegationOperationId` to the URL query string + if (getDelegationOperationId() != null) { + joiner.add(String.format("%sdelegationOperationId%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getDelegationOperationId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } + + public static class Builder { + + private CreateEvmEip7702DelegationWithEndUserAccount201Response instance; + + public Builder() { + this(new CreateEvmEip7702DelegationWithEndUserAccount201Response()); + } + + protected Builder(CreateEvmEip7702DelegationWithEndUserAccount201Response instance) { + this.instance = instance; + } + + public CreateEvmEip7702DelegationWithEndUserAccount201Response.Builder delegationOperationId(UUID delegationOperationId) { + this.instance.delegationOperationId = delegationOperationId; + return this; + } + + + /** + * returns a built CreateEvmEip7702DelegationWithEndUserAccount201Response instance. + * + * The builder is not reusable. + */ + public CreateEvmEip7702DelegationWithEndUserAccount201Response build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static CreateEvmEip7702DelegationWithEndUserAccount201Response.Builder builder() { + return new CreateEvmEip7702DelegationWithEndUserAccount201Response.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public CreateEvmEip7702DelegationWithEndUserAccount201Response.Builder toBuilder() { + return new CreateEvmEip7702DelegationWithEndUserAccount201Response.Builder() + .delegationOperationId(getDelegationOperationId()); + } + +} + diff --git a/java/src/main/java/com/coinbase/cdp/openapi/model/CreateEvmEip7702DelegationWithEndUserAccountRequest.java b/java/src/main/java/com/coinbase/cdp/openapi/model/CreateEvmEip7702DelegationWithEndUserAccountRequest.java new file mode 100644 index 000000000..c93958b5b --- /dev/null +++ b/java/src/main/java/com/coinbase/cdp/openapi/model/CreateEvmEip7702DelegationWithEndUserAccountRequest.java @@ -0,0 +1,329 @@ +/* + * Coinbase Developer Platform APIs + * The Coinbase Developer Platform APIs - leading the world's transition onchain. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: cdp@coinbase.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.coinbase.cdp.openapi.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.coinbase.cdp.openapi.model.EvmEip7702DelegationNetwork; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.coinbase.cdp.openapi.ApiClient; +/** + * CreateEvmEip7702DelegationWithEndUserAccountRequest + */ +@JsonPropertyOrder({ + CreateEvmEip7702DelegationWithEndUserAccountRequest.JSON_PROPERTY_ADDRESS, + CreateEvmEip7702DelegationWithEndUserAccountRequest.JSON_PROPERTY_NETWORK, + CreateEvmEip7702DelegationWithEndUserAccountRequest.JSON_PROPERTY_ENABLE_SPEND_PERMISSIONS, + CreateEvmEip7702DelegationWithEndUserAccountRequest.JSON_PROPERTY_WALLET_SECRET_ID +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class CreateEvmEip7702DelegationWithEndUserAccountRequest { + public static final String JSON_PROPERTY_ADDRESS = "address"; + @jakarta.annotation.Nonnull + private String address; + + public static final String JSON_PROPERTY_NETWORK = "network"; + @jakarta.annotation.Nonnull + private EvmEip7702DelegationNetwork network; + + public static final String JSON_PROPERTY_ENABLE_SPEND_PERMISSIONS = "enableSpendPermissions"; + @jakarta.annotation.Nullable + private Boolean enableSpendPermissions = false; + + public static final String JSON_PROPERTY_WALLET_SECRET_ID = "walletSecretId"; + @jakarta.annotation.Nullable + private String walletSecretId; + + public CreateEvmEip7702DelegationWithEndUserAccountRequest() { + } + + public CreateEvmEip7702DelegationWithEndUserAccountRequest address(@jakarta.annotation.Nonnull String address) { + this.address = address; + return this; + } + + /** + * The 0x-prefixed address of the EVM account to delegate. + * @return address + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getAddress() { + return address; + } + + + @JsonProperty(JSON_PROPERTY_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setAddress(@jakarta.annotation.Nonnull String address) { + this.address = address; + } + + + public CreateEvmEip7702DelegationWithEndUserAccountRequest network(@jakarta.annotation.Nonnull EvmEip7702DelegationNetwork network) { + this.network = network; + return this; + } + + /** + * Get network + * @return network + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NETWORK) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public EvmEip7702DelegationNetwork getNetwork() { + return network; + } + + + @JsonProperty(JSON_PROPERTY_NETWORK) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setNetwork(@jakarta.annotation.Nonnull EvmEip7702DelegationNetwork network) { + this.network = network; + } + + + public CreateEvmEip7702DelegationWithEndUserAccountRequest enableSpendPermissions(@jakarta.annotation.Nullable Boolean enableSpendPermissions) { + this.enableSpendPermissions = enableSpendPermissions; + return this; + } + + /** + * Whether to configure spend permissions for the upgraded, delegated account. When enabled, the account can grant permissions for third parties to spend on its behalf. + * @return enableSpendPermissions + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENABLE_SPEND_PERMISSIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnableSpendPermissions() { + return enableSpendPermissions; + } + + + @JsonProperty(JSON_PROPERTY_ENABLE_SPEND_PERMISSIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableSpendPermissions(@jakarta.annotation.Nullable Boolean enableSpendPermissions) { + this.enableSpendPermissions = enableSpendPermissions; + } + + + public CreateEvmEip7702DelegationWithEndUserAccountRequest walletSecretId(@jakarta.annotation.Nullable String walletSecretId) { + this.walletSecretId = walletSecretId; + return this; + } + + /** + * Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header. + * @return walletSecretId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WALLET_SECRET_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getWalletSecretId() { + return walletSecretId; + } + + + @JsonProperty(JSON_PROPERTY_WALLET_SECRET_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWalletSecretId(@jakarta.annotation.Nullable String walletSecretId) { + this.walletSecretId = walletSecretId; + } + + + /** + * Return true if this createEvmEip7702DelegationWithEndUserAccount_request object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateEvmEip7702DelegationWithEndUserAccountRequest createEvmEip7702DelegationWithEndUserAccountRequest = (CreateEvmEip7702DelegationWithEndUserAccountRequest) o; + return Objects.equals(this.address, createEvmEip7702DelegationWithEndUserAccountRequest.address) && + Objects.equals(this.network, createEvmEip7702DelegationWithEndUserAccountRequest.network) && + Objects.equals(this.enableSpendPermissions, createEvmEip7702DelegationWithEndUserAccountRequest.enableSpendPermissions) && + Objects.equals(this.walletSecretId, createEvmEip7702DelegationWithEndUserAccountRequest.walletSecretId); + } + + @Override + public int hashCode() { + return Objects.hash(address, network, enableSpendPermissions, walletSecretId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateEvmEip7702DelegationWithEndUserAccountRequest {\n"); + sb.append(" address: ").append(toIndentedString(address)).append("\n"); + sb.append(" network: ").append(toIndentedString(network)).append("\n"); + sb.append(" enableSpendPermissions: ").append(toIndentedString(enableSpendPermissions)).append("\n"); + sb.append(" walletSecretId: ").append(toIndentedString(walletSecretId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `address` to the URL query string + if (getAddress() != null) { + joiner.add(String.format("%saddress%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getAddress()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `network` to the URL query string + if (getNetwork() != null) { + joiner.add(String.format("%snetwork%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getNetwork()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `enableSpendPermissions` to the URL query string + if (getEnableSpendPermissions() != null) { + joiner.add(String.format("%senableSpendPermissions%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getEnableSpendPermissions()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `walletSecretId` to the URL query string + if (getWalletSecretId() != null) { + joiner.add(String.format("%swalletSecretId%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getWalletSecretId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } + + public static class Builder { + + private CreateEvmEip7702DelegationWithEndUserAccountRequest instance; + + public Builder() { + this(new CreateEvmEip7702DelegationWithEndUserAccountRequest()); + } + + protected Builder(CreateEvmEip7702DelegationWithEndUserAccountRequest instance) { + this.instance = instance; + } + + public CreateEvmEip7702DelegationWithEndUserAccountRequest.Builder address(String address) { + this.instance.address = address; + return this; + } + public CreateEvmEip7702DelegationWithEndUserAccountRequest.Builder network(EvmEip7702DelegationNetwork network) { + this.instance.network = network; + return this; + } + public CreateEvmEip7702DelegationWithEndUserAccountRequest.Builder enableSpendPermissions(Boolean enableSpendPermissions) { + this.instance.enableSpendPermissions = enableSpendPermissions; + return this; + } + public CreateEvmEip7702DelegationWithEndUserAccountRequest.Builder walletSecretId(String walletSecretId) { + this.instance.walletSecretId = walletSecretId; + return this; + } + + + /** + * returns a built CreateEvmEip7702DelegationWithEndUserAccountRequest instance. + * + * The builder is not reusable. + */ + public CreateEvmEip7702DelegationWithEndUserAccountRequest build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static CreateEvmEip7702DelegationWithEndUserAccountRequest.Builder builder() { + return new CreateEvmEip7702DelegationWithEndUserAccountRequest.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public CreateEvmEip7702DelegationWithEndUserAccountRequest.Builder toBuilder() { + return new CreateEvmEip7702DelegationWithEndUserAccountRequest.Builder() + .address(getAddress()) + .network(getNetwork()) + .enableSpendPermissions(getEnableSpendPermissions()) + .walletSecretId(getWalletSecretId()); + } + +} + diff --git a/java/src/main/java/com/coinbase/cdp/openapi/model/ErrorType.java b/java/src/main/java/com/coinbase/cdp/openapi/model/ErrorType.java index b928195b1..8cb35b875 100644 --- a/java/src/main/java/com/coinbase/cdp/openapi/model/ErrorType.java +++ b/java/src/main/java/com/coinbase/cdp/openapi/model/ErrorType.java @@ -144,7 +144,13 @@ public enum ErrorType { ORDER_ALREADY_CANCELED("order_already_canceled"), - ACCOUNT_NOT_READY("account_not_ready"); + ACCOUNT_NOT_READY("account_not_ready"), + + INSUFFICIENT_LIQUIDITY("insufficient_liquidity"), + + INSUFFICIENT_ALLOWANCE("insufficient_allowance"), + + TRANSACTION_SIMULATION_FAILED("transaction_simulation_failed"); private String value; diff --git a/java/src/main/java/com/coinbase/cdp/openapi/model/EvmSpendPermissionsRevokeSpendPermissionRequest.java b/java/src/main/java/com/coinbase/cdp/openapi/model/EvmSpendPermissionsRevokeSpendPermissionRequest.java new file mode 100644 index 000000000..fe57bd90d --- /dev/null +++ b/java/src/main/java/com/coinbase/cdp/openapi/model/EvmSpendPermissionsRevokeSpendPermissionRequest.java @@ -0,0 +1,289 @@ +/* + * Coinbase Developer Platform APIs + * The Coinbase Developer Platform APIs - leading the world's transition onchain. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: cdp@coinbase.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.coinbase.cdp.openapi.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.coinbase.cdp.openapi.model.SpendPermissionNetwork; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.net.URI; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.coinbase.cdp.openapi.ApiClient; +/** + * Request parameters for revoking a Spend Permission. + */ +@JsonPropertyOrder({ + EvmSpendPermissionsRevokeSpendPermissionRequest.JSON_PROPERTY_NETWORK, + EvmSpendPermissionsRevokeSpendPermissionRequest.JSON_PROPERTY_PERMISSION_HASH, + EvmSpendPermissionsRevokeSpendPermissionRequest.JSON_PROPERTY_PAYMASTER_URL +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class EvmSpendPermissionsRevokeSpendPermissionRequest { + public static final String JSON_PROPERTY_NETWORK = "network"; + @jakarta.annotation.Nonnull + private SpendPermissionNetwork network; + + public static final String JSON_PROPERTY_PERMISSION_HASH = "permissionHash"; + @jakarta.annotation.Nonnull + private String permissionHash; + + public static final String JSON_PROPERTY_PAYMASTER_URL = "paymasterUrl"; + @jakarta.annotation.Nullable + private URI paymasterUrl; + + public EvmSpendPermissionsRevokeSpendPermissionRequest() { + } + + public EvmSpendPermissionsRevokeSpendPermissionRequest network(@jakarta.annotation.Nonnull SpendPermissionNetwork network) { + this.network = network; + return this; + } + + /** + * Get network + * @return network + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NETWORK) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SpendPermissionNetwork getNetwork() { + return network; + } + + + @JsonProperty(JSON_PROPERTY_NETWORK) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setNetwork(@jakarta.annotation.Nonnull SpendPermissionNetwork network) { + this.network = network; + } + + + public EvmSpendPermissionsRevokeSpendPermissionRequest permissionHash(@jakarta.annotation.Nonnull String permissionHash) { + this.permissionHash = permissionHash; + return this; + } + + /** + * The hash of the spend permission to revoke. + * @return permissionHash + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_PERMISSION_HASH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getPermissionHash() { + return permissionHash; + } + + + @JsonProperty(JSON_PROPERTY_PERMISSION_HASH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setPermissionHash(@jakarta.annotation.Nonnull String permissionHash) { + this.permissionHash = permissionHash; + } + + + public EvmSpendPermissionsRevokeSpendPermissionRequest paymasterUrl(@jakarta.annotation.Nullable URI paymasterUrl) { + this.paymasterUrl = paymasterUrl; + return this; + } + + /** + * The paymaster URL of the spend permission. + * @return paymasterUrl + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PAYMASTER_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public URI getPaymasterUrl() { + return paymasterUrl; + } + + + @JsonProperty(JSON_PROPERTY_PAYMASTER_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPaymasterUrl(@jakarta.annotation.Nullable URI paymasterUrl) { + this.paymasterUrl = paymasterUrl; + } + + + /** + * Return true if this evm-spend-permissions_RevokeSpendPermissionRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EvmSpendPermissionsRevokeSpendPermissionRequest evmSpendPermissionsRevokeSpendPermissionRequest = (EvmSpendPermissionsRevokeSpendPermissionRequest) o; + return Objects.equals(this.network, evmSpendPermissionsRevokeSpendPermissionRequest.network) && + Objects.equals(this.permissionHash, evmSpendPermissionsRevokeSpendPermissionRequest.permissionHash) && + Objects.equals(this.paymasterUrl, evmSpendPermissionsRevokeSpendPermissionRequest.paymasterUrl); + } + + @Override + public int hashCode() { + return Objects.hash(network, permissionHash, paymasterUrl); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EvmSpendPermissionsRevokeSpendPermissionRequest {\n"); + sb.append(" network: ").append(toIndentedString(network)).append("\n"); + sb.append(" permissionHash: ").append(toIndentedString(permissionHash)).append("\n"); + sb.append(" paymasterUrl: ").append(toIndentedString(paymasterUrl)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `network` to the URL query string + if (getNetwork() != null) { + joiner.add(String.format("%snetwork%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getNetwork()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `permissionHash` to the URL query string + if (getPermissionHash() != null) { + joiner.add(String.format("%spermissionHash%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getPermissionHash()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `paymasterUrl` to the URL query string + if (getPaymasterUrl() != null) { + joiner.add(String.format("%spaymasterUrl%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getPaymasterUrl()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } + + public static class Builder { + + private EvmSpendPermissionsRevokeSpendPermissionRequest instance; + + public Builder() { + this(new EvmSpendPermissionsRevokeSpendPermissionRequest()); + } + + protected Builder(EvmSpendPermissionsRevokeSpendPermissionRequest instance) { + this.instance = instance; + } + + public EvmSpendPermissionsRevokeSpendPermissionRequest.Builder network(SpendPermissionNetwork network) { + this.instance.network = network; + return this; + } + public EvmSpendPermissionsRevokeSpendPermissionRequest.Builder permissionHash(String permissionHash) { + this.instance.permissionHash = permissionHash; + return this; + } + public EvmSpendPermissionsRevokeSpendPermissionRequest.Builder paymasterUrl(URI paymasterUrl) { + this.instance.paymasterUrl = paymasterUrl; + return this; + } + + + /** + * returns a built EvmSpendPermissionsRevokeSpendPermissionRequest instance. + * + * The builder is not reusable. + */ + public EvmSpendPermissionsRevokeSpendPermissionRequest build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static EvmSpendPermissionsRevokeSpendPermissionRequest.Builder builder() { + return new EvmSpendPermissionsRevokeSpendPermissionRequest.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public EvmSpendPermissionsRevokeSpendPermissionRequest.Builder toBuilder() { + return new EvmSpendPermissionsRevokeSpendPermissionRequest.Builder() + .network(getNetwork()) + .permissionHash(getPermissionHash()) + .paymasterUrl(getPaymasterUrl()); + } + +} + diff --git a/java/src/main/java/com/coinbase/cdp/openapi/model/OAuth2ProviderType.java b/java/src/main/java/com/coinbase/cdp/openapi/model/OAuth2ProviderType.java index 2a24e749a..6a40ae619 100644 --- a/java/src/main/java/com/coinbase/cdp/openapi/model/OAuth2ProviderType.java +++ b/java/src/main/java/com/coinbase/cdp/openapi/model/OAuth2ProviderType.java @@ -36,7 +36,9 @@ public enum OAuth2ProviderType { X("x"), - TELEGRAM("telegram"); + TELEGRAM("telegram"), + + GITHUB("github"); private String value; diff --git a/java/src/main/java/com/coinbase/cdp/openapi/model/RequestSolanaFaucetRequest.java b/java/src/main/java/com/coinbase/cdp/openapi/model/RequestSolanaFaucetRequest.java index e75e6390f..31ecc667b 100644 --- a/java/src/main/java/com/coinbase/cdp/openapi/model/RequestSolanaFaucetRequest.java +++ b/java/src/main/java/com/coinbase/cdp/openapi/model/RequestSolanaFaucetRequest.java @@ -48,7 +48,9 @@ public class RequestSolanaFaucetRequest { public enum TokenEnum { SOL(String.valueOf("sol")), - USDC(String.valueOf("usdc")); + USDC(String.valueOf("usdc")), + + CBTUSD(String.valueOf("cbtusd")); private String value; diff --git a/java/src/main/java/com/coinbase/cdp/openapi/model/RevokeDelegationForEndUserRequest.java b/java/src/main/java/com/coinbase/cdp/openapi/model/RevokeDelegationForEndUserRequest.java new file mode 100644 index 000000000..ce1df645f --- /dev/null +++ b/java/src/main/java/com/coinbase/cdp/openapi/model/RevokeDelegationForEndUserRequest.java @@ -0,0 +1,205 @@ +/* + * Coinbase Developer Platform APIs + * The Coinbase Developer Platform APIs - leading the world's transition onchain. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: cdp@coinbase.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.coinbase.cdp.openapi.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.coinbase.cdp.openapi.ApiClient; +/** + * RevokeDelegationForEndUserRequest + */ +@JsonPropertyOrder({ + RevokeDelegationForEndUserRequest.JSON_PROPERTY_WALLET_SECRET_ID +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class RevokeDelegationForEndUserRequest { + public static final String JSON_PROPERTY_WALLET_SECRET_ID = "walletSecretId"; + @jakarta.annotation.Nullable + private String walletSecretId; + + public RevokeDelegationForEndUserRequest() { + } + + public RevokeDelegationForEndUserRequest walletSecretId(@jakarta.annotation.Nullable String walletSecretId) { + this.walletSecretId = walletSecretId; + return this; + } + + /** + * When revoking with a wallet authentication scheme, the ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header. + * @return walletSecretId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WALLET_SECRET_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getWalletSecretId() { + return walletSecretId; + } + + + @JsonProperty(JSON_PROPERTY_WALLET_SECRET_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWalletSecretId(@jakarta.annotation.Nullable String walletSecretId) { + this.walletSecretId = walletSecretId; + } + + + /** + * Return true if this revokeDelegationForEndUser_request object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RevokeDelegationForEndUserRequest revokeDelegationForEndUserRequest = (RevokeDelegationForEndUserRequest) o; + return Objects.equals(this.walletSecretId, revokeDelegationForEndUserRequest.walletSecretId); + } + + @Override + public int hashCode() { + return Objects.hash(walletSecretId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RevokeDelegationForEndUserRequest {\n"); + sb.append(" walletSecretId: ").append(toIndentedString(walletSecretId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `walletSecretId` to the URL query string + if (getWalletSecretId() != null) { + joiner.add(String.format("%swalletSecretId%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getWalletSecretId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } + + public static class Builder { + + private RevokeDelegationForEndUserRequest instance; + + public Builder() { + this(new RevokeDelegationForEndUserRequest()); + } + + protected Builder(RevokeDelegationForEndUserRequest instance) { + this.instance = instance; + } + + public RevokeDelegationForEndUserRequest.Builder walletSecretId(String walletSecretId) { + this.instance.walletSecretId = walletSecretId; + return this; + } + + + /** + * returns a built RevokeDelegationForEndUserRequest instance. + * + * The builder is not reusable. + */ + public RevokeDelegationForEndUserRequest build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static RevokeDelegationForEndUserRequest.Builder builder() { + return new RevokeDelegationForEndUserRequest.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public RevokeDelegationForEndUserRequest.Builder toBuilder() { + return new RevokeDelegationForEndUserRequest.Builder() + .walletSecretId(getWalletSecretId()); + } + +} + diff --git a/java/src/main/java/com/coinbase/cdp/openapi/model/RevokeSpendPermissionRequest.java b/java/src/main/java/com/coinbase/cdp/openapi/model/RevokeSpendPermissionRequest.java index c7d2ccbf8..8bf9abda4 100644 --- a/java/src/main/java/com/coinbase/cdp/openapi/model/RevokeSpendPermissionRequest.java +++ b/java/src/main/java/com/coinbase/cdp/openapi/model/RevokeSpendPermissionRequest.java @@ -35,12 +35,18 @@ * Request parameters for revoking a Spend Permission. */ @JsonPropertyOrder({ + RevokeSpendPermissionRequest.JSON_PROPERTY_WALLET_SECRET_ID, RevokeSpendPermissionRequest.JSON_PROPERTY_NETWORK, RevokeSpendPermissionRequest.JSON_PROPERTY_PERMISSION_HASH, + RevokeSpendPermissionRequest.JSON_PROPERTY_USE_CDP_PAYMASTER, RevokeSpendPermissionRequest.JSON_PROPERTY_PAYMASTER_URL }) @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") public class RevokeSpendPermissionRequest { + public static final String JSON_PROPERTY_WALLET_SECRET_ID = "walletSecretId"; + @jakarta.annotation.Nonnull + private String walletSecretId; + public static final String JSON_PROPERTY_NETWORK = "network"; @jakarta.annotation.Nonnull private SpendPermissionNetwork network; @@ -49,6 +55,10 @@ public class RevokeSpendPermissionRequest { @jakarta.annotation.Nonnull private String permissionHash; + public static final String JSON_PROPERTY_USE_CDP_PAYMASTER = "useCdpPaymaster"; + @jakarta.annotation.Nonnull + private Boolean useCdpPaymaster; + public static final String JSON_PROPERTY_PAYMASTER_URL = "paymasterUrl"; @jakarta.annotation.Nullable private URI paymasterUrl; @@ -56,6 +66,30 @@ public class RevokeSpendPermissionRequest { public RevokeSpendPermissionRequest() { } + public RevokeSpendPermissionRequest walletSecretId(@jakarta.annotation.Nonnull String walletSecretId) { + this.walletSecretId = walletSecretId; + return this; + } + + /** + * The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header. + * @return walletSecretId + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_WALLET_SECRET_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getWalletSecretId() { + return walletSecretId; + } + + + @JsonProperty(JSON_PROPERTY_WALLET_SECRET_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setWalletSecretId(@jakarta.annotation.Nonnull String walletSecretId) { + this.walletSecretId = walletSecretId; + } + + public RevokeSpendPermissionRequest network(@jakarta.annotation.Nonnull SpendPermissionNetwork network) { this.network = network; return this; @@ -104,6 +138,30 @@ public void setPermissionHash(@jakarta.annotation.Nonnull String permissionHash) } + public RevokeSpendPermissionRequest useCdpPaymaster(@jakarta.annotation.Nonnull Boolean useCdpPaymaster) { + this.useCdpPaymaster = useCdpPaymaster; + return this; + } + + /** + * Whether to use the CDP Paymaster for the user operation. + * @return useCdpPaymaster + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_USE_CDP_PAYMASTER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getUseCdpPaymaster() { + return useCdpPaymaster; + } + + + @JsonProperty(JSON_PROPERTY_USE_CDP_PAYMASTER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setUseCdpPaymaster(@jakarta.annotation.Nonnull Boolean useCdpPaymaster) { + this.useCdpPaymaster = useCdpPaymaster; + } + + public RevokeSpendPermissionRequest paymasterUrl(@jakarta.annotation.Nullable URI paymasterUrl) { this.paymasterUrl = paymasterUrl; return this; @@ -140,22 +198,26 @@ public boolean equals(Object o) { return false; } RevokeSpendPermissionRequest revokeSpendPermissionRequest = (RevokeSpendPermissionRequest) o; - return Objects.equals(this.network, revokeSpendPermissionRequest.network) && + return Objects.equals(this.walletSecretId, revokeSpendPermissionRequest.walletSecretId) && + Objects.equals(this.network, revokeSpendPermissionRequest.network) && Objects.equals(this.permissionHash, revokeSpendPermissionRequest.permissionHash) && + Objects.equals(this.useCdpPaymaster, revokeSpendPermissionRequest.useCdpPaymaster) && Objects.equals(this.paymasterUrl, revokeSpendPermissionRequest.paymasterUrl); } @Override public int hashCode() { - return Objects.hash(network, permissionHash, paymasterUrl); + return Objects.hash(walletSecretId, network, permissionHash, useCdpPaymaster, paymasterUrl); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class RevokeSpendPermissionRequest {\n"); + sb.append(" walletSecretId: ").append(toIndentedString(walletSecretId)).append("\n"); sb.append(" network: ").append(toIndentedString(network)).append("\n"); sb.append(" permissionHash: ").append(toIndentedString(permissionHash)).append("\n"); + sb.append(" useCdpPaymaster: ").append(toIndentedString(useCdpPaymaster)).append("\n"); sb.append(" paymasterUrl: ").append(toIndentedString(paymasterUrl)).append("\n"); sb.append("}"); return sb.toString(); @@ -204,6 +266,11 @@ public String toUrlQueryString(String prefix) { StringJoiner joiner = new StringJoiner("&"); + // add `walletSecretId` to the URL query string + if (getWalletSecretId() != null) { + joiner.add(String.format("%swalletSecretId%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getWalletSecretId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + // add `network` to the URL query string if (getNetwork() != null) { joiner.add(String.format("%snetwork%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getNetwork()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); @@ -214,6 +281,11 @@ public String toUrlQueryString(String prefix) { joiner.add(String.format("%spermissionHash%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getPermissionHash()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } + // add `useCdpPaymaster` to the URL query string + if (getUseCdpPaymaster() != null) { + joiner.add(String.format("%suseCdpPaymaster%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getUseCdpPaymaster()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + // add `paymasterUrl` to the URL query string if (getPaymasterUrl() != null) { joiner.add(String.format("%spaymasterUrl%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getPaymasterUrl()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); @@ -234,6 +306,10 @@ protected Builder(RevokeSpendPermissionRequest instance) { this.instance = instance; } + public RevokeSpendPermissionRequest.Builder walletSecretId(String walletSecretId) { + this.instance.walletSecretId = walletSecretId; + return this; + } public RevokeSpendPermissionRequest.Builder network(SpendPermissionNetwork network) { this.instance.network = network; return this; @@ -242,6 +318,10 @@ public RevokeSpendPermissionRequest.Builder permissionHash(String permissionHash this.instance.permissionHash = permissionHash; return this; } + public RevokeSpendPermissionRequest.Builder useCdpPaymaster(Boolean useCdpPaymaster) { + this.instance.useCdpPaymaster = useCdpPaymaster; + return this; + } public RevokeSpendPermissionRequest.Builder paymasterUrl(URI paymasterUrl) { this.instance.paymasterUrl = paymasterUrl; return this; @@ -280,8 +360,10 @@ public static RevokeSpendPermissionRequest.Builder builder() { */ public RevokeSpendPermissionRequest.Builder toBuilder() { return new RevokeSpendPermissionRequest.Builder() + .walletSecretId(getWalletSecretId()) .network(getNetwork()) .permissionHash(getPermissionHash()) + .useCdpPaymaster(getUseCdpPaymaster()) .paymasterUrl(getPaymasterUrl()); } diff --git a/java/src/main/java/com/coinbase/cdp/openapi/model/SendEvmAssetWithEndUserAccount200Response.java b/java/src/main/java/com/coinbase/cdp/openapi/model/SendEvmAssetWithEndUserAccount200Response.java new file mode 100644 index 000000000..3df9ac2c3 --- /dev/null +++ b/java/src/main/java/com/coinbase/cdp/openapi/model/SendEvmAssetWithEndUserAccount200Response.java @@ -0,0 +1,246 @@ +/* + * Coinbase Developer Platform APIs + * The Coinbase Developer Platform APIs - leading the world's transition onchain. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: cdp@coinbase.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.coinbase.cdp.openapi.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.coinbase.cdp.openapi.ApiClient; +/** + * SendEvmAssetWithEndUserAccount200Response + */ +@JsonPropertyOrder({ + SendEvmAssetWithEndUserAccount200Response.JSON_PROPERTY_TRANSACTION_HASH, + SendEvmAssetWithEndUserAccount200Response.JSON_PROPERTY_USER_OP_HASH +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class SendEvmAssetWithEndUserAccount200Response { + public static final String JSON_PROPERTY_TRANSACTION_HASH = "transactionHash"; + @jakarta.annotation.Nullable + private String transactionHash; + + public static final String JSON_PROPERTY_USER_OP_HASH = "userOpHash"; + @jakarta.annotation.Nullable + private String userOpHash; + + public SendEvmAssetWithEndUserAccount200Response() { + } + + public SendEvmAssetWithEndUserAccount200Response transactionHash(@jakarta.annotation.Nullable String transactionHash) { + this.transactionHash = transactionHash; + return this; + } + + /** + * The hash of the transaction, as a 0x-prefixed hex string. Populated for EOA accounts. Null for Smart Accounts (use userOpHash instead). + * @return transactionHash + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TRANSACTION_HASH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTransactionHash() { + return transactionHash; + } + + + @JsonProperty(JSON_PROPERTY_TRANSACTION_HASH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTransactionHash(@jakarta.annotation.Nullable String transactionHash) { + this.transactionHash = transactionHash; + } + + + public SendEvmAssetWithEndUserAccount200Response userOpHash(@jakarta.annotation.Nullable String userOpHash) { + this.userOpHash = userOpHash; + return this; + } + + /** + * The hash of the user operation, as a 0x-prefixed hex string. Populated for Smart Accounts. Null for EOA accounts (use transactionHash instead). + * @return userOpHash + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USER_OP_HASH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUserOpHash() { + return userOpHash; + } + + + @JsonProperty(JSON_PROPERTY_USER_OP_HASH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserOpHash(@jakarta.annotation.Nullable String userOpHash) { + this.userOpHash = userOpHash; + } + + + /** + * Return true if this sendEvmAssetWithEndUserAccount_200_response object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SendEvmAssetWithEndUserAccount200Response sendEvmAssetWithEndUserAccount200Response = (SendEvmAssetWithEndUserAccount200Response) o; + return Objects.equals(this.transactionHash, sendEvmAssetWithEndUserAccount200Response.transactionHash) && + Objects.equals(this.userOpHash, sendEvmAssetWithEndUserAccount200Response.userOpHash); + } + + @Override + public int hashCode() { + return Objects.hash(transactionHash, userOpHash); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SendEvmAssetWithEndUserAccount200Response {\n"); + sb.append(" transactionHash: ").append(toIndentedString(transactionHash)).append("\n"); + sb.append(" userOpHash: ").append(toIndentedString(userOpHash)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `transactionHash` to the URL query string + if (getTransactionHash() != null) { + joiner.add(String.format("%stransactionHash%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getTransactionHash()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `userOpHash` to the URL query string + if (getUserOpHash() != null) { + joiner.add(String.format("%suserOpHash%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getUserOpHash()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SendEvmAssetWithEndUserAccount200Response instance; + + public Builder() { + this(new SendEvmAssetWithEndUserAccount200Response()); + } + + protected Builder(SendEvmAssetWithEndUserAccount200Response instance) { + this.instance = instance; + } + + public SendEvmAssetWithEndUserAccount200Response.Builder transactionHash(String transactionHash) { + this.instance.transactionHash = transactionHash; + return this; + } + public SendEvmAssetWithEndUserAccount200Response.Builder userOpHash(String userOpHash) { + this.instance.userOpHash = userOpHash; + return this; + } + + + /** + * returns a built SendEvmAssetWithEndUserAccount200Response instance. + * + * The builder is not reusable. + */ + public SendEvmAssetWithEndUserAccount200Response build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SendEvmAssetWithEndUserAccount200Response.Builder builder() { + return new SendEvmAssetWithEndUserAccount200Response.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SendEvmAssetWithEndUserAccount200Response.Builder toBuilder() { + return new SendEvmAssetWithEndUserAccount200Response.Builder() + .transactionHash(getTransactionHash()) + .userOpHash(getUserOpHash()); + } + +} + diff --git a/java/src/main/java/com/coinbase/cdp/openapi/model/SendEvmAssetWithEndUserAccountRequest.java b/java/src/main/java/com/coinbase/cdp/openapi/model/SendEvmAssetWithEndUserAccountRequest.java new file mode 100644 index 000000000..5c11457d5 --- /dev/null +++ b/java/src/main/java/com/coinbase/cdp/openapi/model/SendEvmAssetWithEndUserAccountRequest.java @@ -0,0 +1,458 @@ +/* + * Coinbase Developer Platform APIs + * The Coinbase Developer Platform APIs - leading the world's transition onchain. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: cdp@coinbase.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.coinbase.cdp.openapi.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.net.URI; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.coinbase.cdp.openapi.ApiClient; +/** + * SendEvmAssetWithEndUserAccountRequest + */ +@JsonPropertyOrder({ + SendEvmAssetWithEndUserAccountRequest.JSON_PROPERTY_TO, + SendEvmAssetWithEndUserAccountRequest.JSON_PROPERTY_AMOUNT, + SendEvmAssetWithEndUserAccountRequest.JSON_PROPERTY_NETWORK, + SendEvmAssetWithEndUserAccountRequest.JSON_PROPERTY_USE_CDP_PAYMASTER, + SendEvmAssetWithEndUserAccountRequest.JSON_PROPERTY_PAYMASTER_URL, + SendEvmAssetWithEndUserAccountRequest.JSON_PROPERTY_WALLET_SECRET_ID +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class SendEvmAssetWithEndUserAccountRequest { + public static final String JSON_PROPERTY_TO = "to"; + @jakarta.annotation.Nonnull + private String to; + + public static final String JSON_PROPERTY_AMOUNT = "amount"; + @jakarta.annotation.Nonnull + private String amount; + + /** + * The EVM network to send USDC on. + */ + public enum NetworkEnum { + BASE(String.valueOf("base")), + + BASE_SEPOLIA(String.valueOf("base-sepolia")), + + ETHEREUM(String.valueOf("ethereum")), + + ETHEREUM_SEPOLIA(String.valueOf("ethereum-sepolia")), + + AVALANCHE(String.valueOf("avalanche")), + + POLYGON(String.valueOf("polygon")), + + OPTIMISM(String.valueOf("optimism")), + + ARBITRUM(String.valueOf("arbitrum")); + + private String value; + + NetworkEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static NetworkEnum fromValue(String value) { + for (NetworkEnum b : NetworkEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_NETWORK = "network"; + @jakarta.annotation.Nonnull + private NetworkEnum network; + + public static final String JSON_PROPERTY_USE_CDP_PAYMASTER = "useCdpPaymaster"; + @jakarta.annotation.Nullable + private Boolean useCdpPaymaster; + + public static final String JSON_PROPERTY_PAYMASTER_URL = "paymasterUrl"; + @jakarta.annotation.Nullable + private URI paymasterUrl; + + public static final String JSON_PROPERTY_WALLET_SECRET_ID = "walletSecretId"; + @jakarta.annotation.Nullable + private String walletSecretId; + + public SendEvmAssetWithEndUserAccountRequest() { + } + + public SendEvmAssetWithEndUserAccountRequest to(@jakarta.annotation.Nonnull String to) { + this.to = to; + return this; + } + + /** + * The 0x-prefixed address of the recipient. + * @return to + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TO) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTo() { + return to; + } + + + @JsonProperty(JSON_PROPERTY_TO) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTo(@jakarta.annotation.Nonnull String to) { + this.to = to; + } + + + public SendEvmAssetWithEndUserAccountRequest amount(@jakarta.annotation.Nonnull String amount) { + this.amount = amount; + return this; + } + + /** + * The amount of USDC to send as a decimal string (e.g., \"1.5\" or \"25.50\"). + * @return amount + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_AMOUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getAmount() { + return amount; + } + + + @JsonProperty(JSON_PROPERTY_AMOUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setAmount(@jakarta.annotation.Nonnull String amount) { + this.amount = amount; + } + + + public SendEvmAssetWithEndUserAccountRequest network(@jakarta.annotation.Nonnull NetworkEnum network) { + this.network = network; + return this; + } + + /** + * The EVM network to send USDC on. + * @return network + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NETWORK) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public NetworkEnum getNetwork() { + return network; + } + + + @JsonProperty(JSON_PROPERTY_NETWORK) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setNetwork(@jakarta.annotation.Nonnull NetworkEnum network) { + this.network = network; + } + + + public SendEvmAssetWithEndUserAccountRequest useCdpPaymaster(@jakarta.annotation.Nullable Boolean useCdpPaymaster) { + this.useCdpPaymaster = useCdpPaymaster; + return this; + } + + /** + * Whether to use CDP Paymaster to sponsor gas fees. Only applicable for EVM Smart Accounts. When true, the transaction gas will be paid by the Paymaster, allowing users to send USDC without holding native gas tokens. Ignored for EOA accounts. Cannot be used together with `paymasterUrl`. + * @return useCdpPaymaster + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USE_CDP_PAYMASTER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getUseCdpPaymaster() { + return useCdpPaymaster; + } + + + @JsonProperty(JSON_PROPERTY_USE_CDP_PAYMASTER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUseCdpPaymaster(@jakarta.annotation.Nullable Boolean useCdpPaymaster) { + this.useCdpPaymaster = useCdpPaymaster; + } + + + public SendEvmAssetWithEndUserAccountRequest paymasterUrl(@jakarta.annotation.Nullable URI paymasterUrl) { + this.paymasterUrl = paymasterUrl; + return this; + } + + /** + * Optional custom Paymaster URL to use for gas sponsorship. Only applicable for EVM Smart Accounts. This allows you to use your own Paymaster service instead of CDP's Paymaster. Cannot be used together with `useCdpPaymaster`. + * @return paymasterUrl + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PAYMASTER_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public URI getPaymasterUrl() { + return paymasterUrl; + } + + + @JsonProperty(JSON_PROPERTY_PAYMASTER_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPaymasterUrl(@jakarta.annotation.Nullable URI paymasterUrl) { + this.paymasterUrl = paymasterUrl; + } + + + public SendEvmAssetWithEndUserAccountRequest walletSecretId(@jakarta.annotation.Nullable String walletSecretId) { + this.walletSecretId = walletSecretId; + return this; + } + + /** + * Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header. + * @return walletSecretId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WALLET_SECRET_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getWalletSecretId() { + return walletSecretId; + } + + + @JsonProperty(JSON_PROPERTY_WALLET_SECRET_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWalletSecretId(@jakarta.annotation.Nullable String walletSecretId) { + this.walletSecretId = walletSecretId; + } + + + /** + * Return true if this sendEvmAssetWithEndUserAccount_request object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SendEvmAssetWithEndUserAccountRequest sendEvmAssetWithEndUserAccountRequest = (SendEvmAssetWithEndUserAccountRequest) o; + return Objects.equals(this.to, sendEvmAssetWithEndUserAccountRequest.to) && + Objects.equals(this.amount, sendEvmAssetWithEndUserAccountRequest.amount) && + Objects.equals(this.network, sendEvmAssetWithEndUserAccountRequest.network) && + Objects.equals(this.useCdpPaymaster, sendEvmAssetWithEndUserAccountRequest.useCdpPaymaster) && + Objects.equals(this.paymasterUrl, sendEvmAssetWithEndUserAccountRequest.paymasterUrl) && + Objects.equals(this.walletSecretId, sendEvmAssetWithEndUserAccountRequest.walletSecretId); + } + + @Override + public int hashCode() { + return Objects.hash(to, amount, network, useCdpPaymaster, paymasterUrl, walletSecretId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SendEvmAssetWithEndUserAccountRequest {\n"); + sb.append(" to: ").append(toIndentedString(to)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" network: ").append(toIndentedString(network)).append("\n"); + sb.append(" useCdpPaymaster: ").append(toIndentedString(useCdpPaymaster)).append("\n"); + sb.append(" paymasterUrl: ").append(toIndentedString(paymasterUrl)).append("\n"); + sb.append(" walletSecretId: ").append(toIndentedString(walletSecretId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `to` to the URL query string + if (getTo() != null) { + joiner.add(String.format("%sto%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getTo()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `amount` to the URL query string + if (getAmount() != null) { + joiner.add(String.format("%samount%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getAmount()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `network` to the URL query string + if (getNetwork() != null) { + joiner.add(String.format("%snetwork%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getNetwork()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `useCdpPaymaster` to the URL query string + if (getUseCdpPaymaster() != null) { + joiner.add(String.format("%suseCdpPaymaster%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getUseCdpPaymaster()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `paymasterUrl` to the URL query string + if (getPaymasterUrl() != null) { + joiner.add(String.format("%spaymasterUrl%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getPaymasterUrl()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `walletSecretId` to the URL query string + if (getWalletSecretId() != null) { + joiner.add(String.format("%swalletSecretId%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getWalletSecretId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SendEvmAssetWithEndUserAccountRequest instance; + + public Builder() { + this(new SendEvmAssetWithEndUserAccountRequest()); + } + + protected Builder(SendEvmAssetWithEndUserAccountRequest instance) { + this.instance = instance; + } + + public SendEvmAssetWithEndUserAccountRequest.Builder to(String to) { + this.instance.to = to; + return this; + } + public SendEvmAssetWithEndUserAccountRequest.Builder amount(String amount) { + this.instance.amount = amount; + return this; + } + public SendEvmAssetWithEndUserAccountRequest.Builder network(NetworkEnum network) { + this.instance.network = network; + return this; + } + public SendEvmAssetWithEndUserAccountRequest.Builder useCdpPaymaster(Boolean useCdpPaymaster) { + this.instance.useCdpPaymaster = useCdpPaymaster; + return this; + } + public SendEvmAssetWithEndUserAccountRequest.Builder paymasterUrl(URI paymasterUrl) { + this.instance.paymasterUrl = paymasterUrl; + return this; + } + public SendEvmAssetWithEndUserAccountRequest.Builder walletSecretId(String walletSecretId) { + this.instance.walletSecretId = walletSecretId; + return this; + } + + + /** + * returns a built SendEvmAssetWithEndUserAccountRequest instance. + * + * The builder is not reusable. + */ + public SendEvmAssetWithEndUserAccountRequest build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SendEvmAssetWithEndUserAccountRequest.Builder builder() { + return new SendEvmAssetWithEndUserAccountRequest.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SendEvmAssetWithEndUserAccountRequest.Builder toBuilder() { + return new SendEvmAssetWithEndUserAccountRequest.Builder() + .to(getTo()) + .amount(getAmount()) + .network(getNetwork()) + .useCdpPaymaster(getUseCdpPaymaster()) + .paymasterUrl(getPaymasterUrl()) + .walletSecretId(getWalletSecretId()); + } + +} + diff --git a/java/src/main/java/com/coinbase/cdp/openapi/model/SendEvmTransactionWithEndUserAccount200Response.java b/java/src/main/java/com/coinbase/cdp/openapi/model/SendEvmTransactionWithEndUserAccount200Response.java new file mode 100644 index 000000000..6a042d3c7 --- /dev/null +++ b/java/src/main/java/com/coinbase/cdp/openapi/model/SendEvmTransactionWithEndUserAccount200Response.java @@ -0,0 +1,205 @@ +/* + * Coinbase Developer Platform APIs + * The Coinbase Developer Platform APIs - leading the world's transition onchain. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: cdp@coinbase.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.coinbase.cdp.openapi.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.coinbase.cdp.openapi.ApiClient; +/** + * SendEvmTransactionWithEndUserAccount200Response + */ +@JsonPropertyOrder({ + SendEvmTransactionWithEndUserAccount200Response.JSON_PROPERTY_TRANSACTION_HASH +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class SendEvmTransactionWithEndUserAccount200Response { + public static final String JSON_PROPERTY_TRANSACTION_HASH = "transactionHash"; + @jakarta.annotation.Nonnull + private String transactionHash; + + public SendEvmTransactionWithEndUserAccount200Response() { + } + + public SendEvmTransactionWithEndUserAccount200Response transactionHash(@jakarta.annotation.Nonnull String transactionHash) { + this.transactionHash = transactionHash; + return this; + } + + /** + * The hash of the transaction, as a 0x-prefixed hex string. + * @return transactionHash + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TRANSACTION_HASH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTransactionHash() { + return transactionHash; + } + + + @JsonProperty(JSON_PROPERTY_TRANSACTION_HASH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTransactionHash(@jakarta.annotation.Nonnull String transactionHash) { + this.transactionHash = transactionHash; + } + + + /** + * Return true if this sendEvmTransactionWithEndUserAccount_200_response object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SendEvmTransactionWithEndUserAccount200Response sendEvmTransactionWithEndUserAccount200Response = (SendEvmTransactionWithEndUserAccount200Response) o; + return Objects.equals(this.transactionHash, sendEvmTransactionWithEndUserAccount200Response.transactionHash); + } + + @Override + public int hashCode() { + return Objects.hash(transactionHash); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SendEvmTransactionWithEndUserAccount200Response {\n"); + sb.append(" transactionHash: ").append(toIndentedString(transactionHash)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `transactionHash` to the URL query string + if (getTransactionHash() != null) { + joiner.add(String.format("%stransactionHash%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getTransactionHash()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SendEvmTransactionWithEndUserAccount200Response instance; + + public Builder() { + this(new SendEvmTransactionWithEndUserAccount200Response()); + } + + protected Builder(SendEvmTransactionWithEndUserAccount200Response instance) { + this.instance = instance; + } + + public SendEvmTransactionWithEndUserAccount200Response.Builder transactionHash(String transactionHash) { + this.instance.transactionHash = transactionHash; + return this; + } + + + /** + * returns a built SendEvmTransactionWithEndUserAccount200Response instance. + * + * The builder is not reusable. + */ + public SendEvmTransactionWithEndUserAccount200Response build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SendEvmTransactionWithEndUserAccount200Response.Builder builder() { + return new SendEvmTransactionWithEndUserAccount200Response.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SendEvmTransactionWithEndUserAccount200Response.Builder toBuilder() { + return new SendEvmTransactionWithEndUserAccount200Response.Builder() + .transactionHash(getTransactionHash()); + } + +} + diff --git a/java/src/main/java/com/coinbase/cdp/openapi/model/SendEvmTransactionWithEndUserAccountRequest.java b/java/src/main/java/com/coinbase/cdp/openapi/model/SendEvmTransactionWithEndUserAccountRequest.java new file mode 100644 index 000000000..a0ace4a0a --- /dev/null +++ b/java/src/main/java/com/coinbase/cdp/openapi/model/SendEvmTransactionWithEndUserAccountRequest.java @@ -0,0 +1,375 @@ +/* + * Coinbase Developer Platform APIs + * The Coinbase Developer Platform APIs - leading the world's transition onchain. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: cdp@coinbase.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.coinbase.cdp.openapi.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.coinbase.cdp.openapi.ApiClient; +/** + * SendEvmTransactionWithEndUserAccountRequest + */ +@JsonPropertyOrder({ + SendEvmTransactionWithEndUserAccountRequest.JSON_PROPERTY_ADDRESS, + SendEvmTransactionWithEndUserAccountRequest.JSON_PROPERTY_NETWORK, + SendEvmTransactionWithEndUserAccountRequest.JSON_PROPERTY_WALLET_SECRET_ID, + SendEvmTransactionWithEndUserAccountRequest.JSON_PROPERTY_TRANSACTION +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class SendEvmTransactionWithEndUserAccountRequest { + public static final String JSON_PROPERTY_ADDRESS = "address"; + @jakarta.annotation.Nonnull + private String address; + + /** + * The network to send the transaction to. + */ + public enum NetworkEnum { + BASE(String.valueOf("base")), + + BASE_SEPOLIA(String.valueOf("base-sepolia")), + + ETHEREUM(String.valueOf("ethereum")), + + ETHEREUM_SEPOLIA(String.valueOf("ethereum-sepolia")), + + AVALANCHE(String.valueOf("avalanche")), + + POLYGON(String.valueOf("polygon")), + + OPTIMISM(String.valueOf("optimism")), + + ARBITRUM(String.valueOf("arbitrum")); + + private String value; + + NetworkEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static NetworkEnum fromValue(String value) { + for (NetworkEnum b : NetworkEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_NETWORK = "network"; + @jakarta.annotation.Nonnull + private NetworkEnum network; + + public static final String JSON_PROPERTY_WALLET_SECRET_ID = "walletSecretId"; + @jakarta.annotation.Nullable + private String walletSecretId; + + public static final String JSON_PROPERTY_TRANSACTION = "transaction"; + @jakarta.annotation.Nonnull + private String transaction; + + public SendEvmTransactionWithEndUserAccountRequest() { + } + + public SendEvmTransactionWithEndUserAccountRequest address(@jakarta.annotation.Nonnull String address) { + this.address = address; + return this; + } + + /** + * The 0x-prefixed address of the EVM account belonging to the end user. + * @return address + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getAddress() { + return address; + } + + + @JsonProperty(JSON_PROPERTY_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setAddress(@jakarta.annotation.Nonnull String address) { + this.address = address; + } + + + public SendEvmTransactionWithEndUserAccountRequest network(@jakarta.annotation.Nonnull NetworkEnum network) { + this.network = network; + return this; + } + + /** + * The network to send the transaction to. + * @return network + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NETWORK) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public NetworkEnum getNetwork() { + return network; + } + + + @JsonProperty(JSON_PROPERTY_NETWORK) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setNetwork(@jakarta.annotation.Nonnull NetworkEnum network) { + this.network = network; + } + + + public SendEvmTransactionWithEndUserAccountRequest walletSecretId(@jakarta.annotation.Nullable String walletSecretId) { + this.walletSecretId = walletSecretId; + return this; + } + + /** + * Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header. + * @return walletSecretId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WALLET_SECRET_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getWalletSecretId() { + return walletSecretId; + } + + + @JsonProperty(JSON_PROPERTY_WALLET_SECRET_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWalletSecretId(@jakarta.annotation.Nullable String walletSecretId) { + this.walletSecretId = walletSecretId; + } + + + public SendEvmTransactionWithEndUserAccountRequest transaction(@jakarta.annotation.Nonnull String transaction) { + this.transaction = transaction; + return this; + } + + /** + * The RLP-encoded transaction to sign and send, as a 0x-prefixed hex string. + * @return transaction + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TRANSACTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTransaction() { + return transaction; + } + + + @JsonProperty(JSON_PROPERTY_TRANSACTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTransaction(@jakarta.annotation.Nonnull String transaction) { + this.transaction = transaction; + } + + + /** + * Return true if this sendEvmTransactionWithEndUserAccount_request object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SendEvmTransactionWithEndUserAccountRequest sendEvmTransactionWithEndUserAccountRequest = (SendEvmTransactionWithEndUserAccountRequest) o; + return Objects.equals(this.address, sendEvmTransactionWithEndUserAccountRequest.address) && + Objects.equals(this.network, sendEvmTransactionWithEndUserAccountRequest.network) && + Objects.equals(this.walletSecretId, sendEvmTransactionWithEndUserAccountRequest.walletSecretId) && + Objects.equals(this.transaction, sendEvmTransactionWithEndUserAccountRequest.transaction); + } + + @Override + public int hashCode() { + return Objects.hash(address, network, walletSecretId, transaction); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SendEvmTransactionWithEndUserAccountRequest {\n"); + sb.append(" address: ").append(toIndentedString(address)).append("\n"); + sb.append(" network: ").append(toIndentedString(network)).append("\n"); + sb.append(" walletSecretId: ").append(toIndentedString(walletSecretId)).append("\n"); + sb.append(" transaction: ").append(toIndentedString(transaction)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `address` to the URL query string + if (getAddress() != null) { + joiner.add(String.format("%saddress%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getAddress()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `network` to the URL query string + if (getNetwork() != null) { + joiner.add(String.format("%snetwork%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getNetwork()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `walletSecretId` to the URL query string + if (getWalletSecretId() != null) { + joiner.add(String.format("%swalletSecretId%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getWalletSecretId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `transaction` to the URL query string + if (getTransaction() != null) { + joiner.add(String.format("%stransaction%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getTransaction()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SendEvmTransactionWithEndUserAccountRequest instance; + + public Builder() { + this(new SendEvmTransactionWithEndUserAccountRequest()); + } + + protected Builder(SendEvmTransactionWithEndUserAccountRequest instance) { + this.instance = instance; + } + + public SendEvmTransactionWithEndUserAccountRequest.Builder address(String address) { + this.instance.address = address; + return this; + } + public SendEvmTransactionWithEndUserAccountRequest.Builder network(NetworkEnum network) { + this.instance.network = network; + return this; + } + public SendEvmTransactionWithEndUserAccountRequest.Builder walletSecretId(String walletSecretId) { + this.instance.walletSecretId = walletSecretId; + return this; + } + public SendEvmTransactionWithEndUserAccountRequest.Builder transaction(String transaction) { + this.instance.transaction = transaction; + return this; + } + + + /** + * returns a built SendEvmTransactionWithEndUserAccountRequest instance. + * + * The builder is not reusable. + */ + public SendEvmTransactionWithEndUserAccountRequest build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SendEvmTransactionWithEndUserAccountRequest.Builder builder() { + return new SendEvmTransactionWithEndUserAccountRequest.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SendEvmTransactionWithEndUserAccountRequest.Builder toBuilder() { + return new SendEvmTransactionWithEndUserAccountRequest.Builder() + .address(getAddress()) + .network(getNetwork()) + .walletSecretId(getWalletSecretId()) + .transaction(getTransaction()); + } + +} + diff --git a/java/src/main/java/com/coinbase/cdp/openapi/model/SendSolanaAssetWithEndUserAccountRequest.java b/java/src/main/java/com/coinbase/cdp/openapi/model/SendSolanaAssetWithEndUserAccountRequest.java new file mode 100644 index 000000000..82bb67f83 --- /dev/null +++ b/java/src/main/java/com/coinbase/cdp/openapi/model/SendSolanaAssetWithEndUserAccountRequest.java @@ -0,0 +1,445 @@ +/* + * Coinbase Developer Platform APIs + * The Coinbase Developer Platform APIs - leading the world's transition onchain. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: cdp@coinbase.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.coinbase.cdp.openapi.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.coinbase.cdp.openapi.ApiClient; +/** + * SendSolanaAssetWithEndUserAccountRequest + */ +@JsonPropertyOrder({ + SendSolanaAssetWithEndUserAccountRequest.JSON_PROPERTY_TO, + SendSolanaAssetWithEndUserAccountRequest.JSON_PROPERTY_AMOUNT, + SendSolanaAssetWithEndUserAccountRequest.JSON_PROPERTY_NETWORK, + SendSolanaAssetWithEndUserAccountRequest.JSON_PROPERTY_CREATE_RECIPIENT_ATA, + SendSolanaAssetWithEndUserAccountRequest.JSON_PROPERTY_WALLET_SECRET_ID, + SendSolanaAssetWithEndUserAccountRequest.JSON_PROPERTY_USE_CDP_SPONSOR +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class SendSolanaAssetWithEndUserAccountRequest { + public static final String JSON_PROPERTY_TO = "to"; + @jakarta.annotation.Nonnull + private String to; + + public static final String JSON_PROPERTY_AMOUNT = "amount"; + @jakarta.annotation.Nonnull + private String amount; + + /** + * The Solana network to send USDC on. + */ + public enum NetworkEnum { + SOLANA(String.valueOf("solana")), + + SOLANA_DEVNET(String.valueOf("solana-devnet")); + + private String value; + + NetworkEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static NetworkEnum fromValue(String value) { + for (NetworkEnum b : NetworkEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_NETWORK = "network"; + @jakarta.annotation.Nonnull + private NetworkEnum network; + + public static final String JSON_PROPERTY_CREATE_RECIPIENT_ATA = "createRecipientAta"; + @jakarta.annotation.Nullable + private Boolean createRecipientAta; + + public static final String JSON_PROPERTY_WALLET_SECRET_ID = "walletSecretId"; + @jakarta.annotation.Nullable + private String walletSecretId; + + public static final String JSON_PROPERTY_USE_CDP_SPONSOR = "useCdpSponsor"; + @jakarta.annotation.Nullable + private Boolean useCdpSponsor; + + public SendSolanaAssetWithEndUserAccountRequest() { + } + + public SendSolanaAssetWithEndUserAccountRequest to(@jakarta.annotation.Nonnull String to) { + this.to = to; + return this; + } + + /** + * The base58 encoded address of the recipient. + * @return to + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TO) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTo() { + return to; + } + + + @JsonProperty(JSON_PROPERTY_TO) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTo(@jakarta.annotation.Nonnull String to) { + this.to = to; + } + + + public SendSolanaAssetWithEndUserAccountRequest amount(@jakarta.annotation.Nonnull String amount) { + this.amount = amount; + return this; + } + + /** + * The amount of USDC to send as a decimal string (e.g., \"1.5\" or \"25.50\"). + * @return amount + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_AMOUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getAmount() { + return amount; + } + + + @JsonProperty(JSON_PROPERTY_AMOUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setAmount(@jakarta.annotation.Nonnull String amount) { + this.amount = amount; + } + + + public SendSolanaAssetWithEndUserAccountRequest network(@jakarta.annotation.Nonnull NetworkEnum network) { + this.network = network; + return this; + } + + /** + * The Solana network to send USDC on. + * @return network + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NETWORK) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public NetworkEnum getNetwork() { + return network; + } + + + @JsonProperty(JSON_PROPERTY_NETWORK) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setNetwork(@jakarta.annotation.Nonnull NetworkEnum network) { + this.network = network; + } + + + public SendSolanaAssetWithEndUserAccountRequest createRecipientAta(@jakarta.annotation.Nullable Boolean createRecipientAta) { + this.createRecipientAta = createRecipientAta; + return this; + } + + /** + * Whether to automatically create an Associated Token Account (ATA) for the recipient if it doesn't exist. When true, the sender pays the rent-exempt minimum to create the recipient's USDC ATA. When false, the transaction will fail if the recipient doesn't have a USDC ATA. + * @return createRecipientAta + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATE_RECIPIENT_ATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getCreateRecipientAta() { + return createRecipientAta; + } + + + @JsonProperty(JSON_PROPERTY_CREATE_RECIPIENT_ATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCreateRecipientAta(@jakarta.annotation.Nullable Boolean createRecipientAta) { + this.createRecipientAta = createRecipientAta; + } + + + public SendSolanaAssetWithEndUserAccountRequest walletSecretId(@jakarta.annotation.Nullable String walletSecretId) { + this.walletSecretId = walletSecretId; + return this; + } + + /** + * Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header. + * @return walletSecretId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WALLET_SECRET_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getWalletSecretId() { + return walletSecretId; + } + + + @JsonProperty(JSON_PROPERTY_WALLET_SECRET_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWalletSecretId(@jakarta.annotation.Nullable String walletSecretId) { + this.walletSecretId = walletSecretId; + } + + + public SendSolanaAssetWithEndUserAccountRequest useCdpSponsor(@jakarta.annotation.Nullable Boolean useCdpSponsor) { + this.useCdpSponsor = useCdpSponsor; + return this; + } + + /** + * Whether transaction fees should be sponsored by CDP. When true, CDP sponsors the transaction fees on behalf of the end user. When false, the end user is responsible for paying the transaction fees. + * @return useCdpSponsor + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USE_CDP_SPONSOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getUseCdpSponsor() { + return useCdpSponsor; + } + + + @JsonProperty(JSON_PROPERTY_USE_CDP_SPONSOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUseCdpSponsor(@jakarta.annotation.Nullable Boolean useCdpSponsor) { + this.useCdpSponsor = useCdpSponsor; + } + + + /** + * Return true if this sendSolanaAssetWithEndUserAccount_request object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SendSolanaAssetWithEndUserAccountRequest sendSolanaAssetWithEndUserAccountRequest = (SendSolanaAssetWithEndUserAccountRequest) o; + return Objects.equals(this.to, sendSolanaAssetWithEndUserAccountRequest.to) && + Objects.equals(this.amount, sendSolanaAssetWithEndUserAccountRequest.amount) && + Objects.equals(this.network, sendSolanaAssetWithEndUserAccountRequest.network) && + Objects.equals(this.createRecipientAta, sendSolanaAssetWithEndUserAccountRequest.createRecipientAta) && + Objects.equals(this.walletSecretId, sendSolanaAssetWithEndUserAccountRequest.walletSecretId) && + Objects.equals(this.useCdpSponsor, sendSolanaAssetWithEndUserAccountRequest.useCdpSponsor); + } + + @Override + public int hashCode() { + return Objects.hash(to, amount, network, createRecipientAta, walletSecretId, useCdpSponsor); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SendSolanaAssetWithEndUserAccountRequest {\n"); + sb.append(" to: ").append(toIndentedString(to)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" network: ").append(toIndentedString(network)).append("\n"); + sb.append(" createRecipientAta: ").append(toIndentedString(createRecipientAta)).append("\n"); + sb.append(" walletSecretId: ").append(toIndentedString(walletSecretId)).append("\n"); + sb.append(" useCdpSponsor: ").append(toIndentedString(useCdpSponsor)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `to` to the URL query string + if (getTo() != null) { + joiner.add(String.format("%sto%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getTo()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `amount` to the URL query string + if (getAmount() != null) { + joiner.add(String.format("%samount%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getAmount()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `network` to the URL query string + if (getNetwork() != null) { + joiner.add(String.format("%snetwork%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getNetwork()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `createRecipientAta` to the URL query string + if (getCreateRecipientAta() != null) { + joiner.add(String.format("%screateRecipientAta%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getCreateRecipientAta()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `walletSecretId` to the URL query string + if (getWalletSecretId() != null) { + joiner.add(String.format("%swalletSecretId%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getWalletSecretId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `useCdpSponsor` to the URL query string + if (getUseCdpSponsor() != null) { + joiner.add(String.format("%suseCdpSponsor%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getUseCdpSponsor()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SendSolanaAssetWithEndUserAccountRequest instance; + + public Builder() { + this(new SendSolanaAssetWithEndUserAccountRequest()); + } + + protected Builder(SendSolanaAssetWithEndUserAccountRequest instance) { + this.instance = instance; + } + + public SendSolanaAssetWithEndUserAccountRequest.Builder to(String to) { + this.instance.to = to; + return this; + } + public SendSolanaAssetWithEndUserAccountRequest.Builder amount(String amount) { + this.instance.amount = amount; + return this; + } + public SendSolanaAssetWithEndUserAccountRequest.Builder network(NetworkEnum network) { + this.instance.network = network; + return this; + } + public SendSolanaAssetWithEndUserAccountRequest.Builder createRecipientAta(Boolean createRecipientAta) { + this.instance.createRecipientAta = createRecipientAta; + return this; + } + public SendSolanaAssetWithEndUserAccountRequest.Builder walletSecretId(String walletSecretId) { + this.instance.walletSecretId = walletSecretId; + return this; + } + public SendSolanaAssetWithEndUserAccountRequest.Builder useCdpSponsor(Boolean useCdpSponsor) { + this.instance.useCdpSponsor = useCdpSponsor; + return this; + } + + + /** + * returns a built SendSolanaAssetWithEndUserAccountRequest instance. + * + * The builder is not reusable. + */ + public SendSolanaAssetWithEndUserAccountRequest build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SendSolanaAssetWithEndUserAccountRequest.Builder builder() { + return new SendSolanaAssetWithEndUserAccountRequest.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SendSolanaAssetWithEndUserAccountRequest.Builder toBuilder() { + return new SendSolanaAssetWithEndUserAccountRequest.Builder() + .to(getTo()) + .amount(getAmount()) + .network(getNetwork()) + .createRecipientAta(getCreateRecipientAta()) + .walletSecretId(getWalletSecretId()) + .useCdpSponsor(getUseCdpSponsor()); + } + +} + diff --git a/java/src/main/java/com/coinbase/cdp/openapi/model/SendSolanaTransactionWithEndUserAccount200Response.java b/java/src/main/java/com/coinbase/cdp/openapi/model/SendSolanaTransactionWithEndUserAccount200Response.java new file mode 100644 index 000000000..0a4d61a39 --- /dev/null +++ b/java/src/main/java/com/coinbase/cdp/openapi/model/SendSolanaTransactionWithEndUserAccount200Response.java @@ -0,0 +1,205 @@ +/* + * Coinbase Developer Platform APIs + * The Coinbase Developer Platform APIs - leading the world's transition onchain. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: cdp@coinbase.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.coinbase.cdp.openapi.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.coinbase.cdp.openapi.ApiClient; +/** + * SendSolanaTransactionWithEndUserAccount200Response + */ +@JsonPropertyOrder({ + SendSolanaTransactionWithEndUserAccount200Response.JSON_PROPERTY_TRANSACTION_SIGNATURE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class SendSolanaTransactionWithEndUserAccount200Response { + public static final String JSON_PROPERTY_TRANSACTION_SIGNATURE = "transactionSignature"; + @jakarta.annotation.Nonnull + private String transactionSignature; + + public SendSolanaTransactionWithEndUserAccount200Response() { + } + + public SendSolanaTransactionWithEndUserAccount200Response transactionSignature(@jakarta.annotation.Nonnull String transactionSignature) { + this.transactionSignature = transactionSignature; + return this; + } + + /** + * The base58 encoded transaction signature. + * @return transactionSignature + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TRANSACTION_SIGNATURE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTransactionSignature() { + return transactionSignature; + } + + + @JsonProperty(JSON_PROPERTY_TRANSACTION_SIGNATURE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTransactionSignature(@jakarta.annotation.Nonnull String transactionSignature) { + this.transactionSignature = transactionSignature; + } + + + /** + * Return true if this sendSolanaTransactionWithEndUserAccount_200_response object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SendSolanaTransactionWithEndUserAccount200Response sendSolanaTransactionWithEndUserAccount200Response = (SendSolanaTransactionWithEndUserAccount200Response) o; + return Objects.equals(this.transactionSignature, sendSolanaTransactionWithEndUserAccount200Response.transactionSignature); + } + + @Override + public int hashCode() { + return Objects.hash(transactionSignature); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SendSolanaTransactionWithEndUserAccount200Response {\n"); + sb.append(" transactionSignature: ").append(toIndentedString(transactionSignature)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `transactionSignature` to the URL query string + if (getTransactionSignature() != null) { + joiner.add(String.format("%stransactionSignature%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getTransactionSignature()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SendSolanaTransactionWithEndUserAccount200Response instance; + + public Builder() { + this(new SendSolanaTransactionWithEndUserAccount200Response()); + } + + protected Builder(SendSolanaTransactionWithEndUserAccount200Response instance) { + this.instance = instance; + } + + public SendSolanaTransactionWithEndUserAccount200Response.Builder transactionSignature(String transactionSignature) { + this.instance.transactionSignature = transactionSignature; + return this; + } + + + /** + * returns a built SendSolanaTransactionWithEndUserAccount200Response instance. + * + * The builder is not reusable. + */ + public SendSolanaTransactionWithEndUserAccount200Response build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SendSolanaTransactionWithEndUserAccount200Response.Builder builder() { + return new SendSolanaTransactionWithEndUserAccount200Response.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SendSolanaTransactionWithEndUserAccount200Response.Builder toBuilder() { + return new SendSolanaTransactionWithEndUserAccount200Response.Builder() + .transactionSignature(getTransactionSignature()); + } + +} + diff --git a/java/src/main/java/com/coinbase/cdp/openapi/model/SendSolanaTransactionWithEndUserAccountRequest.java b/java/src/main/java/com/coinbase/cdp/openapi/model/SendSolanaTransactionWithEndUserAccountRequest.java new file mode 100644 index 000000000..35c5a17c2 --- /dev/null +++ b/java/src/main/java/com/coinbase/cdp/openapi/model/SendSolanaTransactionWithEndUserAccountRequest.java @@ -0,0 +1,404 @@ +/* + * Coinbase Developer Platform APIs + * The Coinbase Developer Platform APIs - leading the world's transition onchain. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: cdp@coinbase.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.coinbase.cdp.openapi.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.coinbase.cdp.openapi.ApiClient; +/** + * SendSolanaTransactionWithEndUserAccountRequest + */ +@JsonPropertyOrder({ + SendSolanaTransactionWithEndUserAccountRequest.JSON_PROPERTY_ADDRESS, + SendSolanaTransactionWithEndUserAccountRequest.JSON_PROPERTY_NETWORK, + SendSolanaTransactionWithEndUserAccountRequest.JSON_PROPERTY_WALLET_SECRET_ID, + SendSolanaTransactionWithEndUserAccountRequest.JSON_PROPERTY_TRANSACTION, + SendSolanaTransactionWithEndUserAccountRequest.JSON_PROPERTY_USE_CDP_SPONSOR +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class SendSolanaTransactionWithEndUserAccountRequest { + public static final String JSON_PROPERTY_ADDRESS = "address"; + @jakarta.annotation.Nonnull + private String address; + + /** + * The Solana network to send the transaction to. + */ + public enum NetworkEnum { + SOLANA(String.valueOf("solana")), + + SOLANA_DEVNET(String.valueOf("solana-devnet")); + + private String value; + + NetworkEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static NetworkEnum fromValue(String value) { + for (NetworkEnum b : NetworkEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_NETWORK = "network"; + @jakarta.annotation.Nonnull + private NetworkEnum network; + + public static final String JSON_PROPERTY_WALLET_SECRET_ID = "walletSecretId"; + @jakarta.annotation.Nullable + private String walletSecretId; + + public static final String JSON_PROPERTY_TRANSACTION = "transaction"; + @jakarta.annotation.Nonnull + private String transaction; + + public static final String JSON_PROPERTY_USE_CDP_SPONSOR = "useCdpSponsor"; + @jakarta.annotation.Nullable + private Boolean useCdpSponsor; + + public SendSolanaTransactionWithEndUserAccountRequest() { + } + + public SendSolanaTransactionWithEndUserAccountRequest address(@jakarta.annotation.Nonnull String address) { + this.address = address; + return this; + } + + /** + * The base58 encoded address of the Solana account belonging to the end user. + * @return address + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getAddress() { + return address; + } + + + @JsonProperty(JSON_PROPERTY_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setAddress(@jakarta.annotation.Nonnull String address) { + this.address = address; + } + + + public SendSolanaTransactionWithEndUserAccountRequest network(@jakarta.annotation.Nonnull NetworkEnum network) { + this.network = network; + return this; + } + + /** + * The Solana network to send the transaction to. + * @return network + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NETWORK) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public NetworkEnum getNetwork() { + return network; + } + + + @JsonProperty(JSON_PROPERTY_NETWORK) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setNetwork(@jakarta.annotation.Nonnull NetworkEnum network) { + this.network = network; + } + + + public SendSolanaTransactionWithEndUserAccountRequest walletSecretId(@jakarta.annotation.Nullable String walletSecretId) { + this.walletSecretId = walletSecretId; + return this; + } + + /** + * Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header. + * @return walletSecretId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WALLET_SECRET_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getWalletSecretId() { + return walletSecretId; + } + + + @JsonProperty(JSON_PROPERTY_WALLET_SECRET_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWalletSecretId(@jakarta.annotation.Nullable String walletSecretId) { + this.walletSecretId = walletSecretId; + } + + + public SendSolanaTransactionWithEndUserAccountRequest transaction(@jakarta.annotation.Nonnull String transaction) { + this.transaction = transaction; + return this; + } + + /** + * The base64 encoded transaction to sign and send. This transaction can contain multiple instructions for native Solana batching. + * @return transaction + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TRANSACTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTransaction() { + return transaction; + } + + + @JsonProperty(JSON_PROPERTY_TRANSACTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTransaction(@jakarta.annotation.Nonnull String transaction) { + this.transaction = transaction; + } + + + public SendSolanaTransactionWithEndUserAccountRequest useCdpSponsor(@jakarta.annotation.Nullable Boolean useCdpSponsor) { + this.useCdpSponsor = useCdpSponsor; + return this; + } + + /** + * Whether transaction fees should be sponsored by CDP. When true, CDP sponsors the transaction fees on behalf of the end user. When false, the end user is responsible for paying the transaction fees. + * @return useCdpSponsor + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USE_CDP_SPONSOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getUseCdpSponsor() { + return useCdpSponsor; + } + + + @JsonProperty(JSON_PROPERTY_USE_CDP_SPONSOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUseCdpSponsor(@jakarta.annotation.Nullable Boolean useCdpSponsor) { + this.useCdpSponsor = useCdpSponsor; + } + + + /** + * Return true if this sendSolanaTransactionWithEndUserAccount_request object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SendSolanaTransactionWithEndUserAccountRequest sendSolanaTransactionWithEndUserAccountRequest = (SendSolanaTransactionWithEndUserAccountRequest) o; + return Objects.equals(this.address, sendSolanaTransactionWithEndUserAccountRequest.address) && + Objects.equals(this.network, sendSolanaTransactionWithEndUserAccountRequest.network) && + Objects.equals(this.walletSecretId, sendSolanaTransactionWithEndUserAccountRequest.walletSecretId) && + Objects.equals(this.transaction, sendSolanaTransactionWithEndUserAccountRequest.transaction) && + Objects.equals(this.useCdpSponsor, sendSolanaTransactionWithEndUserAccountRequest.useCdpSponsor); + } + + @Override + public int hashCode() { + return Objects.hash(address, network, walletSecretId, transaction, useCdpSponsor); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SendSolanaTransactionWithEndUserAccountRequest {\n"); + sb.append(" address: ").append(toIndentedString(address)).append("\n"); + sb.append(" network: ").append(toIndentedString(network)).append("\n"); + sb.append(" walletSecretId: ").append(toIndentedString(walletSecretId)).append("\n"); + sb.append(" transaction: ").append(toIndentedString(transaction)).append("\n"); + sb.append(" useCdpSponsor: ").append(toIndentedString(useCdpSponsor)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `address` to the URL query string + if (getAddress() != null) { + joiner.add(String.format("%saddress%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getAddress()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `network` to the URL query string + if (getNetwork() != null) { + joiner.add(String.format("%snetwork%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getNetwork()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `walletSecretId` to the URL query string + if (getWalletSecretId() != null) { + joiner.add(String.format("%swalletSecretId%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getWalletSecretId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `transaction` to the URL query string + if (getTransaction() != null) { + joiner.add(String.format("%stransaction%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getTransaction()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `useCdpSponsor` to the URL query string + if (getUseCdpSponsor() != null) { + joiner.add(String.format("%suseCdpSponsor%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getUseCdpSponsor()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SendSolanaTransactionWithEndUserAccountRequest instance; + + public Builder() { + this(new SendSolanaTransactionWithEndUserAccountRequest()); + } + + protected Builder(SendSolanaTransactionWithEndUserAccountRequest instance) { + this.instance = instance; + } + + public SendSolanaTransactionWithEndUserAccountRequest.Builder address(String address) { + this.instance.address = address; + return this; + } + public SendSolanaTransactionWithEndUserAccountRequest.Builder network(NetworkEnum network) { + this.instance.network = network; + return this; + } + public SendSolanaTransactionWithEndUserAccountRequest.Builder walletSecretId(String walletSecretId) { + this.instance.walletSecretId = walletSecretId; + return this; + } + public SendSolanaTransactionWithEndUserAccountRequest.Builder transaction(String transaction) { + this.instance.transaction = transaction; + return this; + } + public SendSolanaTransactionWithEndUserAccountRequest.Builder useCdpSponsor(Boolean useCdpSponsor) { + this.instance.useCdpSponsor = useCdpSponsor; + return this; + } + + + /** + * returns a built SendSolanaTransactionWithEndUserAccountRequest instance. + * + * The builder is not reusable. + */ + public SendSolanaTransactionWithEndUserAccountRequest build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SendSolanaTransactionWithEndUserAccountRequest.Builder builder() { + return new SendSolanaTransactionWithEndUserAccountRequest.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SendSolanaTransactionWithEndUserAccountRequest.Builder toBuilder() { + return new SendSolanaTransactionWithEndUserAccountRequest.Builder() + .address(getAddress()) + .network(getNetwork()) + .walletSecretId(getWalletSecretId()) + .transaction(getTransaction()) + .useCdpSponsor(getUseCdpSponsor()); + } + +} + diff --git a/java/src/main/java/com/coinbase/cdp/openapi/model/SendUserOperationWithEndUserAccountRequest.java b/java/src/main/java/com/coinbase/cdp/openapi/model/SendUserOperationWithEndUserAccountRequest.java new file mode 100644 index 000000000..7787e3830 --- /dev/null +++ b/java/src/main/java/com/coinbase/cdp/openapi/model/SendUserOperationWithEndUserAccountRequest.java @@ -0,0 +1,428 @@ +/* + * Coinbase Developer Platform APIs + * The Coinbase Developer Platform APIs - leading the world's transition onchain. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: cdp@coinbase.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.coinbase.cdp.openapi.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.coinbase.cdp.openapi.model.EvmCall; +import com.coinbase.cdp.openapi.model.EvmUserOperationNetwork; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.net.URI; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.coinbase.cdp.openapi.ApiClient; +/** + * SendUserOperationWithEndUserAccountRequest + */ +@JsonPropertyOrder({ + SendUserOperationWithEndUserAccountRequest.JSON_PROPERTY_NETWORK, + SendUserOperationWithEndUserAccountRequest.JSON_PROPERTY_CALLS, + SendUserOperationWithEndUserAccountRequest.JSON_PROPERTY_USE_CDP_PAYMASTER, + SendUserOperationWithEndUserAccountRequest.JSON_PROPERTY_PAYMASTER_URL, + SendUserOperationWithEndUserAccountRequest.JSON_PROPERTY_WALLET_SECRET_ID, + SendUserOperationWithEndUserAccountRequest.JSON_PROPERTY_DATA_SUFFIX +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class SendUserOperationWithEndUserAccountRequest { + public static final String JSON_PROPERTY_NETWORK = "network"; + @jakarta.annotation.Nonnull + private EvmUserOperationNetwork network; + + public static final String JSON_PROPERTY_CALLS = "calls"; + @jakarta.annotation.Nonnull + private List calls = new ArrayList<>(); + + public static final String JSON_PROPERTY_USE_CDP_PAYMASTER = "useCdpPaymaster"; + @jakarta.annotation.Nonnull + private Boolean useCdpPaymaster; + + public static final String JSON_PROPERTY_PAYMASTER_URL = "paymasterUrl"; + @jakarta.annotation.Nullable + private URI paymasterUrl; + + public static final String JSON_PROPERTY_WALLET_SECRET_ID = "walletSecretId"; + @jakarta.annotation.Nullable + private String walletSecretId; + + public static final String JSON_PROPERTY_DATA_SUFFIX = "dataSuffix"; + @jakarta.annotation.Nullable + private String dataSuffix; + + public SendUserOperationWithEndUserAccountRequest() { + } + + public SendUserOperationWithEndUserAccountRequest network(@jakarta.annotation.Nonnull EvmUserOperationNetwork network) { + this.network = network; + return this; + } + + /** + * Get network + * @return network + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NETWORK) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public EvmUserOperationNetwork getNetwork() { + return network; + } + + + @JsonProperty(JSON_PROPERTY_NETWORK) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setNetwork(@jakarta.annotation.Nonnull EvmUserOperationNetwork network) { + this.network = network; + } + + + public SendUserOperationWithEndUserAccountRequest calls(@jakarta.annotation.Nonnull List calls) { + this.calls = calls; + return this; + } + + public SendUserOperationWithEndUserAccountRequest addCallsItem(EvmCall callsItem) { + if (this.calls == null) { + this.calls = new ArrayList<>(); + } + this.calls.add(callsItem); + return this; + } + + /** + * The list of calls to make from the Smart Account. + * @return calls + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CALLS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getCalls() { + return calls; + } + + + @JsonProperty(JSON_PROPERTY_CALLS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCalls(@jakarta.annotation.Nonnull List calls) { + this.calls = calls; + } + + + public SendUserOperationWithEndUserAccountRequest useCdpPaymaster(@jakarta.annotation.Nonnull Boolean useCdpPaymaster) { + this.useCdpPaymaster = useCdpPaymaster; + return this; + } + + /** + * Whether to use the CDP Paymaster for the user operation. + * @return useCdpPaymaster + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_USE_CDP_PAYMASTER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getUseCdpPaymaster() { + return useCdpPaymaster; + } + + + @JsonProperty(JSON_PROPERTY_USE_CDP_PAYMASTER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setUseCdpPaymaster(@jakarta.annotation.Nonnull Boolean useCdpPaymaster) { + this.useCdpPaymaster = useCdpPaymaster; + } + + + public SendUserOperationWithEndUserAccountRequest paymasterUrl(@jakarta.annotation.Nullable URI paymasterUrl) { + this.paymasterUrl = paymasterUrl; + return this; + } + + /** + * The URL of the paymaster to use for the user operation. If using the CDP Paymaster, use the `useCdpPaymaster` option. + * @return paymasterUrl + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PAYMASTER_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public URI getPaymasterUrl() { + return paymasterUrl; + } + + + @JsonProperty(JSON_PROPERTY_PAYMASTER_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPaymasterUrl(@jakarta.annotation.Nullable URI paymasterUrl) { + this.paymasterUrl = paymasterUrl; + } + + + public SendUserOperationWithEndUserAccountRequest walletSecretId(@jakarta.annotation.Nullable String walletSecretId) { + this.walletSecretId = walletSecretId; + return this; + } + + /** + * Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header. + * @return walletSecretId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WALLET_SECRET_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getWalletSecretId() { + return walletSecretId; + } + + + @JsonProperty(JSON_PROPERTY_WALLET_SECRET_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWalletSecretId(@jakarta.annotation.Nullable String walletSecretId) { + this.walletSecretId = walletSecretId; + } + + + public SendUserOperationWithEndUserAccountRequest dataSuffix(@jakarta.annotation.Nullable String dataSuffix) { + this.dataSuffix = dataSuffix; + return this; + } + + /** + * The EIP-8021 data suffix (hex-encoded) that enables transaction attribution for the user operation. + * @return dataSuffix + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA_SUFFIX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDataSuffix() { + return dataSuffix; + } + + + @JsonProperty(JSON_PROPERTY_DATA_SUFFIX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDataSuffix(@jakarta.annotation.Nullable String dataSuffix) { + this.dataSuffix = dataSuffix; + } + + + /** + * Return true if this sendUserOperationWithEndUserAccount_request object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SendUserOperationWithEndUserAccountRequest sendUserOperationWithEndUserAccountRequest = (SendUserOperationWithEndUserAccountRequest) o; + return Objects.equals(this.network, sendUserOperationWithEndUserAccountRequest.network) && + Objects.equals(this.calls, sendUserOperationWithEndUserAccountRequest.calls) && + Objects.equals(this.useCdpPaymaster, sendUserOperationWithEndUserAccountRequest.useCdpPaymaster) && + Objects.equals(this.paymasterUrl, sendUserOperationWithEndUserAccountRequest.paymasterUrl) && + Objects.equals(this.walletSecretId, sendUserOperationWithEndUserAccountRequest.walletSecretId) && + Objects.equals(this.dataSuffix, sendUserOperationWithEndUserAccountRequest.dataSuffix); + } + + @Override + public int hashCode() { + return Objects.hash(network, calls, useCdpPaymaster, paymasterUrl, walletSecretId, dataSuffix); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SendUserOperationWithEndUserAccountRequest {\n"); + sb.append(" network: ").append(toIndentedString(network)).append("\n"); + sb.append(" calls: ").append(toIndentedString(calls)).append("\n"); + sb.append(" useCdpPaymaster: ").append(toIndentedString(useCdpPaymaster)).append("\n"); + sb.append(" paymasterUrl: ").append(toIndentedString(paymasterUrl)).append("\n"); + sb.append(" walletSecretId: ").append(toIndentedString(walletSecretId)).append("\n"); + sb.append(" dataSuffix: ").append(toIndentedString(dataSuffix)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `network` to the URL query string + if (getNetwork() != null) { + joiner.add(String.format("%snetwork%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getNetwork()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `calls` to the URL query string + if (getCalls() != null) { + for (int i = 0; i < getCalls().size(); i++) { + if (getCalls().get(i) != null) { + joiner.add(getCalls().get(i).toUrlQueryString(String.format("%scalls%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `useCdpPaymaster` to the URL query string + if (getUseCdpPaymaster() != null) { + joiner.add(String.format("%suseCdpPaymaster%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getUseCdpPaymaster()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `paymasterUrl` to the URL query string + if (getPaymasterUrl() != null) { + joiner.add(String.format("%spaymasterUrl%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getPaymasterUrl()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `walletSecretId` to the URL query string + if (getWalletSecretId() != null) { + joiner.add(String.format("%swalletSecretId%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getWalletSecretId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `dataSuffix` to the URL query string + if (getDataSuffix() != null) { + joiner.add(String.format("%sdataSuffix%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getDataSuffix()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SendUserOperationWithEndUserAccountRequest instance; + + public Builder() { + this(new SendUserOperationWithEndUserAccountRequest()); + } + + protected Builder(SendUserOperationWithEndUserAccountRequest instance) { + this.instance = instance; + } + + public SendUserOperationWithEndUserAccountRequest.Builder network(EvmUserOperationNetwork network) { + this.instance.network = network; + return this; + } + public SendUserOperationWithEndUserAccountRequest.Builder calls(List calls) { + this.instance.calls = calls; + return this; + } + public SendUserOperationWithEndUserAccountRequest.Builder useCdpPaymaster(Boolean useCdpPaymaster) { + this.instance.useCdpPaymaster = useCdpPaymaster; + return this; + } + public SendUserOperationWithEndUserAccountRequest.Builder paymasterUrl(URI paymasterUrl) { + this.instance.paymasterUrl = paymasterUrl; + return this; + } + public SendUserOperationWithEndUserAccountRequest.Builder walletSecretId(String walletSecretId) { + this.instance.walletSecretId = walletSecretId; + return this; + } + public SendUserOperationWithEndUserAccountRequest.Builder dataSuffix(String dataSuffix) { + this.instance.dataSuffix = dataSuffix; + return this; + } + + + /** + * returns a built SendUserOperationWithEndUserAccountRequest instance. + * + * The builder is not reusable. + */ + public SendUserOperationWithEndUserAccountRequest build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SendUserOperationWithEndUserAccountRequest.Builder builder() { + return new SendUserOperationWithEndUserAccountRequest.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SendUserOperationWithEndUserAccountRequest.Builder toBuilder() { + return new SendUserOperationWithEndUserAccountRequest.Builder() + .network(getNetwork()) + .calls(getCalls()) + .useCdpPaymaster(getUseCdpPaymaster()) + .paymasterUrl(getPaymasterUrl()) + .walletSecretId(getWalletSecretId()) + .dataSuffix(getDataSuffix()); + } + +} + diff --git a/java/src/main/java/com/coinbase/cdp/openapi/model/SignEvmHashWithEndUserAccount200Response.java b/java/src/main/java/com/coinbase/cdp/openapi/model/SignEvmHashWithEndUserAccount200Response.java new file mode 100644 index 000000000..d6406dfd5 --- /dev/null +++ b/java/src/main/java/com/coinbase/cdp/openapi/model/SignEvmHashWithEndUserAccount200Response.java @@ -0,0 +1,205 @@ +/* + * Coinbase Developer Platform APIs + * The Coinbase Developer Platform APIs - leading the world's transition onchain. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: cdp@coinbase.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.coinbase.cdp.openapi.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.coinbase.cdp.openapi.ApiClient; +/** + * SignEvmHashWithEndUserAccount200Response + */ +@JsonPropertyOrder({ + SignEvmHashWithEndUserAccount200Response.JSON_PROPERTY_SIGNATURE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class SignEvmHashWithEndUserAccount200Response { + public static final String JSON_PROPERTY_SIGNATURE = "signature"; + @jakarta.annotation.Nonnull + private String signature; + + public SignEvmHashWithEndUserAccount200Response() { + } + + public SignEvmHashWithEndUserAccount200Response signature(@jakarta.annotation.Nonnull String signature) { + this.signature = signature; + return this; + } + + /** + * The signature of the hash, as a 0x-prefixed hex string. + * @return signature + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SIGNATURE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getSignature() { + return signature; + } + + + @JsonProperty(JSON_PROPERTY_SIGNATURE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSignature(@jakarta.annotation.Nonnull String signature) { + this.signature = signature; + } + + + /** + * Return true if this signEvmHashWithEndUserAccount_200_response object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SignEvmHashWithEndUserAccount200Response signEvmHashWithEndUserAccount200Response = (SignEvmHashWithEndUserAccount200Response) o; + return Objects.equals(this.signature, signEvmHashWithEndUserAccount200Response.signature); + } + + @Override + public int hashCode() { + return Objects.hash(signature); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignEvmHashWithEndUserAccount200Response {\n"); + sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `signature` to the URL query string + if (getSignature() != null) { + joiner.add(String.format("%ssignature%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getSignature()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SignEvmHashWithEndUserAccount200Response instance; + + public Builder() { + this(new SignEvmHashWithEndUserAccount200Response()); + } + + protected Builder(SignEvmHashWithEndUserAccount200Response instance) { + this.instance = instance; + } + + public SignEvmHashWithEndUserAccount200Response.Builder signature(String signature) { + this.instance.signature = signature; + return this; + } + + + /** + * returns a built SignEvmHashWithEndUserAccount200Response instance. + * + * The builder is not reusable. + */ + public SignEvmHashWithEndUserAccount200Response build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SignEvmHashWithEndUserAccount200Response.Builder builder() { + return new SignEvmHashWithEndUserAccount200Response.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SignEvmHashWithEndUserAccount200Response.Builder toBuilder() { + return new SignEvmHashWithEndUserAccount200Response.Builder() + .signature(getSignature()); + } + +} + diff --git a/java/src/main/java/com/coinbase/cdp/openapi/model/SignEvmHashWithEndUserAccountRequest.java b/java/src/main/java/com/coinbase/cdp/openapi/model/SignEvmHashWithEndUserAccountRequest.java new file mode 100644 index 000000000..64c37e999 --- /dev/null +++ b/java/src/main/java/com/coinbase/cdp/openapi/model/SignEvmHashWithEndUserAccountRequest.java @@ -0,0 +1,287 @@ +/* + * Coinbase Developer Platform APIs + * The Coinbase Developer Platform APIs - leading the world's transition onchain. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: cdp@coinbase.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.coinbase.cdp.openapi.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.coinbase.cdp.openapi.ApiClient; +/** + * SignEvmHashWithEndUserAccountRequest + */ +@JsonPropertyOrder({ + SignEvmHashWithEndUserAccountRequest.JSON_PROPERTY_HASH, + SignEvmHashWithEndUserAccountRequest.JSON_PROPERTY_ADDRESS, + SignEvmHashWithEndUserAccountRequest.JSON_PROPERTY_WALLET_SECRET_ID +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class SignEvmHashWithEndUserAccountRequest { + public static final String JSON_PROPERTY_HASH = "hash"; + @jakarta.annotation.Nonnull + private String hash; + + public static final String JSON_PROPERTY_ADDRESS = "address"; + @jakarta.annotation.Nonnull + private String address; + + public static final String JSON_PROPERTY_WALLET_SECRET_ID = "walletSecretId"; + @jakarta.annotation.Nullable + private String walletSecretId; + + public SignEvmHashWithEndUserAccountRequest() { + } + + public SignEvmHashWithEndUserAccountRequest hash(@jakarta.annotation.Nonnull String hash) { + this.hash = hash; + return this; + } + + /** + * The arbitrary 32 byte hash to sign. + * @return hash + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_HASH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getHash() { + return hash; + } + + + @JsonProperty(JSON_PROPERTY_HASH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setHash(@jakarta.annotation.Nonnull String hash) { + this.hash = hash; + } + + + public SignEvmHashWithEndUserAccountRequest address(@jakarta.annotation.Nonnull String address) { + this.address = address; + return this; + } + + /** + * The 0x-prefixed address of the EVM account belonging to the end user. + * @return address + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getAddress() { + return address; + } + + + @JsonProperty(JSON_PROPERTY_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setAddress(@jakarta.annotation.Nonnull String address) { + this.address = address; + } + + + public SignEvmHashWithEndUserAccountRequest walletSecretId(@jakarta.annotation.Nullable String walletSecretId) { + this.walletSecretId = walletSecretId; + return this; + } + + /** + * Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header. + * @return walletSecretId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WALLET_SECRET_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getWalletSecretId() { + return walletSecretId; + } + + + @JsonProperty(JSON_PROPERTY_WALLET_SECRET_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWalletSecretId(@jakarta.annotation.Nullable String walletSecretId) { + this.walletSecretId = walletSecretId; + } + + + /** + * Return true if this signEvmHashWithEndUserAccount_request object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SignEvmHashWithEndUserAccountRequest signEvmHashWithEndUserAccountRequest = (SignEvmHashWithEndUserAccountRequest) o; + return Objects.equals(this.hash, signEvmHashWithEndUserAccountRequest.hash) && + Objects.equals(this.address, signEvmHashWithEndUserAccountRequest.address) && + Objects.equals(this.walletSecretId, signEvmHashWithEndUserAccountRequest.walletSecretId); + } + + @Override + public int hashCode() { + return Objects.hash(hash, address, walletSecretId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignEvmHashWithEndUserAccountRequest {\n"); + sb.append(" hash: ").append(toIndentedString(hash)).append("\n"); + sb.append(" address: ").append(toIndentedString(address)).append("\n"); + sb.append(" walletSecretId: ").append(toIndentedString(walletSecretId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `hash` to the URL query string + if (getHash() != null) { + joiner.add(String.format("%shash%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getHash()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `address` to the URL query string + if (getAddress() != null) { + joiner.add(String.format("%saddress%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getAddress()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `walletSecretId` to the URL query string + if (getWalletSecretId() != null) { + joiner.add(String.format("%swalletSecretId%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getWalletSecretId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SignEvmHashWithEndUserAccountRequest instance; + + public Builder() { + this(new SignEvmHashWithEndUserAccountRequest()); + } + + protected Builder(SignEvmHashWithEndUserAccountRequest instance) { + this.instance = instance; + } + + public SignEvmHashWithEndUserAccountRequest.Builder hash(String hash) { + this.instance.hash = hash; + return this; + } + public SignEvmHashWithEndUserAccountRequest.Builder address(String address) { + this.instance.address = address; + return this; + } + public SignEvmHashWithEndUserAccountRequest.Builder walletSecretId(String walletSecretId) { + this.instance.walletSecretId = walletSecretId; + return this; + } + + + /** + * returns a built SignEvmHashWithEndUserAccountRequest instance. + * + * The builder is not reusable. + */ + public SignEvmHashWithEndUserAccountRequest build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SignEvmHashWithEndUserAccountRequest.Builder builder() { + return new SignEvmHashWithEndUserAccountRequest.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SignEvmHashWithEndUserAccountRequest.Builder toBuilder() { + return new SignEvmHashWithEndUserAccountRequest.Builder() + .hash(getHash()) + .address(getAddress()) + .walletSecretId(getWalletSecretId()); + } + +} + diff --git a/java/src/main/java/com/coinbase/cdp/openapi/model/SignEvmMessageWithEndUserAccount200Response.java b/java/src/main/java/com/coinbase/cdp/openapi/model/SignEvmMessageWithEndUserAccount200Response.java new file mode 100644 index 000000000..9afc0a89a --- /dev/null +++ b/java/src/main/java/com/coinbase/cdp/openapi/model/SignEvmMessageWithEndUserAccount200Response.java @@ -0,0 +1,205 @@ +/* + * Coinbase Developer Platform APIs + * The Coinbase Developer Platform APIs - leading the world's transition onchain. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: cdp@coinbase.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.coinbase.cdp.openapi.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.coinbase.cdp.openapi.ApiClient; +/** + * SignEvmMessageWithEndUserAccount200Response + */ +@JsonPropertyOrder({ + SignEvmMessageWithEndUserAccount200Response.JSON_PROPERTY_SIGNATURE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class SignEvmMessageWithEndUserAccount200Response { + public static final String JSON_PROPERTY_SIGNATURE = "signature"; + @jakarta.annotation.Nonnull + private String signature; + + public SignEvmMessageWithEndUserAccount200Response() { + } + + public SignEvmMessageWithEndUserAccount200Response signature(@jakarta.annotation.Nonnull String signature) { + this.signature = signature; + return this; + } + + /** + * The signature of the message, as a 0x-prefixed hex string. + * @return signature + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SIGNATURE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getSignature() { + return signature; + } + + + @JsonProperty(JSON_PROPERTY_SIGNATURE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSignature(@jakarta.annotation.Nonnull String signature) { + this.signature = signature; + } + + + /** + * Return true if this signEvmMessageWithEndUserAccount_200_response object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SignEvmMessageWithEndUserAccount200Response signEvmMessageWithEndUserAccount200Response = (SignEvmMessageWithEndUserAccount200Response) o; + return Objects.equals(this.signature, signEvmMessageWithEndUserAccount200Response.signature); + } + + @Override + public int hashCode() { + return Objects.hash(signature); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignEvmMessageWithEndUserAccount200Response {\n"); + sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `signature` to the URL query string + if (getSignature() != null) { + joiner.add(String.format("%ssignature%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getSignature()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SignEvmMessageWithEndUserAccount200Response instance; + + public Builder() { + this(new SignEvmMessageWithEndUserAccount200Response()); + } + + protected Builder(SignEvmMessageWithEndUserAccount200Response instance) { + this.instance = instance; + } + + public SignEvmMessageWithEndUserAccount200Response.Builder signature(String signature) { + this.instance.signature = signature; + return this; + } + + + /** + * returns a built SignEvmMessageWithEndUserAccount200Response instance. + * + * The builder is not reusable. + */ + public SignEvmMessageWithEndUserAccount200Response build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SignEvmMessageWithEndUserAccount200Response.Builder builder() { + return new SignEvmMessageWithEndUserAccount200Response.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SignEvmMessageWithEndUserAccount200Response.Builder toBuilder() { + return new SignEvmMessageWithEndUserAccount200Response.Builder() + .signature(getSignature()); + } + +} + diff --git a/java/src/main/java/com/coinbase/cdp/openapi/model/SignEvmMessageWithEndUserAccountRequest.java b/java/src/main/java/com/coinbase/cdp/openapi/model/SignEvmMessageWithEndUserAccountRequest.java new file mode 100644 index 000000000..5dc13aa95 --- /dev/null +++ b/java/src/main/java/com/coinbase/cdp/openapi/model/SignEvmMessageWithEndUserAccountRequest.java @@ -0,0 +1,287 @@ +/* + * Coinbase Developer Platform APIs + * The Coinbase Developer Platform APIs - leading the world's transition onchain. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: cdp@coinbase.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.coinbase.cdp.openapi.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.coinbase.cdp.openapi.ApiClient; +/** + * SignEvmMessageWithEndUserAccountRequest + */ +@JsonPropertyOrder({ + SignEvmMessageWithEndUserAccountRequest.JSON_PROPERTY_ADDRESS, + SignEvmMessageWithEndUserAccountRequest.JSON_PROPERTY_MESSAGE, + SignEvmMessageWithEndUserAccountRequest.JSON_PROPERTY_WALLET_SECRET_ID +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class SignEvmMessageWithEndUserAccountRequest { + public static final String JSON_PROPERTY_ADDRESS = "address"; + @jakarta.annotation.Nonnull + private String address; + + public static final String JSON_PROPERTY_MESSAGE = "message"; + @jakarta.annotation.Nonnull + private String message; + + public static final String JSON_PROPERTY_WALLET_SECRET_ID = "walletSecretId"; + @jakarta.annotation.Nullable + private String walletSecretId; + + public SignEvmMessageWithEndUserAccountRequest() { + } + + public SignEvmMessageWithEndUserAccountRequest address(@jakarta.annotation.Nonnull String address) { + this.address = address; + return this; + } + + /** + * The 0x-prefixed address of the EVM account belonging to the end user. + * @return address + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getAddress() { + return address; + } + + + @JsonProperty(JSON_PROPERTY_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setAddress(@jakarta.annotation.Nonnull String address) { + this.address = address; + } + + + public SignEvmMessageWithEndUserAccountRequest message(@jakarta.annotation.Nonnull String message) { + this.message = message; + return this; + } + + /** + * The message to sign. + * @return message + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getMessage() { + return message; + } + + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setMessage(@jakarta.annotation.Nonnull String message) { + this.message = message; + } + + + public SignEvmMessageWithEndUserAccountRequest walletSecretId(@jakarta.annotation.Nullable String walletSecretId) { + this.walletSecretId = walletSecretId; + return this; + } + + /** + * Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header. + * @return walletSecretId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WALLET_SECRET_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getWalletSecretId() { + return walletSecretId; + } + + + @JsonProperty(JSON_PROPERTY_WALLET_SECRET_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWalletSecretId(@jakarta.annotation.Nullable String walletSecretId) { + this.walletSecretId = walletSecretId; + } + + + /** + * Return true if this signEvmMessageWithEndUserAccount_request object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SignEvmMessageWithEndUserAccountRequest signEvmMessageWithEndUserAccountRequest = (SignEvmMessageWithEndUserAccountRequest) o; + return Objects.equals(this.address, signEvmMessageWithEndUserAccountRequest.address) && + Objects.equals(this.message, signEvmMessageWithEndUserAccountRequest.message) && + Objects.equals(this.walletSecretId, signEvmMessageWithEndUserAccountRequest.walletSecretId); + } + + @Override + public int hashCode() { + return Objects.hash(address, message, walletSecretId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignEvmMessageWithEndUserAccountRequest {\n"); + sb.append(" address: ").append(toIndentedString(address)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" walletSecretId: ").append(toIndentedString(walletSecretId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `address` to the URL query string + if (getAddress() != null) { + joiner.add(String.format("%saddress%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getAddress()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `message` to the URL query string + if (getMessage() != null) { + joiner.add(String.format("%smessage%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getMessage()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `walletSecretId` to the URL query string + if (getWalletSecretId() != null) { + joiner.add(String.format("%swalletSecretId%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getWalletSecretId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SignEvmMessageWithEndUserAccountRequest instance; + + public Builder() { + this(new SignEvmMessageWithEndUserAccountRequest()); + } + + protected Builder(SignEvmMessageWithEndUserAccountRequest instance) { + this.instance = instance; + } + + public SignEvmMessageWithEndUserAccountRequest.Builder address(String address) { + this.instance.address = address; + return this; + } + public SignEvmMessageWithEndUserAccountRequest.Builder message(String message) { + this.instance.message = message; + return this; + } + public SignEvmMessageWithEndUserAccountRequest.Builder walletSecretId(String walletSecretId) { + this.instance.walletSecretId = walletSecretId; + return this; + } + + + /** + * returns a built SignEvmMessageWithEndUserAccountRequest instance. + * + * The builder is not reusable. + */ + public SignEvmMessageWithEndUserAccountRequest build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SignEvmMessageWithEndUserAccountRequest.Builder builder() { + return new SignEvmMessageWithEndUserAccountRequest.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SignEvmMessageWithEndUserAccountRequest.Builder toBuilder() { + return new SignEvmMessageWithEndUserAccountRequest.Builder() + .address(getAddress()) + .message(getMessage()) + .walletSecretId(getWalletSecretId()); + } + +} + diff --git a/java/src/main/java/com/coinbase/cdp/openapi/model/SignEvmTransactionWithEndUserAccount200Response.java b/java/src/main/java/com/coinbase/cdp/openapi/model/SignEvmTransactionWithEndUserAccount200Response.java new file mode 100644 index 000000000..ce96ff51f --- /dev/null +++ b/java/src/main/java/com/coinbase/cdp/openapi/model/SignEvmTransactionWithEndUserAccount200Response.java @@ -0,0 +1,205 @@ +/* + * Coinbase Developer Platform APIs + * The Coinbase Developer Platform APIs - leading the world's transition onchain. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: cdp@coinbase.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.coinbase.cdp.openapi.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.coinbase.cdp.openapi.ApiClient; +/** + * SignEvmTransactionWithEndUserAccount200Response + */ +@JsonPropertyOrder({ + SignEvmTransactionWithEndUserAccount200Response.JSON_PROPERTY_SIGNED_TRANSACTION +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class SignEvmTransactionWithEndUserAccount200Response { + public static final String JSON_PROPERTY_SIGNED_TRANSACTION = "signedTransaction"; + @jakarta.annotation.Nonnull + private String signedTransaction; + + public SignEvmTransactionWithEndUserAccount200Response() { + } + + public SignEvmTransactionWithEndUserAccount200Response signedTransaction(@jakarta.annotation.Nonnull String signedTransaction) { + this.signedTransaction = signedTransaction; + return this; + } + + /** + * The RLP-encoded signed transaction, as a 0x-prefixed hex string. + * @return signedTransaction + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SIGNED_TRANSACTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getSignedTransaction() { + return signedTransaction; + } + + + @JsonProperty(JSON_PROPERTY_SIGNED_TRANSACTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSignedTransaction(@jakarta.annotation.Nonnull String signedTransaction) { + this.signedTransaction = signedTransaction; + } + + + /** + * Return true if this signEvmTransactionWithEndUserAccount_200_response object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SignEvmTransactionWithEndUserAccount200Response signEvmTransactionWithEndUserAccount200Response = (SignEvmTransactionWithEndUserAccount200Response) o; + return Objects.equals(this.signedTransaction, signEvmTransactionWithEndUserAccount200Response.signedTransaction); + } + + @Override + public int hashCode() { + return Objects.hash(signedTransaction); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignEvmTransactionWithEndUserAccount200Response {\n"); + sb.append(" signedTransaction: ").append(toIndentedString(signedTransaction)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `signedTransaction` to the URL query string + if (getSignedTransaction() != null) { + joiner.add(String.format("%ssignedTransaction%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getSignedTransaction()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SignEvmTransactionWithEndUserAccount200Response instance; + + public Builder() { + this(new SignEvmTransactionWithEndUserAccount200Response()); + } + + protected Builder(SignEvmTransactionWithEndUserAccount200Response instance) { + this.instance = instance; + } + + public SignEvmTransactionWithEndUserAccount200Response.Builder signedTransaction(String signedTransaction) { + this.instance.signedTransaction = signedTransaction; + return this; + } + + + /** + * returns a built SignEvmTransactionWithEndUserAccount200Response instance. + * + * The builder is not reusable. + */ + public SignEvmTransactionWithEndUserAccount200Response build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SignEvmTransactionWithEndUserAccount200Response.Builder builder() { + return new SignEvmTransactionWithEndUserAccount200Response.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SignEvmTransactionWithEndUserAccount200Response.Builder toBuilder() { + return new SignEvmTransactionWithEndUserAccount200Response.Builder() + .signedTransaction(getSignedTransaction()); + } + +} + diff --git a/java/src/main/java/com/coinbase/cdp/openapi/model/SignEvmTransactionWithEndUserAccountRequest.java b/java/src/main/java/com/coinbase/cdp/openapi/model/SignEvmTransactionWithEndUserAccountRequest.java new file mode 100644 index 000000000..f6b59e12e --- /dev/null +++ b/java/src/main/java/com/coinbase/cdp/openapi/model/SignEvmTransactionWithEndUserAccountRequest.java @@ -0,0 +1,287 @@ +/* + * Coinbase Developer Platform APIs + * The Coinbase Developer Platform APIs - leading the world's transition onchain. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: cdp@coinbase.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.coinbase.cdp.openapi.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.coinbase.cdp.openapi.ApiClient; +/** + * SignEvmTransactionWithEndUserAccountRequest + */ +@JsonPropertyOrder({ + SignEvmTransactionWithEndUserAccountRequest.JSON_PROPERTY_ADDRESS, + SignEvmTransactionWithEndUserAccountRequest.JSON_PROPERTY_TRANSACTION, + SignEvmTransactionWithEndUserAccountRequest.JSON_PROPERTY_WALLET_SECRET_ID +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class SignEvmTransactionWithEndUserAccountRequest { + public static final String JSON_PROPERTY_ADDRESS = "address"; + @jakarta.annotation.Nonnull + private String address; + + public static final String JSON_PROPERTY_TRANSACTION = "transaction"; + @jakarta.annotation.Nonnull + private String transaction; + + public static final String JSON_PROPERTY_WALLET_SECRET_ID = "walletSecretId"; + @jakarta.annotation.Nullable + private String walletSecretId; + + public SignEvmTransactionWithEndUserAccountRequest() { + } + + public SignEvmTransactionWithEndUserAccountRequest address(@jakarta.annotation.Nonnull String address) { + this.address = address; + return this; + } + + /** + * The 0x-prefixed address of the EVM account belonging to the end user. + * @return address + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getAddress() { + return address; + } + + + @JsonProperty(JSON_PROPERTY_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setAddress(@jakarta.annotation.Nonnull String address) { + this.address = address; + } + + + public SignEvmTransactionWithEndUserAccountRequest transaction(@jakarta.annotation.Nonnull String transaction) { + this.transaction = transaction; + return this; + } + + /** + * The RLP-encoded transaction to sign, as a 0x-prefixed hex string. + * @return transaction + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TRANSACTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTransaction() { + return transaction; + } + + + @JsonProperty(JSON_PROPERTY_TRANSACTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTransaction(@jakarta.annotation.Nonnull String transaction) { + this.transaction = transaction; + } + + + public SignEvmTransactionWithEndUserAccountRequest walletSecretId(@jakarta.annotation.Nullable String walletSecretId) { + this.walletSecretId = walletSecretId; + return this; + } + + /** + * Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header. + * @return walletSecretId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WALLET_SECRET_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getWalletSecretId() { + return walletSecretId; + } + + + @JsonProperty(JSON_PROPERTY_WALLET_SECRET_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWalletSecretId(@jakarta.annotation.Nullable String walletSecretId) { + this.walletSecretId = walletSecretId; + } + + + /** + * Return true if this signEvmTransactionWithEndUserAccount_request object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SignEvmTransactionWithEndUserAccountRequest signEvmTransactionWithEndUserAccountRequest = (SignEvmTransactionWithEndUserAccountRequest) o; + return Objects.equals(this.address, signEvmTransactionWithEndUserAccountRequest.address) && + Objects.equals(this.transaction, signEvmTransactionWithEndUserAccountRequest.transaction) && + Objects.equals(this.walletSecretId, signEvmTransactionWithEndUserAccountRequest.walletSecretId); + } + + @Override + public int hashCode() { + return Objects.hash(address, transaction, walletSecretId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignEvmTransactionWithEndUserAccountRequest {\n"); + sb.append(" address: ").append(toIndentedString(address)).append("\n"); + sb.append(" transaction: ").append(toIndentedString(transaction)).append("\n"); + sb.append(" walletSecretId: ").append(toIndentedString(walletSecretId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `address` to the URL query string + if (getAddress() != null) { + joiner.add(String.format("%saddress%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getAddress()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `transaction` to the URL query string + if (getTransaction() != null) { + joiner.add(String.format("%stransaction%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getTransaction()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `walletSecretId` to the URL query string + if (getWalletSecretId() != null) { + joiner.add(String.format("%swalletSecretId%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getWalletSecretId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SignEvmTransactionWithEndUserAccountRequest instance; + + public Builder() { + this(new SignEvmTransactionWithEndUserAccountRequest()); + } + + protected Builder(SignEvmTransactionWithEndUserAccountRequest instance) { + this.instance = instance; + } + + public SignEvmTransactionWithEndUserAccountRequest.Builder address(String address) { + this.instance.address = address; + return this; + } + public SignEvmTransactionWithEndUserAccountRequest.Builder transaction(String transaction) { + this.instance.transaction = transaction; + return this; + } + public SignEvmTransactionWithEndUserAccountRequest.Builder walletSecretId(String walletSecretId) { + this.instance.walletSecretId = walletSecretId; + return this; + } + + + /** + * returns a built SignEvmTransactionWithEndUserAccountRequest instance. + * + * The builder is not reusable. + */ + public SignEvmTransactionWithEndUserAccountRequest build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SignEvmTransactionWithEndUserAccountRequest.Builder builder() { + return new SignEvmTransactionWithEndUserAccountRequest.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SignEvmTransactionWithEndUserAccountRequest.Builder toBuilder() { + return new SignEvmTransactionWithEndUserAccountRequest.Builder() + .address(getAddress()) + .transaction(getTransaction()) + .walletSecretId(getWalletSecretId()); + } + +} + diff --git a/java/src/main/java/com/coinbase/cdp/openapi/model/SignEvmTypedDataWithEndUserAccount200Response.java b/java/src/main/java/com/coinbase/cdp/openapi/model/SignEvmTypedDataWithEndUserAccount200Response.java new file mode 100644 index 000000000..5b8b98796 --- /dev/null +++ b/java/src/main/java/com/coinbase/cdp/openapi/model/SignEvmTypedDataWithEndUserAccount200Response.java @@ -0,0 +1,205 @@ +/* + * Coinbase Developer Platform APIs + * The Coinbase Developer Platform APIs - leading the world's transition onchain. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: cdp@coinbase.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.coinbase.cdp.openapi.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.coinbase.cdp.openapi.ApiClient; +/** + * SignEvmTypedDataWithEndUserAccount200Response + */ +@JsonPropertyOrder({ + SignEvmTypedDataWithEndUserAccount200Response.JSON_PROPERTY_SIGNATURE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class SignEvmTypedDataWithEndUserAccount200Response { + public static final String JSON_PROPERTY_SIGNATURE = "signature"; + @jakarta.annotation.Nonnull + private String signature; + + public SignEvmTypedDataWithEndUserAccount200Response() { + } + + public SignEvmTypedDataWithEndUserAccount200Response signature(@jakarta.annotation.Nonnull String signature) { + this.signature = signature; + return this; + } + + /** + * The signature of the typed data, as a 0x-prefixed hex string. + * @return signature + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SIGNATURE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getSignature() { + return signature; + } + + + @JsonProperty(JSON_PROPERTY_SIGNATURE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSignature(@jakarta.annotation.Nonnull String signature) { + this.signature = signature; + } + + + /** + * Return true if this signEvmTypedDataWithEndUserAccount_200_response object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SignEvmTypedDataWithEndUserAccount200Response signEvmTypedDataWithEndUserAccount200Response = (SignEvmTypedDataWithEndUserAccount200Response) o; + return Objects.equals(this.signature, signEvmTypedDataWithEndUserAccount200Response.signature); + } + + @Override + public int hashCode() { + return Objects.hash(signature); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignEvmTypedDataWithEndUserAccount200Response {\n"); + sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `signature` to the URL query string + if (getSignature() != null) { + joiner.add(String.format("%ssignature%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getSignature()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SignEvmTypedDataWithEndUserAccount200Response instance; + + public Builder() { + this(new SignEvmTypedDataWithEndUserAccount200Response()); + } + + protected Builder(SignEvmTypedDataWithEndUserAccount200Response instance) { + this.instance = instance; + } + + public SignEvmTypedDataWithEndUserAccount200Response.Builder signature(String signature) { + this.instance.signature = signature; + return this; + } + + + /** + * returns a built SignEvmTypedDataWithEndUserAccount200Response instance. + * + * The builder is not reusable. + */ + public SignEvmTypedDataWithEndUserAccount200Response build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SignEvmTypedDataWithEndUserAccount200Response.Builder builder() { + return new SignEvmTypedDataWithEndUserAccount200Response.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SignEvmTypedDataWithEndUserAccount200Response.Builder toBuilder() { + return new SignEvmTypedDataWithEndUserAccount200Response.Builder() + .signature(getSignature()); + } + +} + diff --git a/java/src/main/java/com/coinbase/cdp/openapi/model/SignEvmTypedDataWithEndUserAccountRequest.java b/java/src/main/java/com/coinbase/cdp/openapi/model/SignEvmTypedDataWithEndUserAccountRequest.java new file mode 100644 index 000000000..478167454 --- /dev/null +++ b/java/src/main/java/com/coinbase/cdp/openapi/model/SignEvmTypedDataWithEndUserAccountRequest.java @@ -0,0 +1,288 @@ +/* + * Coinbase Developer Platform APIs + * The Coinbase Developer Platform APIs - leading the world's transition onchain. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: cdp@coinbase.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.coinbase.cdp.openapi.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.coinbase.cdp.openapi.model.EIP712Message; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.coinbase.cdp.openapi.ApiClient; +/** + * SignEvmTypedDataWithEndUserAccountRequest + */ +@JsonPropertyOrder({ + SignEvmTypedDataWithEndUserAccountRequest.JSON_PROPERTY_ADDRESS, + SignEvmTypedDataWithEndUserAccountRequest.JSON_PROPERTY_TYPED_DATA, + SignEvmTypedDataWithEndUserAccountRequest.JSON_PROPERTY_WALLET_SECRET_ID +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class SignEvmTypedDataWithEndUserAccountRequest { + public static final String JSON_PROPERTY_ADDRESS = "address"; + @jakarta.annotation.Nonnull + private String address; + + public static final String JSON_PROPERTY_TYPED_DATA = "typedData"; + @jakarta.annotation.Nonnull + private EIP712Message typedData; + + public static final String JSON_PROPERTY_WALLET_SECRET_ID = "walletSecretId"; + @jakarta.annotation.Nullable + private String walletSecretId; + + public SignEvmTypedDataWithEndUserAccountRequest() { + } + + public SignEvmTypedDataWithEndUserAccountRequest address(@jakarta.annotation.Nonnull String address) { + this.address = address; + return this; + } + + /** + * The 0x-prefixed address of the EVM account belonging to the end user. + * @return address + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getAddress() { + return address; + } + + + @JsonProperty(JSON_PROPERTY_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setAddress(@jakarta.annotation.Nonnull String address) { + this.address = address; + } + + + public SignEvmTypedDataWithEndUserAccountRequest typedData(@jakarta.annotation.Nonnull EIP712Message typedData) { + this.typedData = typedData; + return this; + } + + /** + * Get typedData + * @return typedData + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPED_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public EIP712Message getTypedData() { + return typedData; + } + + + @JsonProperty(JSON_PROPERTY_TYPED_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTypedData(@jakarta.annotation.Nonnull EIP712Message typedData) { + this.typedData = typedData; + } + + + public SignEvmTypedDataWithEndUserAccountRequest walletSecretId(@jakarta.annotation.Nullable String walletSecretId) { + this.walletSecretId = walletSecretId; + return this; + } + + /** + * Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header. + * @return walletSecretId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WALLET_SECRET_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getWalletSecretId() { + return walletSecretId; + } + + + @JsonProperty(JSON_PROPERTY_WALLET_SECRET_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWalletSecretId(@jakarta.annotation.Nullable String walletSecretId) { + this.walletSecretId = walletSecretId; + } + + + /** + * Return true if this signEvmTypedDataWithEndUserAccount_request object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SignEvmTypedDataWithEndUserAccountRequest signEvmTypedDataWithEndUserAccountRequest = (SignEvmTypedDataWithEndUserAccountRequest) o; + return Objects.equals(this.address, signEvmTypedDataWithEndUserAccountRequest.address) && + Objects.equals(this.typedData, signEvmTypedDataWithEndUserAccountRequest.typedData) && + Objects.equals(this.walletSecretId, signEvmTypedDataWithEndUserAccountRequest.walletSecretId); + } + + @Override + public int hashCode() { + return Objects.hash(address, typedData, walletSecretId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignEvmTypedDataWithEndUserAccountRequest {\n"); + sb.append(" address: ").append(toIndentedString(address)).append("\n"); + sb.append(" typedData: ").append(toIndentedString(typedData)).append("\n"); + sb.append(" walletSecretId: ").append(toIndentedString(walletSecretId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `address` to the URL query string + if (getAddress() != null) { + joiner.add(String.format("%saddress%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getAddress()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `typedData` to the URL query string + if (getTypedData() != null) { + joiner.add(getTypedData().toUrlQueryString(prefix + "typedData" + suffix)); + } + + // add `walletSecretId` to the URL query string + if (getWalletSecretId() != null) { + joiner.add(String.format("%swalletSecretId%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getWalletSecretId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SignEvmTypedDataWithEndUserAccountRequest instance; + + public Builder() { + this(new SignEvmTypedDataWithEndUserAccountRequest()); + } + + protected Builder(SignEvmTypedDataWithEndUserAccountRequest instance) { + this.instance = instance; + } + + public SignEvmTypedDataWithEndUserAccountRequest.Builder address(String address) { + this.instance.address = address; + return this; + } + public SignEvmTypedDataWithEndUserAccountRequest.Builder typedData(EIP712Message typedData) { + this.instance.typedData = typedData; + return this; + } + public SignEvmTypedDataWithEndUserAccountRequest.Builder walletSecretId(String walletSecretId) { + this.instance.walletSecretId = walletSecretId; + return this; + } + + + /** + * returns a built SignEvmTypedDataWithEndUserAccountRequest instance. + * + * The builder is not reusable. + */ + public SignEvmTypedDataWithEndUserAccountRequest build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SignEvmTypedDataWithEndUserAccountRequest.Builder builder() { + return new SignEvmTypedDataWithEndUserAccountRequest.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SignEvmTypedDataWithEndUserAccountRequest.Builder toBuilder() { + return new SignEvmTypedDataWithEndUserAccountRequest.Builder() + .address(getAddress()) + .typedData(getTypedData()) + .walletSecretId(getWalletSecretId()); + } + +} + diff --git a/java/src/main/java/com/coinbase/cdp/openapi/model/SignSolanaHashWithEndUserAccount200Response.java b/java/src/main/java/com/coinbase/cdp/openapi/model/SignSolanaHashWithEndUserAccount200Response.java new file mode 100644 index 000000000..e18a276dc --- /dev/null +++ b/java/src/main/java/com/coinbase/cdp/openapi/model/SignSolanaHashWithEndUserAccount200Response.java @@ -0,0 +1,205 @@ +/* + * Coinbase Developer Platform APIs + * The Coinbase Developer Platform APIs - leading the world's transition onchain. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: cdp@coinbase.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.coinbase.cdp.openapi.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.coinbase.cdp.openapi.ApiClient; +/** + * SignSolanaHashWithEndUserAccount200Response + */ +@JsonPropertyOrder({ + SignSolanaHashWithEndUserAccount200Response.JSON_PROPERTY_SIGNATURE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class SignSolanaHashWithEndUserAccount200Response { + public static final String JSON_PROPERTY_SIGNATURE = "signature"; + @jakarta.annotation.Nonnull + private String signature; + + public SignSolanaHashWithEndUserAccount200Response() { + } + + public SignSolanaHashWithEndUserAccount200Response signature(@jakarta.annotation.Nonnull String signature) { + this.signature = signature; + return this; + } + + /** + * The signature of the hash, as a base58 encoded string. + * @return signature + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SIGNATURE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getSignature() { + return signature; + } + + + @JsonProperty(JSON_PROPERTY_SIGNATURE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSignature(@jakarta.annotation.Nonnull String signature) { + this.signature = signature; + } + + + /** + * Return true if this signSolanaHashWithEndUserAccount_200_response object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SignSolanaHashWithEndUserAccount200Response signSolanaHashWithEndUserAccount200Response = (SignSolanaHashWithEndUserAccount200Response) o; + return Objects.equals(this.signature, signSolanaHashWithEndUserAccount200Response.signature); + } + + @Override + public int hashCode() { + return Objects.hash(signature); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignSolanaHashWithEndUserAccount200Response {\n"); + sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `signature` to the URL query string + if (getSignature() != null) { + joiner.add(String.format("%ssignature%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getSignature()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SignSolanaHashWithEndUserAccount200Response instance; + + public Builder() { + this(new SignSolanaHashWithEndUserAccount200Response()); + } + + protected Builder(SignSolanaHashWithEndUserAccount200Response instance) { + this.instance = instance; + } + + public SignSolanaHashWithEndUserAccount200Response.Builder signature(String signature) { + this.instance.signature = signature; + return this; + } + + + /** + * returns a built SignSolanaHashWithEndUserAccount200Response instance. + * + * The builder is not reusable. + */ + public SignSolanaHashWithEndUserAccount200Response build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SignSolanaHashWithEndUserAccount200Response.Builder builder() { + return new SignSolanaHashWithEndUserAccount200Response.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SignSolanaHashWithEndUserAccount200Response.Builder toBuilder() { + return new SignSolanaHashWithEndUserAccount200Response.Builder() + .signature(getSignature()); + } + +} + diff --git a/java/src/main/java/com/coinbase/cdp/openapi/model/SignSolanaHashWithEndUserAccountRequest.java b/java/src/main/java/com/coinbase/cdp/openapi/model/SignSolanaHashWithEndUserAccountRequest.java new file mode 100644 index 000000000..fb13a54ed --- /dev/null +++ b/java/src/main/java/com/coinbase/cdp/openapi/model/SignSolanaHashWithEndUserAccountRequest.java @@ -0,0 +1,287 @@ +/* + * Coinbase Developer Platform APIs + * The Coinbase Developer Platform APIs - leading the world's transition onchain. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: cdp@coinbase.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.coinbase.cdp.openapi.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.coinbase.cdp.openapi.ApiClient; +/** + * SignSolanaHashWithEndUserAccountRequest + */ +@JsonPropertyOrder({ + SignSolanaHashWithEndUserAccountRequest.JSON_PROPERTY_HASH, + SignSolanaHashWithEndUserAccountRequest.JSON_PROPERTY_ADDRESS, + SignSolanaHashWithEndUserAccountRequest.JSON_PROPERTY_WALLET_SECRET_ID +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class SignSolanaHashWithEndUserAccountRequest { + public static final String JSON_PROPERTY_HASH = "hash"; + @jakarta.annotation.Nonnull + private String hash; + + public static final String JSON_PROPERTY_ADDRESS = "address"; + @jakarta.annotation.Nonnull + private String address; + + public static final String JSON_PROPERTY_WALLET_SECRET_ID = "walletSecretId"; + @jakarta.annotation.Nullable + private String walletSecretId; + + public SignSolanaHashWithEndUserAccountRequest() { + } + + public SignSolanaHashWithEndUserAccountRequest hash(@jakarta.annotation.Nonnull String hash) { + this.hash = hash; + return this; + } + + /** + * The arbitrary 32 byte hash to sign as base58 encoded string. + * @return hash + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_HASH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getHash() { + return hash; + } + + + @JsonProperty(JSON_PROPERTY_HASH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setHash(@jakarta.annotation.Nonnull String hash) { + this.hash = hash; + } + + + public SignSolanaHashWithEndUserAccountRequest address(@jakarta.annotation.Nonnull String address) { + this.address = address; + return this; + } + + /** + * The base58 encoded address of the Solana account belonging to the end user. + * @return address + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getAddress() { + return address; + } + + + @JsonProperty(JSON_PROPERTY_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setAddress(@jakarta.annotation.Nonnull String address) { + this.address = address; + } + + + public SignSolanaHashWithEndUserAccountRequest walletSecretId(@jakarta.annotation.Nullable String walletSecretId) { + this.walletSecretId = walletSecretId; + return this; + } + + /** + * Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header. + * @return walletSecretId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WALLET_SECRET_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getWalletSecretId() { + return walletSecretId; + } + + + @JsonProperty(JSON_PROPERTY_WALLET_SECRET_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWalletSecretId(@jakarta.annotation.Nullable String walletSecretId) { + this.walletSecretId = walletSecretId; + } + + + /** + * Return true if this signSolanaHashWithEndUserAccount_request object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SignSolanaHashWithEndUserAccountRequest signSolanaHashWithEndUserAccountRequest = (SignSolanaHashWithEndUserAccountRequest) o; + return Objects.equals(this.hash, signSolanaHashWithEndUserAccountRequest.hash) && + Objects.equals(this.address, signSolanaHashWithEndUserAccountRequest.address) && + Objects.equals(this.walletSecretId, signSolanaHashWithEndUserAccountRequest.walletSecretId); + } + + @Override + public int hashCode() { + return Objects.hash(hash, address, walletSecretId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignSolanaHashWithEndUserAccountRequest {\n"); + sb.append(" hash: ").append(toIndentedString(hash)).append("\n"); + sb.append(" address: ").append(toIndentedString(address)).append("\n"); + sb.append(" walletSecretId: ").append(toIndentedString(walletSecretId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `hash` to the URL query string + if (getHash() != null) { + joiner.add(String.format("%shash%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getHash()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `address` to the URL query string + if (getAddress() != null) { + joiner.add(String.format("%saddress%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getAddress()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `walletSecretId` to the URL query string + if (getWalletSecretId() != null) { + joiner.add(String.format("%swalletSecretId%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getWalletSecretId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SignSolanaHashWithEndUserAccountRequest instance; + + public Builder() { + this(new SignSolanaHashWithEndUserAccountRequest()); + } + + protected Builder(SignSolanaHashWithEndUserAccountRequest instance) { + this.instance = instance; + } + + public SignSolanaHashWithEndUserAccountRequest.Builder hash(String hash) { + this.instance.hash = hash; + return this; + } + public SignSolanaHashWithEndUserAccountRequest.Builder address(String address) { + this.instance.address = address; + return this; + } + public SignSolanaHashWithEndUserAccountRequest.Builder walletSecretId(String walletSecretId) { + this.instance.walletSecretId = walletSecretId; + return this; + } + + + /** + * returns a built SignSolanaHashWithEndUserAccountRequest instance. + * + * The builder is not reusable. + */ + public SignSolanaHashWithEndUserAccountRequest build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SignSolanaHashWithEndUserAccountRequest.Builder builder() { + return new SignSolanaHashWithEndUserAccountRequest.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SignSolanaHashWithEndUserAccountRequest.Builder toBuilder() { + return new SignSolanaHashWithEndUserAccountRequest.Builder() + .hash(getHash()) + .address(getAddress()) + .walletSecretId(getWalletSecretId()); + } + +} + diff --git a/java/src/main/java/com/coinbase/cdp/openapi/model/SignSolanaMessageWithEndUserAccount200Response.java b/java/src/main/java/com/coinbase/cdp/openapi/model/SignSolanaMessageWithEndUserAccount200Response.java new file mode 100644 index 000000000..9b2e759c5 --- /dev/null +++ b/java/src/main/java/com/coinbase/cdp/openapi/model/SignSolanaMessageWithEndUserAccount200Response.java @@ -0,0 +1,205 @@ +/* + * Coinbase Developer Platform APIs + * The Coinbase Developer Platform APIs - leading the world's transition onchain. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: cdp@coinbase.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.coinbase.cdp.openapi.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.coinbase.cdp.openapi.ApiClient; +/** + * SignSolanaMessageWithEndUserAccount200Response + */ +@JsonPropertyOrder({ + SignSolanaMessageWithEndUserAccount200Response.JSON_PROPERTY_SIGNATURE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class SignSolanaMessageWithEndUserAccount200Response { + public static final String JSON_PROPERTY_SIGNATURE = "signature"; + @jakarta.annotation.Nonnull + private String signature; + + public SignSolanaMessageWithEndUserAccount200Response() { + } + + public SignSolanaMessageWithEndUserAccount200Response signature(@jakarta.annotation.Nonnull String signature) { + this.signature = signature; + return this; + } + + /** + * The signature of the message, as a base58 encoded string. + * @return signature + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SIGNATURE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getSignature() { + return signature; + } + + + @JsonProperty(JSON_PROPERTY_SIGNATURE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSignature(@jakarta.annotation.Nonnull String signature) { + this.signature = signature; + } + + + /** + * Return true if this signSolanaMessageWithEndUserAccount_200_response object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SignSolanaMessageWithEndUserAccount200Response signSolanaMessageWithEndUserAccount200Response = (SignSolanaMessageWithEndUserAccount200Response) o; + return Objects.equals(this.signature, signSolanaMessageWithEndUserAccount200Response.signature); + } + + @Override + public int hashCode() { + return Objects.hash(signature); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignSolanaMessageWithEndUserAccount200Response {\n"); + sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `signature` to the URL query string + if (getSignature() != null) { + joiner.add(String.format("%ssignature%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getSignature()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SignSolanaMessageWithEndUserAccount200Response instance; + + public Builder() { + this(new SignSolanaMessageWithEndUserAccount200Response()); + } + + protected Builder(SignSolanaMessageWithEndUserAccount200Response instance) { + this.instance = instance; + } + + public SignSolanaMessageWithEndUserAccount200Response.Builder signature(String signature) { + this.instance.signature = signature; + return this; + } + + + /** + * returns a built SignSolanaMessageWithEndUserAccount200Response instance. + * + * The builder is not reusable. + */ + public SignSolanaMessageWithEndUserAccount200Response build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SignSolanaMessageWithEndUserAccount200Response.Builder builder() { + return new SignSolanaMessageWithEndUserAccount200Response.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SignSolanaMessageWithEndUserAccount200Response.Builder toBuilder() { + return new SignSolanaMessageWithEndUserAccount200Response.Builder() + .signature(getSignature()); + } + +} + diff --git a/java/src/main/java/com/coinbase/cdp/openapi/model/SignSolanaMessageWithEndUserAccountRequest.java b/java/src/main/java/com/coinbase/cdp/openapi/model/SignSolanaMessageWithEndUserAccountRequest.java new file mode 100644 index 000000000..c331a1c03 --- /dev/null +++ b/java/src/main/java/com/coinbase/cdp/openapi/model/SignSolanaMessageWithEndUserAccountRequest.java @@ -0,0 +1,287 @@ +/* + * Coinbase Developer Platform APIs + * The Coinbase Developer Platform APIs - leading the world's transition onchain. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: cdp@coinbase.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.coinbase.cdp.openapi.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.coinbase.cdp.openapi.ApiClient; +/** + * SignSolanaMessageWithEndUserAccountRequest + */ +@JsonPropertyOrder({ + SignSolanaMessageWithEndUserAccountRequest.JSON_PROPERTY_ADDRESS, + SignSolanaMessageWithEndUserAccountRequest.JSON_PROPERTY_MESSAGE, + SignSolanaMessageWithEndUserAccountRequest.JSON_PROPERTY_WALLET_SECRET_ID +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class SignSolanaMessageWithEndUserAccountRequest { + public static final String JSON_PROPERTY_ADDRESS = "address"; + @jakarta.annotation.Nonnull + private String address; + + public static final String JSON_PROPERTY_MESSAGE = "message"; + @jakarta.annotation.Nonnull + private String message; + + public static final String JSON_PROPERTY_WALLET_SECRET_ID = "walletSecretId"; + @jakarta.annotation.Nullable + private String walletSecretId; + + public SignSolanaMessageWithEndUserAccountRequest() { + } + + public SignSolanaMessageWithEndUserAccountRequest address(@jakarta.annotation.Nonnull String address) { + this.address = address; + return this; + } + + /** + * The base58 encoded address of the Solana account belonging to the end user. + * @return address + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getAddress() { + return address; + } + + + @JsonProperty(JSON_PROPERTY_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setAddress(@jakarta.annotation.Nonnull String address) { + this.address = address; + } + + + public SignSolanaMessageWithEndUserAccountRequest message(@jakarta.annotation.Nonnull String message) { + this.message = message; + return this; + } + + /** + * The base64 encoded arbitrary message to sign. + * @return message + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getMessage() { + return message; + } + + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setMessage(@jakarta.annotation.Nonnull String message) { + this.message = message; + } + + + public SignSolanaMessageWithEndUserAccountRequest walletSecretId(@jakarta.annotation.Nullable String walletSecretId) { + this.walletSecretId = walletSecretId; + return this; + } + + /** + * Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header. + * @return walletSecretId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WALLET_SECRET_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getWalletSecretId() { + return walletSecretId; + } + + + @JsonProperty(JSON_PROPERTY_WALLET_SECRET_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWalletSecretId(@jakarta.annotation.Nullable String walletSecretId) { + this.walletSecretId = walletSecretId; + } + + + /** + * Return true if this signSolanaMessageWithEndUserAccount_request object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SignSolanaMessageWithEndUserAccountRequest signSolanaMessageWithEndUserAccountRequest = (SignSolanaMessageWithEndUserAccountRequest) o; + return Objects.equals(this.address, signSolanaMessageWithEndUserAccountRequest.address) && + Objects.equals(this.message, signSolanaMessageWithEndUserAccountRequest.message) && + Objects.equals(this.walletSecretId, signSolanaMessageWithEndUserAccountRequest.walletSecretId); + } + + @Override + public int hashCode() { + return Objects.hash(address, message, walletSecretId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignSolanaMessageWithEndUserAccountRequest {\n"); + sb.append(" address: ").append(toIndentedString(address)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" walletSecretId: ").append(toIndentedString(walletSecretId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `address` to the URL query string + if (getAddress() != null) { + joiner.add(String.format("%saddress%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getAddress()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `message` to the URL query string + if (getMessage() != null) { + joiner.add(String.format("%smessage%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getMessage()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `walletSecretId` to the URL query string + if (getWalletSecretId() != null) { + joiner.add(String.format("%swalletSecretId%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getWalletSecretId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SignSolanaMessageWithEndUserAccountRequest instance; + + public Builder() { + this(new SignSolanaMessageWithEndUserAccountRequest()); + } + + protected Builder(SignSolanaMessageWithEndUserAccountRequest instance) { + this.instance = instance; + } + + public SignSolanaMessageWithEndUserAccountRequest.Builder address(String address) { + this.instance.address = address; + return this; + } + public SignSolanaMessageWithEndUserAccountRequest.Builder message(String message) { + this.instance.message = message; + return this; + } + public SignSolanaMessageWithEndUserAccountRequest.Builder walletSecretId(String walletSecretId) { + this.instance.walletSecretId = walletSecretId; + return this; + } + + + /** + * returns a built SignSolanaMessageWithEndUserAccountRequest instance. + * + * The builder is not reusable. + */ + public SignSolanaMessageWithEndUserAccountRequest build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SignSolanaMessageWithEndUserAccountRequest.Builder builder() { + return new SignSolanaMessageWithEndUserAccountRequest.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SignSolanaMessageWithEndUserAccountRequest.Builder toBuilder() { + return new SignSolanaMessageWithEndUserAccountRequest.Builder() + .address(getAddress()) + .message(getMessage()) + .walletSecretId(getWalletSecretId()); + } + +} + diff --git a/java/src/main/java/com/coinbase/cdp/openapi/model/SignSolanaTransactionWithEndUserAccount200Response.java b/java/src/main/java/com/coinbase/cdp/openapi/model/SignSolanaTransactionWithEndUserAccount200Response.java new file mode 100644 index 000000000..1f653b747 --- /dev/null +++ b/java/src/main/java/com/coinbase/cdp/openapi/model/SignSolanaTransactionWithEndUserAccount200Response.java @@ -0,0 +1,205 @@ +/* + * Coinbase Developer Platform APIs + * The Coinbase Developer Platform APIs - leading the world's transition onchain. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: cdp@coinbase.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.coinbase.cdp.openapi.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.coinbase.cdp.openapi.ApiClient; +/** + * SignSolanaTransactionWithEndUserAccount200Response + */ +@JsonPropertyOrder({ + SignSolanaTransactionWithEndUserAccount200Response.JSON_PROPERTY_SIGNED_TRANSACTION +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class SignSolanaTransactionWithEndUserAccount200Response { + public static final String JSON_PROPERTY_SIGNED_TRANSACTION = "signedTransaction"; + @jakarta.annotation.Nonnull + private String signedTransaction; + + public SignSolanaTransactionWithEndUserAccount200Response() { + } + + public SignSolanaTransactionWithEndUserAccount200Response signedTransaction(@jakarta.annotation.Nonnull String signedTransaction) { + this.signedTransaction = signedTransaction; + return this; + } + + /** + * The base64 encoded signed transaction. + * @return signedTransaction + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SIGNED_TRANSACTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getSignedTransaction() { + return signedTransaction; + } + + + @JsonProperty(JSON_PROPERTY_SIGNED_TRANSACTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSignedTransaction(@jakarta.annotation.Nonnull String signedTransaction) { + this.signedTransaction = signedTransaction; + } + + + /** + * Return true if this signSolanaTransactionWithEndUserAccount_200_response object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SignSolanaTransactionWithEndUserAccount200Response signSolanaTransactionWithEndUserAccount200Response = (SignSolanaTransactionWithEndUserAccount200Response) o; + return Objects.equals(this.signedTransaction, signSolanaTransactionWithEndUserAccount200Response.signedTransaction); + } + + @Override + public int hashCode() { + return Objects.hash(signedTransaction); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignSolanaTransactionWithEndUserAccount200Response {\n"); + sb.append(" signedTransaction: ").append(toIndentedString(signedTransaction)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `signedTransaction` to the URL query string + if (getSignedTransaction() != null) { + joiner.add(String.format("%ssignedTransaction%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getSignedTransaction()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SignSolanaTransactionWithEndUserAccount200Response instance; + + public Builder() { + this(new SignSolanaTransactionWithEndUserAccount200Response()); + } + + protected Builder(SignSolanaTransactionWithEndUserAccount200Response instance) { + this.instance = instance; + } + + public SignSolanaTransactionWithEndUserAccount200Response.Builder signedTransaction(String signedTransaction) { + this.instance.signedTransaction = signedTransaction; + return this; + } + + + /** + * returns a built SignSolanaTransactionWithEndUserAccount200Response instance. + * + * The builder is not reusable. + */ + public SignSolanaTransactionWithEndUserAccount200Response build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SignSolanaTransactionWithEndUserAccount200Response.Builder builder() { + return new SignSolanaTransactionWithEndUserAccount200Response.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SignSolanaTransactionWithEndUserAccount200Response.Builder toBuilder() { + return new SignSolanaTransactionWithEndUserAccount200Response.Builder() + .signedTransaction(getSignedTransaction()); + } + +} + diff --git a/java/src/main/java/com/coinbase/cdp/openapi/model/SignSolanaTransactionWithEndUserAccountRequest.java b/java/src/main/java/com/coinbase/cdp/openapi/model/SignSolanaTransactionWithEndUserAccountRequest.java new file mode 100644 index 000000000..677420de1 --- /dev/null +++ b/java/src/main/java/com/coinbase/cdp/openapi/model/SignSolanaTransactionWithEndUserAccountRequest.java @@ -0,0 +1,287 @@ +/* + * Coinbase Developer Platform APIs + * The Coinbase Developer Platform APIs - leading the world's transition onchain. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: cdp@coinbase.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.coinbase.cdp.openapi.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.coinbase.cdp.openapi.ApiClient; +/** + * SignSolanaTransactionWithEndUserAccountRequest + */ +@JsonPropertyOrder({ + SignSolanaTransactionWithEndUserAccountRequest.JSON_PROPERTY_ADDRESS, + SignSolanaTransactionWithEndUserAccountRequest.JSON_PROPERTY_TRANSACTION, + SignSolanaTransactionWithEndUserAccountRequest.JSON_PROPERTY_WALLET_SECRET_ID +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class SignSolanaTransactionWithEndUserAccountRequest { + public static final String JSON_PROPERTY_ADDRESS = "address"; + @jakarta.annotation.Nonnull + private String address; + + public static final String JSON_PROPERTY_TRANSACTION = "transaction"; + @jakarta.annotation.Nonnull + private String transaction; + + public static final String JSON_PROPERTY_WALLET_SECRET_ID = "walletSecretId"; + @jakarta.annotation.Nullable + private String walletSecretId; + + public SignSolanaTransactionWithEndUserAccountRequest() { + } + + public SignSolanaTransactionWithEndUserAccountRequest address(@jakarta.annotation.Nonnull String address) { + this.address = address; + return this; + } + + /** + * The base58 encoded address of the Solana account belonging to the end user. + * @return address + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getAddress() { + return address; + } + + + @JsonProperty(JSON_PROPERTY_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setAddress(@jakarta.annotation.Nonnull String address) { + this.address = address; + } + + + public SignSolanaTransactionWithEndUserAccountRequest transaction(@jakarta.annotation.Nonnull String transaction) { + this.transaction = transaction; + return this; + } + + /** + * The base64 encoded transaction to sign. + * @return transaction + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TRANSACTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTransaction() { + return transaction; + } + + + @JsonProperty(JSON_PROPERTY_TRANSACTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTransaction(@jakarta.annotation.Nonnull String transaction) { + this.transaction = transaction; + } + + + public SignSolanaTransactionWithEndUserAccountRequest walletSecretId(@jakarta.annotation.Nullable String walletSecretId) { + this.walletSecretId = walletSecretId; + return this; + } + + /** + * Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header. + * @return walletSecretId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WALLET_SECRET_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getWalletSecretId() { + return walletSecretId; + } + + + @JsonProperty(JSON_PROPERTY_WALLET_SECRET_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWalletSecretId(@jakarta.annotation.Nullable String walletSecretId) { + this.walletSecretId = walletSecretId; + } + + + /** + * Return true if this signSolanaTransactionWithEndUserAccount_request object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SignSolanaTransactionWithEndUserAccountRequest signSolanaTransactionWithEndUserAccountRequest = (SignSolanaTransactionWithEndUserAccountRequest) o; + return Objects.equals(this.address, signSolanaTransactionWithEndUserAccountRequest.address) && + Objects.equals(this.transaction, signSolanaTransactionWithEndUserAccountRequest.transaction) && + Objects.equals(this.walletSecretId, signSolanaTransactionWithEndUserAccountRequest.walletSecretId); + } + + @Override + public int hashCode() { + return Objects.hash(address, transaction, walletSecretId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignSolanaTransactionWithEndUserAccountRequest {\n"); + sb.append(" address: ").append(toIndentedString(address)).append("\n"); + sb.append(" transaction: ").append(toIndentedString(transaction)).append("\n"); + sb.append(" walletSecretId: ").append(toIndentedString(walletSecretId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `address` to the URL query string + if (getAddress() != null) { + joiner.add(String.format("%saddress%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getAddress()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `transaction` to the URL query string + if (getTransaction() != null) { + joiner.add(String.format("%stransaction%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getTransaction()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `walletSecretId` to the URL query string + if (getWalletSecretId() != null) { + joiner.add(String.format("%swalletSecretId%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getWalletSecretId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SignSolanaTransactionWithEndUserAccountRequest instance; + + public Builder() { + this(new SignSolanaTransactionWithEndUserAccountRequest()); + } + + protected Builder(SignSolanaTransactionWithEndUserAccountRequest instance) { + this.instance = instance; + } + + public SignSolanaTransactionWithEndUserAccountRequest.Builder address(String address) { + this.instance.address = address; + return this; + } + public SignSolanaTransactionWithEndUserAccountRequest.Builder transaction(String transaction) { + this.instance.transaction = transaction; + return this; + } + public SignSolanaTransactionWithEndUserAccountRequest.Builder walletSecretId(String walletSecretId) { + this.instance.walletSecretId = walletSecretId; + return this; + } + + + /** + * returns a built SignSolanaTransactionWithEndUserAccountRequest instance. + * + * The builder is not reusable. + */ + public SignSolanaTransactionWithEndUserAccountRequest build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SignSolanaTransactionWithEndUserAccountRequest.Builder builder() { + return new SignSolanaTransactionWithEndUserAccountRequest.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SignSolanaTransactionWithEndUserAccountRequest.Builder toBuilder() { + return new SignSolanaTransactionWithEndUserAccountRequest.Builder() + .address(getAddress()) + .transaction(getTransaction()) + .walletSecretId(getWalletSecretId()); + } + +} + diff --git a/java/src/main/java/com/coinbase/cdp/openapi/model/WebhookSubscriptionResponse.java b/java/src/main/java/com/coinbase/cdp/openapi/model/WebhookSubscriptionResponse.java index 6b4418c29..cb4fe9d80 100644 --- a/java/src/main/java/com/coinbase/cdp/openapi/model/WebhookSubscriptionResponse.java +++ b/java/src/main/java/com/coinbase/cdp/openapi/model/WebhookSubscriptionResponse.java @@ -42,6 +42,7 @@ */ @JsonPropertyOrder({ WebhookSubscriptionResponse.JSON_PROPERTY_CREATED_AT, + WebhookSubscriptionResponse.JSON_PROPERTY_UPDATED_AT, WebhookSubscriptionResponse.JSON_PROPERTY_DESCRIPTION, WebhookSubscriptionResponse.JSON_PROPERTY_EVENT_TYPES, WebhookSubscriptionResponse.JSON_PROPERTY_IS_ENABLED, @@ -57,6 +58,10 @@ public class WebhookSubscriptionResponse { @jakarta.annotation.Nonnull private OffsetDateTime createdAt; + public static final String JSON_PROPERTY_UPDATED_AT = "updatedAt"; + @jakarta.annotation.Nullable + private OffsetDateTime updatedAt; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; @jakarta.annotation.Nullable private String description; @@ -116,6 +121,30 @@ public void setCreatedAt(@jakarta.annotation.Nonnull OffsetDateTime createdAt) { } + public WebhookSubscriptionResponse updatedAt(@jakarta.annotation.Nullable OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * When the subscription was last updated. + * @return updatedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUpdatedAt(@jakarta.annotation.Nullable OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + } + + public WebhookSubscriptionResponse description(@jakarta.annotation.Nullable String description) { this.description = description; return this; @@ -337,6 +366,7 @@ public boolean equals(Object o) { } WebhookSubscriptionResponse webhookSubscriptionResponse = (WebhookSubscriptionResponse) o; return Objects.equals(this.createdAt, webhookSubscriptionResponse.createdAt) && + Objects.equals(this.updatedAt, webhookSubscriptionResponse.updatedAt) && Objects.equals(this.description, webhookSubscriptionResponse.description) && Objects.equals(this.eventTypes, webhookSubscriptionResponse.eventTypes) && Objects.equals(this.isEnabled, webhookSubscriptionResponse.isEnabled) && @@ -349,7 +379,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(createdAt, description, eventTypes, isEnabled, metadata, secret, subscriptionId, target, labels); + return Objects.hash(createdAt, updatedAt, description, eventTypes, isEnabled, metadata, secret, subscriptionId, target, labels); } @Override @@ -357,6 +387,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class WebhookSubscriptionResponse {\n"); sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" eventTypes: ").append(toIndentedString(eventTypes)).append("\n"); sb.append(" isEnabled: ").append(toIndentedString(isEnabled)).append("\n"); @@ -417,6 +448,11 @@ public String toUrlQueryString(String prefix) { joiner.add(String.format("%screatedAt%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getCreatedAt()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } + // add `updatedAt` to the URL query string + if (getUpdatedAt() != null) { + joiner.add(String.format("%supdatedAt%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getUpdatedAt()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + // add `description` to the URL query string if (getDescription() != null) { joiner.add(String.format("%sdescription%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getDescription()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); @@ -484,6 +520,10 @@ public WebhookSubscriptionResponse.Builder createdAt(OffsetDateTime createdAt) { this.instance.createdAt = createdAt; return this; } + public WebhookSubscriptionResponse.Builder updatedAt(OffsetDateTime updatedAt) { + this.instance.updatedAt = updatedAt; + return this; + } public WebhookSubscriptionResponse.Builder description(String description) { this.instance.description = description; return this; @@ -551,6 +591,7 @@ public static WebhookSubscriptionResponse.Builder builder() { public WebhookSubscriptionResponse.Builder toBuilder() { return new WebhookSubscriptionResponse.Builder() .createdAt(getCreatedAt()) + .updatedAt(getUpdatedAt()) .description(getDescription()) .eventTypes(getEventTypes()) .isEnabled(getIsEnabled()) diff --git a/java/src/main/java/com/coinbase/cdp/openapi/model/X402PaymentPayload.java b/java/src/main/java/com/coinbase/cdp/openapi/model/X402PaymentPayload.java index 006accfe7..facc76f32 100644 --- a/java/src/main/java/com/coinbase/cdp/openapi/model/X402PaymentPayload.java +++ b/java/src/main/java/com/coinbase/cdp/openapi/model/X402PaymentPayload.java @@ -21,8 +21,8 @@ import java.util.HashMap; import com.coinbase.cdp.openapi.model.X402ResourceInfo; import com.coinbase.cdp.openapi.model.X402V1PaymentPayload; -import com.coinbase.cdp.openapi.model.X402V1PaymentPayloadPayload; import com.coinbase.cdp.openapi.model.X402V2PaymentPayload; +import com.coinbase.cdp.openapi.model.X402V2PaymentPayloadPayload; import com.coinbase.cdp.openapi.model.X402V2PaymentRequirements; import com.coinbase.cdp.openapi.model.X402Version; import com.fasterxml.jackson.annotation.JsonInclude; @@ -283,15 +283,15 @@ public String toUrlQueryString(String prefix) { StringJoiner joiner = new StringJoiner("&"); - if (getActualInstance() instanceof X402V1PaymentPayload) { + if (getActualInstance() instanceof X402V2PaymentPayload) { if (getActualInstance() != null) { - joiner.add(((X402V1PaymentPayload)getActualInstance()).toUrlQueryString(prefix + "one_of_0" + suffix)); + joiner.add(((X402V2PaymentPayload)getActualInstance()).toUrlQueryString(prefix + "one_of_0" + suffix)); } return joiner.toString(); } - if (getActualInstance() instanceof X402V2PaymentPayload) { + if (getActualInstance() instanceof X402V1PaymentPayload) { if (getActualInstance() != null) { - joiner.add(((X402V2PaymentPayload)getActualInstance()).toUrlQueryString(prefix + "one_of_1" + suffix)); + joiner.add(((X402V1PaymentPayload)getActualInstance()).toUrlQueryString(prefix + "one_of_1" + suffix)); } return joiner.toString(); } diff --git a/java/src/main/java/com/coinbase/cdp/openapi/model/X402PaymentRequirements.java b/java/src/main/java/com/coinbase/cdp/openapi/model/X402PaymentRequirements.java index 1ccef7cd1..931094467 100644 --- a/java/src/main/java/com/coinbase/cdp/openapi/model/X402PaymentRequirements.java +++ b/java/src/main/java/com/coinbase/cdp/openapi/model/X402PaymentRequirements.java @@ -279,15 +279,15 @@ public String toUrlQueryString(String prefix) { StringJoiner joiner = new StringJoiner("&"); - if (getActualInstance() instanceof X402V1PaymentRequirements) { + if (getActualInstance() instanceof X402V2PaymentRequirements) { if (getActualInstance() != null) { - joiner.add(((X402V1PaymentRequirements)getActualInstance()).toUrlQueryString(prefix + "one_of_0" + suffix)); + joiner.add(((X402V2PaymentRequirements)getActualInstance()).toUrlQueryString(prefix + "one_of_0" + suffix)); } return joiner.toString(); } - if (getActualInstance() instanceof X402V2PaymentRequirements) { + if (getActualInstance() instanceof X402V1PaymentRequirements) { if (getActualInstance() != null) { - joiner.add(((X402V2PaymentRequirements)getActualInstance()).toUrlQueryString(prefix + "one_of_1" + suffix)); + joiner.add(((X402V1PaymentRequirements)getActualInstance()).toUrlQueryString(prefix + "one_of_1" + suffix)); } return joiner.toString(); } diff --git a/java/src/main/java/com/coinbase/cdp/openapi/model/X402V1PaymentPayload.java b/java/src/main/java/com/coinbase/cdp/openapi/model/X402V1PaymentPayload.java index 89a367f38..96244ed5f 100644 --- a/java/src/main/java/com/coinbase/cdp/openapi/model/X402V1PaymentPayload.java +++ b/java/src/main/java/com/coinbase/cdp/openapi/model/X402V1PaymentPayload.java @@ -19,7 +19,7 @@ import java.util.Objects; import java.util.Map; import java.util.HashMap; -import com.coinbase.cdp.openapi.model.X402V1PaymentPayloadPayload; +import com.coinbase.cdp.openapi.model.X402V2PaymentPayloadPayload; import com.coinbase.cdp.openapi.model.X402Version; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -130,7 +130,7 @@ public static NetworkEnum fromValue(String value) { public static final String JSON_PROPERTY_PAYLOAD = "payload"; @jakarta.annotation.Nonnull - private X402V1PaymentPayloadPayload payload; + private X402V2PaymentPayloadPayload payload; public X402V1PaymentPayload() { } @@ -207,7 +207,7 @@ public void setNetwork(@jakarta.annotation.Nonnull NetworkEnum network) { } - public X402V1PaymentPayload payload(@jakarta.annotation.Nonnull X402V1PaymentPayloadPayload payload) { + public X402V1PaymentPayload payload(@jakarta.annotation.Nonnull X402V2PaymentPayloadPayload payload) { this.payload = payload; return this; } @@ -219,14 +219,14 @@ public X402V1PaymentPayload payload(@jakarta.annotation.Nonnull X402V1PaymentPay @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_PAYLOAD) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public X402V1PaymentPayloadPayload getPayload() { + public X402V2PaymentPayloadPayload getPayload() { return payload; } @JsonProperty(JSON_PROPERTY_PAYLOAD) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setPayload(@jakarta.annotation.Nonnull X402V1PaymentPayloadPayload payload) { + public void setPayload(@jakarta.annotation.Nonnull X402V2PaymentPayloadPayload payload) { this.payload = payload; } @@ -356,7 +356,7 @@ public X402V1PaymentPayload.Builder network(NetworkEnum network) { this.instance.network = network; return this; } - public X402V1PaymentPayload.Builder payload(X402V1PaymentPayloadPayload payload) { + public X402V1PaymentPayload.Builder payload(X402V2PaymentPayloadPayload payload) { this.instance.payload = payload; return this; } diff --git a/java/src/main/java/com/coinbase/cdp/openapi/model/X402V2PaymentPayload.java b/java/src/main/java/com/coinbase/cdp/openapi/model/X402V2PaymentPayload.java index 75a862df7..534621d67 100644 --- a/java/src/main/java/com/coinbase/cdp/openapi/model/X402V2PaymentPayload.java +++ b/java/src/main/java/com/coinbase/cdp/openapi/model/X402V2PaymentPayload.java @@ -20,7 +20,7 @@ import java.util.Map; import java.util.HashMap; import com.coinbase.cdp.openapi.model.X402ResourceInfo; -import com.coinbase.cdp.openapi.model.X402V1PaymentPayloadPayload; +import com.coinbase.cdp.openapi.model.X402V2PaymentPayloadPayload; import com.coinbase.cdp.openapi.model.X402V2PaymentRequirements; import com.coinbase.cdp.openapi.model.X402Version; import com.fasterxml.jackson.annotation.JsonInclude; @@ -53,7 +53,7 @@ public class X402V2PaymentPayload { public static final String JSON_PROPERTY_PAYLOAD = "payload"; @jakarta.annotation.Nonnull - private X402V1PaymentPayloadPayload payload; + private X402V2PaymentPayloadPayload payload; public static final String JSON_PROPERTY_ACCEPTED = "accepted"; @jakarta.annotation.Nonnull @@ -94,7 +94,7 @@ public void setX402Version(@jakarta.annotation.Nonnull X402Version x402Version) } - public X402V2PaymentPayload payload(@jakarta.annotation.Nonnull X402V1PaymentPayloadPayload payload) { + public X402V2PaymentPayload payload(@jakarta.annotation.Nonnull X402V2PaymentPayloadPayload payload) { this.payload = payload; return this; } @@ -106,14 +106,14 @@ public X402V2PaymentPayload payload(@jakarta.annotation.Nonnull X402V1PaymentPay @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_PAYLOAD) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public X402V1PaymentPayloadPayload getPayload() { + public X402V2PaymentPayloadPayload getPayload() { return payload; } @JsonProperty(JSON_PROPERTY_PAYLOAD) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setPayload(@jakarta.annotation.Nonnull X402V1PaymentPayloadPayload payload) { + public void setPayload(@jakarta.annotation.Nonnull X402V2PaymentPayloadPayload payload) { this.payload = payload; } @@ -326,7 +326,7 @@ public X402V2PaymentPayload.Builder x402Version(X402Version x402Version) { this.instance.x402Version = x402Version; return this; } - public X402V2PaymentPayload.Builder payload(X402V1PaymentPayloadPayload payload) { + public X402V2PaymentPayload.Builder payload(X402V2PaymentPayloadPayload payload) { this.instance.payload = payload; return this; } diff --git a/java/src/main/java/com/coinbase/cdp/openapi/model/X402V2PaymentPayloadPayload.java b/java/src/main/java/com/coinbase/cdp/openapi/model/X402V2PaymentPayloadPayload.java new file mode 100644 index 000000000..ccb0965a3 --- /dev/null +++ b/java/src/main/java/com/coinbase/cdp/openapi/model/X402V2PaymentPayloadPayload.java @@ -0,0 +1,353 @@ +/* + * Coinbase Developer Platform APIs + * The Coinbase Developer Platform APIs - leading the world's transition onchain. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: cdp@coinbase.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.coinbase.cdp.openapi.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.coinbase.cdp.openapi.model.X402ExactEvmPayload; +import com.coinbase.cdp.openapi.model.X402ExactEvmPayloadAuthorization; +import com.coinbase.cdp.openapi.model.X402ExactEvmPermit2Payload; +import com.coinbase.cdp.openapi.model.X402ExactEvmPermit2PayloadPermit2Authorization; +import com.coinbase.cdp.openapi.model.X402ExactSolanaPayload; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import com.fasterxml.jackson.core.type.TypeReference; + +import java.io.IOException; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.JsonToken; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.MapperFeature; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import com.coinbase.cdp.openapi.JSON; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +@JsonDeserialize(using = X402V2PaymentPayloadPayload.X402V2PaymentPayloadPayloadDeserializer.class) +@JsonSerialize(using = X402V2PaymentPayloadPayload.X402V2PaymentPayloadPayloadSerializer.class) +public class X402V2PaymentPayloadPayload extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(X402V2PaymentPayloadPayload.class.getName()); + + public static class X402V2PaymentPayloadPayloadSerializer extends StdSerializer { + public X402V2PaymentPayloadPayloadSerializer(Class t) { + super(t); + } + + public X402V2PaymentPayloadPayloadSerializer() { + this(null); + } + + @Override + public void serialize(X402V2PaymentPayloadPayload value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class X402V2PaymentPayloadPayloadDeserializer extends StdDeserializer { + public X402V2PaymentPayloadPayloadDeserializer() { + this(X402V2PaymentPayloadPayload.class); + } + + public X402V2PaymentPayloadPayloadDeserializer(Class vc) { + super(vc); + } + + @Override + public X402V2PaymentPayloadPayload deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { + JsonNode tree = jp.readValueAsTree(); + Object deserialized = null; + boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); + int match = 0; + JsonToken token = tree.traverse(jp.getCodec()).nextToken(); + // deserialize X402ExactEvmPayload + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (X402ExactEvmPayload.class.equals(Integer.class) || X402ExactEvmPayload.class.equals(Long.class) || X402ExactEvmPayload.class.equals(Float.class) || X402ExactEvmPayload.class.equals(Double.class) || X402ExactEvmPayload.class.equals(Boolean.class) || X402ExactEvmPayload.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((X402ExactEvmPayload.class.equals(Integer.class) || X402ExactEvmPayload.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((X402ExactEvmPayload.class.equals(Float.class) || X402ExactEvmPayload.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (X402ExactEvmPayload.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (X402ExactEvmPayload.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(X402ExactEvmPayload.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'X402ExactEvmPayload'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'X402ExactEvmPayload'", e); + } + + // deserialize X402ExactEvmPermit2Payload + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (X402ExactEvmPermit2Payload.class.equals(Integer.class) || X402ExactEvmPermit2Payload.class.equals(Long.class) || X402ExactEvmPermit2Payload.class.equals(Float.class) || X402ExactEvmPermit2Payload.class.equals(Double.class) || X402ExactEvmPermit2Payload.class.equals(Boolean.class) || X402ExactEvmPermit2Payload.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((X402ExactEvmPermit2Payload.class.equals(Integer.class) || X402ExactEvmPermit2Payload.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((X402ExactEvmPermit2Payload.class.equals(Float.class) || X402ExactEvmPermit2Payload.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (X402ExactEvmPermit2Payload.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (X402ExactEvmPermit2Payload.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(X402ExactEvmPermit2Payload.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'X402ExactEvmPermit2Payload'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'X402ExactEvmPermit2Payload'", e); + } + + // deserialize X402ExactSolanaPayload + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (X402ExactSolanaPayload.class.equals(Integer.class) || X402ExactSolanaPayload.class.equals(Long.class) || X402ExactSolanaPayload.class.equals(Float.class) || X402ExactSolanaPayload.class.equals(Double.class) || X402ExactSolanaPayload.class.equals(Boolean.class) || X402ExactSolanaPayload.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((X402ExactSolanaPayload.class.equals(Integer.class) || X402ExactSolanaPayload.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((X402ExactSolanaPayload.class.equals(Float.class) || X402ExactSolanaPayload.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (X402ExactSolanaPayload.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (X402ExactSolanaPayload.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(X402ExactSolanaPayload.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'X402ExactSolanaPayload'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'X402ExactSolanaPayload'", e); + } + + if (match == 1) { + X402V2PaymentPayloadPayload ret = new X402V2PaymentPayloadPayload(); + ret.setActualInstance(deserialized); + return ret; + } + throw new IOException(String.format("Failed deserialization for X402V2PaymentPayloadPayload: %d classes match result, expected 1", match)); + } + + /** + * Handle deserialization of the 'null' value. + */ + @Override + public X402V2PaymentPayloadPayload getNullValue(DeserializationContext ctxt) throws JsonMappingException { + throw new JsonMappingException(ctxt.getParser(), "X402V2PaymentPayloadPayload cannot be null"); + } + } + + // store a list of schema names defined in oneOf + public static final Map> schemas = new HashMap<>(); + + public X402V2PaymentPayloadPayload() { + super("oneOf", Boolean.FALSE); + } + + public X402V2PaymentPayloadPayload(X402ExactEvmPayload o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public X402V2PaymentPayloadPayload(X402ExactEvmPermit2Payload o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public X402V2PaymentPayloadPayload(X402ExactSolanaPayload o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("X402ExactEvmPayload", X402ExactEvmPayload.class); + schemas.put("X402ExactEvmPermit2Payload", X402ExactEvmPermit2Payload.class); + schemas.put("X402ExactSolanaPayload", X402ExactSolanaPayload.class); + JSON.registerDescendants(X402V2PaymentPayloadPayload.class, Collections.unmodifiableMap(schemas)); + } + + @Override + public Map> getSchemas() { + return X402V2PaymentPayloadPayload.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * X402ExactEvmPayload, X402ExactEvmPermit2Payload, X402ExactSolanaPayload + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf(X402ExactEvmPayload.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(X402ExactEvmPermit2Payload.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(X402ExactSolanaPayload.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be X402ExactEvmPayload, X402ExactEvmPermit2Payload, X402ExactSolanaPayload"); + } + + /** + * Get the actual instance, which can be the following: + * X402ExactEvmPayload, X402ExactEvmPermit2Payload, X402ExactSolanaPayload + * + * @return The actual instance (X402ExactEvmPayload, X402ExactEvmPermit2Payload, X402ExactSolanaPayload) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `X402ExactEvmPayload`. If the actual instance is not `X402ExactEvmPayload`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `X402ExactEvmPayload` + * @throws ClassCastException if the instance is not `X402ExactEvmPayload` + */ + public X402ExactEvmPayload getX402ExactEvmPayload() throws ClassCastException { + return (X402ExactEvmPayload)super.getActualInstance(); + } + + /** + * Get the actual instance of `X402ExactEvmPermit2Payload`. If the actual instance is not `X402ExactEvmPermit2Payload`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `X402ExactEvmPermit2Payload` + * @throws ClassCastException if the instance is not `X402ExactEvmPermit2Payload` + */ + public X402ExactEvmPermit2Payload getX402ExactEvmPermit2Payload() throws ClassCastException { + return (X402ExactEvmPermit2Payload)super.getActualInstance(); + } + + /** + * Get the actual instance of `X402ExactSolanaPayload`. If the actual instance is not `X402ExactSolanaPayload`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `X402ExactSolanaPayload` + * @throws ClassCastException if the instance is not `X402ExactSolanaPayload` + */ + public X402ExactSolanaPayload getX402ExactSolanaPayload() throws ClassCastException { + return (X402ExactSolanaPayload)super.getActualInstance(); + } + + + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + if (getActualInstance() instanceof X402ExactEvmPayload) { + if (getActualInstance() != null) { + joiner.add(((X402ExactEvmPayload)getActualInstance()).toUrlQueryString(prefix + "one_of_0" + suffix)); + } + return joiner.toString(); + } + if (getActualInstance() instanceof X402ExactEvmPermit2Payload) { + if (getActualInstance() != null) { + joiner.add(((X402ExactEvmPermit2Payload)getActualInstance()).toUrlQueryString(prefix + "one_of_1" + suffix)); + } + return joiner.toString(); + } + if (getActualInstance() instanceof X402ExactSolanaPayload) { + if (getActualInstance() != null) { + joiner.add(((X402ExactSolanaPayload)getActualInstance()).toUrlQueryString(prefix + "one_of_2" + suffix)); + } + return joiner.toString(); + } + return null; + } + +} + diff --git a/openapi.yaml b/openapi.yaml index 7a25e3e67..b1f0adf69 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -13,9 +13,36 @@ info: servers: - url: https://api.cdp.coinbase.com/platform description: The production server of the CDP APIs. + - url: https://api.cdp.coinbase.com/platform/delegated + description: The production server of the CDP Embedded Wallet APIs for delegated signing operations. security: - apiKeyAuth: [] tags: + - name: Embedded Wallets (Core Functionality) + x-audience: public + description: |- + The Embedded Wallet APIs enable end users to directly create, manage, and use their accounts. They are typically accessed via the CDP Web SDK. End users authenticate with the APIs via the `InitiateAuthentication` endpoint, and use the returned access token and refresh token to authenticate with the other endpoints. The Embedded Wallet APIs offer end users full control over their accounts, including the ability to sign transactions and messages, and to export their accounts' private keys. + + There are three authentication credentials involved in the Embedded Wallet APIs: + + 1. **Access Token**: A JWT signed by CDP, encoded in base64. This is used to identify the end user, and is + issued after the end user has signed in using one of the provided authentication methods. + The APIs provide multiple mechanisms for end user authentication, including custom auth JWT authentication, + email one-time-password (OTP) authentication, and social sign-in. + + + 2. **Refresh Token**: A cryptographically random string, set as the `cdp_refresh_token` cookie in the end user's browser. + By hitting the `RefreshAccessToken` endpoint, the included refresh token can be used to obtain a new access token + without requiring the end user to sign in again. + + + 3. **Temporary Wallet Secret (TWS)**: Requests to signing-related endpoints must also be authenticated using a + **Temporary Wallet Secret** (TWS) generated on the end user's browser/device. Typically, this is done using the CDP Embedded Wallet SDK. The Temporary Wallet Secret + follows similar semantics to the Wallet Secret used by the EVM and Solana Account APIs, with the following key differences: + + - The end user must register their TWS with the End User Accounts APIs before it can be used. + - Temporary Wallet Secrets have a time-to-live (TTL) defined by the `validUntil` field in the TWS registration request. + - A maximum of five TWS's can be registered for a single end user at any given time. - name: End User Accounts x-audience: public description: |- @@ -555,9 +582,9 @@ tags: - For native SOL, `decimals` is 9 (1 SOL = 10^9 lamports). - For SPL tokens, `decimals` is defined in the token's mint configuration. - - name: SQL API (Alpha) + - name: SQL API x-audience: public - description: The SQL APIs enable you to write performant, high-freshness, and endlessly flexible SQL queries against onchain data. + description: The SQL API enables you to write performant, high-freshness, and endlessly flexible SQL queries against onchain data. - name: Webhooks x-audience: public description: Subscribe to real-time events across CDP products. Monitor onchain activity on Base mainnet, track onramp/offramp transactions, and receive instant notifications for wallet events. @@ -1468,84 +1495,73 @@ paths: $ref: '#/components/responses/BadGatewayError' '503': $ref: '#/components/responses/ServiceUnavailableError' - /v2/evm/accounts: - get: - x-audience: public - summary: List EVM accounts - description: |- - Lists the EVM accounts belonging to the developer's CDP Project. - The response is paginated, and by default, returns 20 accounts per page. - operationId: listEvmAccounts - tags: - - EVM Accounts - security: - - apiKeyAuth: [] - parameters: - - $ref: '#/components/parameters/PageSize' - - $ref: '#/components/parameters/PageToken' - responses: - '200': - description: Successfully listed EVM accounts. - content: - application/json: - schema: - allOf: - - type: object - properties: - accounts: - type: array - items: - $ref: '#/components/schemas/EvmAccount' - description: The list of EVM accounts. - required: - - accounts - - $ref: '#/components/schemas/ListResponse' - '500': - $ref: '#/components/responses/InternalServerError' - '502': - $ref: '#/components/responses/BadGatewayError' - '503': - $ref: '#/components/responses/ServiceUnavailableError' + /v2/embedded-wallet-api/projects/{projectId}/end-users/{userId}/evm/sign: post: x-audience: public - summary: Create an EVM account - description: Creates a new EVM account. - operationId: createEvmAccount + summary: Sign a hash with end user EVM account + description: Signs an arbitrary 32 byte hash with the end user's given EVM account. + operationId: signEvmHashWithEndUserAccount tags: - - EVM Accounts + - Embedded Wallets (Core Functionality) security: - - apiKeyAuth: [] + - endUserAuth: [] parameters: + - name: projectId + in: path + required: true + description: The ID of the CDP Project. + schema: + type: string + pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$ + example: 8e03978e-40d5-43e8-bc93-6894a57f9324 + - name: userId + in: path + required: true + description: The ID of the end user. + schema: + type: string + pattern: ^[a-zA-Z0-9-]{1,100}$ + example: e051beeb-7163-4527-a5b6-35e301529ff2 - $ref: '#/components/parameters/XWalletAuth' - $ref: '#/components/parameters/IdempotencyKey' + - $ref: '#/components/parameters/XDeveloperAuth' requestBody: - required: false content: application/json: schema: type: object properties: - name: + hash: type: string - description: |- - An optional name for the account. - Account names can consist of alphanumeric characters and hyphens, and be between 2 and 36 characters long. - Account names must be unique across all EVM accounts in the developer's CDP Project. - example: my-wallet - pattern: ^[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$ - accountPolicy: + description: The arbitrary 32 byte hash to sign. + example: '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef' + address: type: string - x-audience: public - description: The ID of the account-level policy to apply to the account. - pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$ - example: 123e4567-e89b-12d3-a456-426614174000 + description: The 0x-prefixed address of the EVM account belonging to the end user. + example: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e' + pattern: ^0x[0-9a-fA-F]{40}$ + walletSecretId: + description: Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header. + type: string + pattern: ^[a-zA-Z0-9-]{1,100}$ + example: e051beeb-7163-4527-a5b6-35e301529ff2 + required: + - hash + - address responses: - '201': - description: Successfully created EVM account. + '200': + description: Successfully signed hash. content: application/json: schema: - $ref: '#/components/schemas/EvmAccount' + type: object + properties: + signature: + type: string + description: The signature of the hash, as a 0x-prefixed hex string. + example: '0x1b0c9cf8cd4554c6c6d9e7311e88f1be075d7f25b418a044f4bf2c0a42a93e212ad0a8b54de9e0b5f7e3812de3f2c6cc79aa8c3e1c02e7ad14b4a8f42012c2c01b' + required: + - signature '400': description: Invalid request. content: @@ -1556,31 +1572,24 @@ paths: invalid_request: value: errorType: invalid_request - errorMessage: Project has no secret. Please register a secret with the project. + errorMessage: Request body must be specified. '401': - description: Unauthorized. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - examples: - unauthorized: - value: - errorType: unauthorized - errorMessage: Wallet authentication error. + $ref: '#/components/responses/UnauthorizedError' '402': $ref: '#/components/responses/PaymentMethodRequiredError' - '409': - description: Resource already exists. + '404': + description: Not found. content: application/json: schema: $ref: '#/components/schemas/Error' examples: - already_exists: + not_found: value: - errorType: already_exists - errorMessage: EVM account with the given name already exists. + errorType: not_found + errorMessage: End user with the given ID not found. + '409': + $ref: '#/components/responses/AlreadyExistsError' '422': $ref: '#/components/responses/IdempotencyError' '500': @@ -1589,32 +1598,78 @@ paths: $ref: '#/components/responses/BadGatewayError' '503': $ref: '#/components/responses/ServiceUnavailableError' - /v2/evm/accounts/{address}: - get: + /v2/embedded-wallet-api/projects/{projectId}/end-users/{userId}/evm/sign/transaction: + post: x-audience: public - summary: Get an EVM account by address - description: Gets an EVM account by its address. - operationId: getEvmAccount + summary: Sign a transaction with end user EVM account + description: |- + Signs a transaction with the given end user EVM account. + The transaction should be serialized as a hex string using [RLP](https://ethereum.org/en/developers/docs/data-structures-and-encoding/rlp/). + + The transaction must be an [EIP-1559 dynamic fee transaction](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1559.md). The developer is responsible for ensuring that the unsigned transaction is valid, as the API will not validate the transaction. + operationId: signEvmTransactionWithEndUserAccount tags: - - EVM Accounts + - Embedded Wallets (Core Functionality) security: + - endUserAuth: [] - apiKeyAuth: [] parameters: - - name: address - description: The 0x-prefixed address of the EVM account. The address does not need to be checksummed. + - $ref: '#/components/parameters/XWalletAuth' + - $ref: '#/components/parameters/IdempotencyKey' + - name: projectId + description: The ID of the CDP Project. in: path required: true schema: type: string - pattern: ^0x[0-9a-fA-F]{40}$ - example: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e' + pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$ + example: 8e03978e-40d5-43e8-bc93-6894a57f9324 + - name: userId + description: The ID of the end user. + in: path + required: true + schema: + type: string + pattern: ^[a-zA-Z0-9-]{1,100}$ + example: e051beeb-7163-4527-a5b6-35e301529ff2 + - $ref: '#/components/parameters/XDeveloperAuth' + requestBody: + content: + application/json: + schema: + type: object + properties: + address: + type: string + description: The 0x-prefixed address of the EVM account belonging to the end user. + example: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e' + pattern: ^0x[0-9a-fA-F]{40}$ + transaction: + type: string + description: The RLP-encoded transaction to sign, as a 0x-prefixed hex string. + example: '0xf86b098505d21dba00830334509431415daf58e2c6b7323b4c58712fd92952145da79018080' + walletSecretId: + description: Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header. + type: string + pattern: ^[a-zA-Z0-9-]{1,100}$ + example: e051beeb-7163-4527-a5b6-35e301529ff2 + required: + - address + - transaction responses: '200': - description: Successfully got EVM account. + description: Successfully signed transaction. content: application/json: schema: - $ref: '#/components/schemas/EvmAccount' + type: object + properties: + signedTransaction: + type: string + description: The RLP-encoded signed transaction, as a 0x-prefixed hex string. + example: '0x1b0c9cf8cd4554c6c6d9e7311e88f1be075d7f25b418a044f4bf2c0a42a93e212ad0a8b54de9e0b5f7e3812de3f2c6cc79aa8c3e1c02e7ad14b4a8f42012c2c01b' + required: + - signedTransaction '400': description: Invalid request. content: @@ -1622,10 +1677,25 @@ paths: schema: $ref: '#/components/schemas/Error' examples: - invalid_request: + malformed_transaction: value: - errorType: invalid_request - errorMessage: 'request body has an error: doesn''t match schema: Error at "name": string doesn''t match the regular expression "^[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$"' + errorType: malformed_transaction + errorMessage: Malformed unsigned transaction. + '401': + $ref: '#/components/responses/UnauthorizedError' + '402': + $ref: '#/components/responses/PaymentMethodRequiredError' + '403': + description: Access to resource forbidden. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + examples: + forbidden: + value: + errorType: forbidden + errorMessage: Unable to sign transaction for this address. '404': description: Not found. content: @@ -1637,46 +1707,1922 @@ paths: value: errorType: not_found errorMessage: EVM account with the given address not found. + '409': + $ref: '#/components/responses/AlreadyExistsError' + '422': + $ref: '#/components/responses/IdempotencyError' '500': $ref: '#/components/responses/InternalServerError' '502': $ref: '#/components/responses/BadGatewayError' '503': $ref: '#/components/responses/ServiceUnavailableError' - put: + /v2/embedded-wallet-api/projects/{projectId}/end-users/{userId}/evm/send/transaction: + post: x-audience: public - summary: Update an EVM account - description: Updates an existing EVM account. Use this to update the account's name or account-level policy. - operationId: updateEvmAccount + summary: Send a transaction with end user EVM account + description: |- + Signs a transaction with the given end user EVM account and sends it to the indicated supported network. This API handles nonce management and gas estimation, leaving the developer to provide only the minimal set of fields necessary to send the transaction. The transaction should be serialized as a hex string using [RLP](https://ethereum.org/en/developers/docs/data-structures-and-encoding/rlp/). + + The transaction must be an [EIP-1559 dynamic fee transaction](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1559.md). + + + **Transaction fields and API behavior** + + - `to` *(Required)*: The address of the contract or account to send the transaction to. + - `chainId` *(Ignored)*: The value of the `chainId` field in the transaction is ignored. + The transaction will be sent to the network indicated by the `network` field in the request body. + + - `nonce` *(Optional)*: The nonce to use for the transaction. If not provided, the API will assign + a nonce to the transaction based on the current state of the account. + + - `maxPriorityFeePerGas` *(Optional)*: The maximum priority fee per gas to use for the transaction. + If not provided, the API will estimate a value based on current network conditions. + + - `maxFeePerGas` *(Optional)*: The maximum fee per gas to use for the transaction. + If not provided, the API will estimate a value based on current network conditions. + + - `gasLimit` *(Optional)*: The gas limit to use for the transaction. If not provided, the API will estimate a value + based on the `to` and `data` fields of the transaction. + + - `value` *(Optional)*: The amount of ETH, in wei, to send with the transaction. + - `data` *(Optional)*: The data to send with the transaction; only used for contract calls. + - `accessList` *(Optional)*: The access list to use for the transaction. + operationId: sendEvmTransactionWithEndUserAccount tags: - - EVM Accounts + - Embedded Wallets (Core Functionality) security: + - endUserAuth: [] - apiKeyAuth: [] parameters: + - $ref: '#/components/parameters/XWalletAuth' - $ref: '#/components/parameters/IdempotencyKey' - - name: address - description: The 0x-prefixed address of the EVM account. The address does not need to be checksummed. + - name: projectId in: path required: true + description: The ID of the CDP Project. schema: type: string - pattern: ^0x[0-9a-fA-F]{40}$ - example: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e' + pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$ + example: 8e03978e-40d5-43e8-bc93-6894a57f9324 + - name: userId + description: The ID of the end user. + in: path + required: true + schema: + type: string + pattern: ^[a-zA-Z0-9-]{1,100}$ + example: e051beeb-7163-4527-a5b6-35e301529ff2 + - $ref: '#/components/parameters/XDeveloperAuth' requestBody: content: application/json: schema: type: object properties: - name: + address: type: string - description: |- - An optional name for the account. - Account names can consist of alphanumeric characters and hyphens, and be between 2 and 36 characters long. - Account names must be unique across all EVM accounts in the developer's CDP Project. - example: my-wallet - pattern: ^[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$ - accountPolicy: + description: The 0x-prefixed address of the EVM account belonging to the end user. + example: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e' + pattern: ^0x[0-9a-fA-F]{40}$ + network: + type: string + description: The network to send the transaction to. + enum: + - base + - base-sepolia + - ethereum + - ethereum-sepolia + - avalanche + - polygon + - optimism + - arbitrum + example: base-sepolia + walletSecretId: + description: Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header. + type: string + pattern: ^[a-zA-Z0-9-]{1,100}$ + example: e051beeb-7163-4527-a5b6-35e301529ff2 + transaction: + type: string + description: The RLP-encoded transaction to sign and send, as a 0x-prefixed hex string. + example: '0xf86b098505d21dba00830334509431415daf58e2c6b7323b4c58712fd92952145da79018080' + required: + - address + - transaction + - network + responses: + '200': + description: Successfully signed and sent transaction. + content: + application/json: + schema: + type: object + properties: + transactionHash: + type: string + description: The hash of the transaction, as a 0x-prefixed hex string. + example: '0xf8f98fb6726fc936f24b2007df5cb20e2b8444ff3dfaa2a929335f432a9be2e7' + required: + - transactionHash + '400': + description: Invalid request. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + examples: + malformed_transaction: + value: + errorType: malformed_transaction + errorMessage: Malformed unsigned transaction. + '401': + $ref: '#/components/responses/UnauthorizedError' + '402': + $ref: '#/components/responses/PaymentMethodRequiredError' + '403': + description: Access to resource forbidden. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + examples: + forbidden: + value: + errorType: forbidden + errorMessage: Unable to sign transaction for this address. + '404': + description: Not found. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + examples: + not_found: + value: + errorType: not_found + errorMessage: EVM account with the given address not found. + '409': + $ref: '#/components/responses/AlreadyExistsError' + '422': + $ref: '#/components/responses/IdempotencyError' + '500': + $ref: '#/components/responses/InternalServerError' + '502': + $ref: '#/components/responses/BadGatewayError' + '503': + $ref: '#/components/responses/ServiceUnavailableError' + /v2/embedded-wallet-api/projects/{projectId}/end-users/{userId}/evm/{address}/send/{asset}: + post: + x-audience: public + summary: Send USDC on EVM + description: |- + Sends USDC from an end user's EVM account (EOA or Smart Account) to a recipient address on a supported EVM network. This endpoint simplifies USDC transfers by automatically handling contract resolution, decimal conversion, gas estimation, and transaction encoding. + The `amount` field accepts human-readable amounts as decimal strings (e.g., "1.5", "25.50"). + operationId: sendEvmAssetWithEndUserAccount + tags: + - Embedded Wallets (Core Functionality) + security: + - endUserAuth: [] + - apiKeyAuth: [] + parameters: + - $ref: '#/components/parameters/XWalletAuth' + - $ref: '#/components/parameters/IdempotencyKey' + - name: projectId + in: path + required: true + description: The ID of the CDP Project. + schema: + type: string + pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$ + example: 8e03978e-40d5-43e8-bc93-6894a57f9324 + - name: userId + in: path + required: true + description: The ID of the end user. + schema: + type: string + pattern: ^[a-zA-Z0-9-]{1,100}$ + example: e051beeb-7163-4527-a5b6-35e301529ff2 + - name: address + description: The 0x-prefixed address of the EVM account (EOA or Smart Account) to send USDC from. The address does not need to be checksummed. + in: path + required: true + schema: + allOf: + - $ref: '#/components/schemas/BlockchainAddress' + pattern: ^0x[0-9a-fA-F]{40}$ + example: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e' + - name: asset + in: path + required: true + description: The asset to send. Currently only "usdc" is supported. + schema: + allOf: + - $ref: '#/components/schemas/Asset' + enum: + - usdc + example: usdc + - $ref: '#/components/parameters/XDeveloperAuth' + requestBody: + content: + application/json: + schema: + type: object + properties: + to: + allOf: + - $ref: '#/components/schemas/BlockchainAddress' + pattern: ^0x[0-9a-fA-F]{40}$ + description: The 0x-prefixed address of the recipient. + example: '0x1234567890123456789012345678901234567890' + amount: + type: string + minLength: 1 + maxLength: 32 + description: The amount of USDC to send as a decimal string (e.g., "1.5" or "25.50"). + example: '1.50' + network: + type: string + description: The EVM network to send USDC on. + enum: + - base + - base-sepolia + - ethereum + - ethereum-sepolia + - avalanche + - polygon + - optimism + - arbitrum + example: base-sepolia + useCdpPaymaster: + type: boolean + description: Whether to use CDP Paymaster to sponsor gas fees. Only applicable for EVM Smart Accounts. When true, the transaction gas will be paid by the Paymaster, allowing users to send USDC without holding native gas tokens. Ignored for EOA accounts. Cannot be used together with `paymasterUrl`. + example: true + paymasterUrl: + allOf: + - $ref: '#/components/schemas/Url' + description: Optional custom Paymaster URL to use for gas sponsorship. Only applicable for EVM Smart Accounts. This allows you to use your own Paymaster service instead of CDP's Paymaster. Cannot be used together with `useCdpPaymaster`. + example: https://api.developer.coinbase.com/rpc/v1/base/AbCdEf123456 + walletSecretId: + description: Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header. + type: string + pattern: ^[a-zA-Z0-9-]{1,100}$ + example: e051beeb-7163-4527-a5b6-35e301529ff2 + required: + - to + - amount + - network + examples: + send_usdc_eoa: + summary: Send USDC from EOA + value: + to: '0x1234567890123456789012345678901234567890' + amount: '25.50' + network: base-sepolia + walletSecretId: e051beeb-7163-4527-a5b6-35e301529ff2 + send_usdc_smart_account_cdp_paymaster: + summary: Send USDC from Smart Account with CDP Paymaster + value: + to: '0x1234567890123456789012345678901234567890' + amount: '10.00' + network: base-sepolia + useCdpPaymaster: true + walletSecretId: e051beeb-7163-4527-a5b6-35e301529ff2 + send_usdc_smart_account_custom_paymaster: + summary: Send USDC from Smart Account with custom Paymaster + value: + to: '0x1234567890123456789012345678901234567890' + amount: '15.00' + network: base-sepolia + paymasterUrl: https://api.developer.coinbase.com/rpc/v1/base/AbCdEf123456 + walletSecretId: e051beeb-7163-4527-a5b6-35e301529ff2 + responses: + '200': + description: Successfully sent transaction. + content: + application/json: + schema: + type: object + properties: + transactionHash: + type: string + description: The hash of the transaction, as a 0x-prefixed hex string. Populated for EOA accounts. Null for Smart Accounts (use userOpHash instead). + example: '0xf8f98fb6726fc936f24b2007df5cb20e2b8444ff3dfaa2a929335f432a9be2e7' + nullable: true + userOpHash: + type: string + description: The hash of the user operation, as a 0x-prefixed hex string. Populated for Smart Accounts. Null for EOA accounts (use transactionHash instead). + example: '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef' + nullable: true + examples: + eoa_transfer: + summary: EOA transfer response + value: + transactionHash: '0xf8f98fb6726fc936f24b2007df5cb20e2b8444ff3dfaa2a929335f432a9be2e7' + userOpHash: null + smart_account_transfer: + summary: Smart Account transfer response + value: + transactionHash: null + userOpHash: '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef' + '400': + description: Invalid request. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + examples: + invalid_amount: + value: + errorType: invalid_request + errorMessage: Invalid amount format. Amount must be a valid decimal string. + errorParam: amount + errorLink: https://docs.cdp.coinbase.com/api-reference/v2/errors#invalid-request + invalid_network: + value: + errorType: invalid_request + errorMessage: Unsupported network for USDC transfers. + errorParam: network + errorLink: https://docs.cdp.coinbase.com/get-started/supported-networks#supported-networks + invalid_asset: + value: + errorType: invalid_request + errorMessage: Unsupported asset. Currently only 'usdc' is supported. + errorParam: asset + errorLink: https://docs.cdp.coinbase.com/api-reference/v2/errors#invalid-request + insufficient_balance: + value: + errorType: invalid_request + errorMessage: Account has insufficient USDC balance to complete the transfer. + errorParam: amount + errorLink: https://docs.cdp.coinbase.com/api-reference/v2/errors#invalid-request + conflicting_paymaster: + value: + errorType: invalid_request + errorMessage: Cannot specify both 'useCdpPaymaster' and 'paymasterUrl'. Please use only one. + errorLink: https://docs.cdp.coinbase.com/embedded-wallets/evm-features/smart-accounts#gas-sponsorship-with-paymaster + '401': + $ref: '#/components/responses/UnauthorizedError' + '402': + $ref: '#/components/responses/PaymentMethodRequiredError' + '404': + description: Not found. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + examples: + not_found: + value: + errorType: not_found + errorMessage: EVM account with the given address not found. + errorParam: address + errorLink: https://docs.cdp.coinbase.com/api-reference/v2/errors#not-found + '422': + $ref: '#/components/responses/IdempotencyError' + '500': + $ref: '#/components/responses/InternalServerError' + '502': + $ref: '#/components/responses/BadGatewayError' + '503': + $ref: '#/components/responses/ServiceUnavailableError' + /v2/embedded-wallet-api/projects/{projectId}/end-users/{userId}/evm/sign/message: + post: + x-audience: public + summary: Sign an EIP-191 message with end user EVM account + description: |- + Signs an [EIP-191](https://eips.ethereum.org/EIPS/eip-191) message with the given end user EVM account. + + Per the specification, the message in the request body is prepended with `0x19 <0x45 (E)> ` before being signed. + operationId: signEvmMessageWithEndUserAccount + tags: + - Embedded Wallets (Core Functionality) + security: + - endUserAuth: [] + - apiKeyAuth: [] + parameters: + - $ref: '#/components/parameters/XWalletAuth' + - $ref: '#/components/parameters/IdempotencyKey' + - name: projectId + description: The ID of the CDP Project. + in: path + required: true + schema: + type: string + pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$ + example: 8e03978e-40d5-43e8-bc93-6894a57f9324 + - name: userId + description: The ID of the end user. + in: path + required: true + schema: + type: string + pattern: ^[a-zA-Z0-9-]{1,100}$ + example: e051beeb-7163-4527-a5b6-35e301529ff2 + - $ref: '#/components/parameters/XDeveloperAuth' + requestBody: + content: + application/json: + schema: + type: object + properties: + address: + type: string + description: The 0x-prefixed address of the EVM account belonging to the end user. + example: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e' + pattern: ^0x[0-9a-fA-F]{40}$ + message: + type: string + description: The message to sign. + example: Hello, world! + walletSecretId: + description: Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header. + type: string + pattern: ^[a-zA-Z0-9-]{1,100}$ + example: e051beeb-7163-4527-a5b6-35e301529ff2 + required: + - address + - message + responses: + '200': + description: Successfully signed message. + content: + application/json: + schema: + type: object + properties: + signature: + type: string + description: The signature of the message, as a 0x-prefixed hex string. + example: '0x1b0c9cf8cd4554c6c6d9e7311e88f1be075d7f25b418a044f4bf2c0a42a93e212ad0a8b54de9e0b5f7e3812de3f2c6cc79aa8c3e1c02e7ad14b4a8f42012c2c01b' + required: + - signature + '401': + $ref: '#/components/responses/UnauthorizedError' + '402': + $ref: '#/components/responses/PaymentMethodRequiredError' + '404': + description: Not found. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + examples: + not_found: + value: + errorType: not_found + errorMessage: EVM account with the given address not found. + '409': + $ref: '#/components/responses/AlreadyExistsError' + '422': + $ref: '#/components/responses/IdempotencyError' + '500': + $ref: '#/components/responses/InternalServerError' + '502': + $ref: '#/components/responses/BadGatewayError' + '503': + $ref: '#/components/responses/ServiceUnavailableError' + /v2/embedded-wallet-api/projects/{projectId}/end-users/{userId}/evm/sign/typed-data: + post: + x-audience: public + summary: Sign EIP-712 typed data with end user EVM account + description: Signs [EIP-712](https://eips.ethereum.org/EIPS/eip-712) typed data with the given end user EVM account. + operationId: signEvmTypedDataWithEndUserAccount + tags: + - Embedded Wallets (Core Functionality) + security: + - endUserAuth: [] + - apiKeyAuth: [] + parameters: + - $ref: '#/components/parameters/XWalletAuth' + - $ref: '#/components/parameters/IdempotencyKey' + - name: projectId + description: The ID of the CDP Project. + in: path + required: true + schema: + type: string + pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$ + example: 8e03978e-40d5-43e8-bc93-6894a57f9324 + - name: userId + description: The ID of the end user. + in: path + required: true + schema: + type: string + pattern: ^[a-zA-Z0-9-]{1,100}$ + example: e051beeb-7163-4527-a5b6-35e301529ff2 + - $ref: '#/components/parameters/XDeveloperAuth' + requestBody: + content: + application/json: + schema: + type: object + properties: + address: + type: string + description: The 0x-prefixed address of the EVM account belonging to the end user. + example: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e' + pattern: ^0x[0-9a-fA-F]{40}$ + typedData: + $ref: '#/components/schemas/EIP712Message' + walletSecretId: + description: Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header. + type: string + pattern: ^[a-zA-Z0-9-]{1,100}$ + example: e051beeb-7163-4527-a5b6-35e301529ff2 + required: + - address + - typedData + responses: + '200': + description: Successfully signed typed data. + content: + application/json: + schema: + type: object + properties: + signature: + type: string + description: The signature of the typed data, as a 0x-prefixed hex string. + example: '0x1b0c9cf8cd4554c6c6d9e7311e88f1be075d7f25b418a044f4bf2c0a42a93e212ad0a8b54de9e0b5f7e3812de3f2c6cc79aa8c3e1c02e7ad14b4a8f42012c2c01b' + required: + - signature + '400': + description: Invalid request. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + examples: + invalid_request: + value: + errorType: invalid_request + errorMessage: Invalid request. Please check the request body and parameters. + '401': + $ref: '#/components/responses/UnauthorizedError' + '402': + $ref: '#/components/responses/PaymentMethodRequiredError' + '404': + description: Not found. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + examples: + not_found: + value: + errorType: not_found + errorMessage: EVM account with the given address not found. + '422': + $ref: '#/components/responses/IdempotencyError' + '500': + $ref: '#/components/responses/InternalServerError' + '502': + $ref: '#/components/responses/BadGatewayError' + '503': + $ref: '#/components/responses/ServiceUnavailableError' + /v2/embedded-wallet-api/projects/{projectId}/end-users/{userId}/delegation: + delete: + x-audience: public + summary: Revoke delegation for end user + description: Revokes all active delegations for the specified end user. This operation can be performed by the end user themselves or by a developer using their API key. + operationId: revokeDelegationForEndUser + tags: + - Embedded Wallets (Core Functionality) + security: + - endUserAuth: [] + - apiKeyAuth: [] + parameters: + - $ref: '#/components/parameters/XWalletAuthOptional' + - $ref: '#/components/parameters/XDeveloperAuth' + required: false + - $ref: '#/components/parameters/IdempotencyKey' + - name: projectId + in: path + required: true + description: The ID of the CDP Project. + schema: + type: string + pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$ + example: 8e03978e-40d5-43e8-bc93-6894a57f9324 + - name: userId + in: path + required: true + description: The ID of the end user. + schema: + type: string + pattern: ^[a-zA-Z0-9-]{1,100}$ + example: e051beeb-7163-4527-a5b6-35e301529ff2 + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + walletSecretId: + description: When revoking with a wallet authentication scheme, the ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header. + type: string + pattern: ^[a-zA-Z0-9-]{1,100}$ + example: e051beeb-7163-4527-a5b6-35e301529ff2 + example: + walletSecretId: e051beeb-7163-4527-a5b6-35e301529ff2 + responses: + '204': + description: Delegation revoked successfully. + '401': + $ref: '#/components/responses/UnauthorizedError' + '404': + description: Delegation not found. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + examples: + not_found: + value: + errorType: not_found + errorMessage: No active delegation found for the specified end user. + errorParam: userId + errorLink: https://docs.cdp.coinbase.com/api-reference/v2/errors#not-found + '500': + $ref: '#/components/responses/InternalServerError' + '502': + $ref: '#/components/responses/BadGatewayError' + '503': + $ref: '#/components/responses/ServiceUnavailableError' + /v2/embedded-wallet-api/projects/{projectId}/end-users/{userId}/evm/eip7702/delegation: + post: + x-audience: public + summary: Create EIP-7702 delegation for end user EVM account + description: |- + Creates an EIP-7702 delegation for an end user's EVM EOA account, upgrading it with smart account capabilities. + + This endpoint: + - Retrieves delegation artifacts from onchain + - Signs the EIP-7702 authorization for delegation + - Assembles and submits a Type 4 transaction + - Creates an associated smart account object + + The delegation allows the EVM EOA to be used as a smart account, which enables batched transactions and gas sponsorship via paymaster. + operationId: createEvmEip7702DelegationWithEndUserAccount + tags: + - Embedded Wallets (Core Functionality) + security: + - endUserAuth: [] + parameters: + - $ref: '#/components/parameters/XWalletAuth' + - $ref: '#/components/parameters/IdempotencyKey' + - name: projectId + in: path + required: true + description: The ID of the CDP Project. + schema: + type: string + pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$ + example: 8e03978e-40d5-43e8-bc93-6894a57f9324 + - name: userId + in: path + required: true + description: The ID of the end user. + schema: + type: string + pattern: ^[a-zA-Z0-9-]{1,100}$ + example: e051beeb-7163-4527-a5b6-35e301529ff2 + - $ref: '#/components/parameters/XDeveloperAuth' + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + address: + type: string + description: The 0x-prefixed address of the EVM account to delegate. + example: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e' + pattern: ^0x[0-9a-fA-F]{40}$ + network: + $ref: '#/components/schemas/EvmEip7702DelegationNetwork' + enableSpendPermissions: + type: boolean + description: Whether to configure spend permissions for the upgraded, delegated account. When enabled, the account can grant permissions for third parties to spend on its behalf. + default: false + example: true + walletSecretId: + description: Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header. + type: string + pattern: ^[a-zA-Z0-9-]{1,100}$ + example: e051beeb-7163-4527-a5b6-35e301529ff2 + required: + - address + - network + responses: + '201': + description: Delegation operation created successfully. + content: + application/json: + schema: + type: object + properties: + delegationOperationId: + type: string + format: uuid + description: The unique identifier for the delegation operation. Use this to poll the operation status. + example: a1b2c3d4-e5f6-7890-abcd-ef1234567890 + required: + - delegationOperationId + '400': + description: Invalid request. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + examples: + missing_network: + value: + errorType: invalid_request + errorMessage: Field 'network' is required. + errorParam: network + errorLink: https://docs.cdp.coinbase.com/api-reference/v2/errors#invalid-request + unsupported_network: + value: + errorType: invalid_request + errorMessage: Network 'gnosis' is not supported for EIP-7702. + errorParam: network + errorLink: https://docs.cdp.coinbase.com/api-reference/v2/errors#invalid-request + '401': + $ref: '#/components/responses/UnauthorizedError' + '402': + $ref: '#/components/responses/PaymentMethodRequiredError' + '404': + description: EVM account not found. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + examples: + not_found: + value: + errorType: not_found + errorMessage: EVM account with the given address not found. + errorParam: address + errorLink: https://docs.cdp.coinbase.com/api-reference/v2/errors#not-found + '409': + description: Account already delegated on the given network. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + examples: + already_delegated: + value: + errorType: already_exists + errorMessage: Account already has an active EIP-7702 delegation on the given network. + errorParam: address + errorLink: https://docs.cdp.coinbase.com/api-reference/v2/errors#already-exists + '422': + $ref: '#/components/responses/IdempotencyError' + '429': + description: Rate limit exceeded. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + examples: + rate_limit_exceeded: + value: + errorType: rate_limit_exceeded + errorMessage: Too many requests. Please try again later. + errorLink: https://docs.cdp.coinbase.com/api-reference/v2/errors#rate-limit-exceeded + '500': + $ref: '#/components/responses/InternalServerError' + '502': + $ref: '#/components/responses/BadGatewayError' + '503': + $ref: '#/components/responses/ServiceUnavailableError' + /v2/embedded-wallet-api/projects/{projectId}/end-users/{userId}/evm/smart-accounts/{address}/send: + post: + x-audience: public + summary: Send a user operation for end user Smart Account + description: Prepares, signs, and sends a user operation for an end user's Smart Account. + operationId: sendUserOperationWithEndUserAccount + tags: + - Embedded Wallets (Core Functionality) + security: + - endUserAuth: [] + parameters: + - $ref: '#/components/parameters/IdempotencyKey' + - $ref: '#/components/parameters/XWalletAuth' + - name: projectId + in: path + required: true + description: The ID of the CDP Project. + schema: + type: string + pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$ + example: 8e03978e-40d5-43e8-bc93-6894a57f9324 + - name: userId + in: path + required: true + description: The ID of the end user. + schema: + type: string + pattern: ^[a-zA-Z0-9-]{1,100}$ + example: e051beeb-7163-4527-a5b6-35e301529ff2 + - name: address + description: The address of the EVM Smart Account to execute the user operation from. + in: path + required: true + schema: + type: string + pattern: ^0x[0-9a-fA-F]{40}$ + example: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e' + - $ref: '#/components/parameters/XDeveloperAuth' + requestBody: + content: + application/json: + schema: + type: object + properties: + network: + $ref: '#/components/schemas/EvmUserOperationNetwork' + calls: + type: array + description: The list of calls to make from the Smart Account. + items: + $ref: '#/components/schemas/EvmCall' + useCdpPaymaster: + type: boolean + description: Whether to use the CDP Paymaster for the user operation. + example: true + paymasterUrl: + allOf: + - $ref: '#/components/schemas/Url' + description: The URL of the paymaster to use for the user operation. If using the CDP Paymaster, use the `useCdpPaymaster` option. + example: https://api.developer.coinbase.com/rpc/v1/base/ + walletSecretId: + description: Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header. + type: string + pattern: ^[a-zA-Z0-9-]{1,100}$ + example: e051beeb-7163-4527-a5b6-35e301529ff2 + dataSuffix: + type: string + pattern: ^0x[0-9a-fA-F]+$ + description: The EIP-8021 data suffix (hex-encoded) that enables transaction attribution for the user operation. + example: '0xdddddddd62617365617070070080218021802180218021802180218021' + required: + - network + - calls + - useCdpPaymaster + responses: + '200': + description: The user operation was successfully prepared, signed, and sent. + content: + application/json: + schema: + $ref: '#/components/schemas/EvmUserOperation' + '400': + description: Invalid request. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + examples: + invalid_request: + value: + errorType: invalid_request + errorMessage: Field "network" is required. + invalid_signature: + value: + errorType: invalid_signature + errorMessage: Failed to sign user operation. + '401': + $ref: '#/components/responses/UnauthorizedError' + '402': + $ref: '#/components/responses/PaymentMethodRequiredError' + '403': + description: Access to resource forbidden. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + examples: + forbidden: + value: + errorType: forbidden + errorMessage: Unable to sign transaction for this address. + '404': + description: Not found. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + examples: + not_found: + value: + errorType: not_found + errorMessage: End user Smart Account with the given address not found. + '429': + description: Rate limit exceeded. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + examples: + rate_limit_exceeded: + value: + errorType: rate_limit_exceeded + errorMessage: Max concurrent user operations reached. + '500': + $ref: '#/components/responses/InternalServerError' + '502': + $ref: '#/components/responses/BadGatewayError' + '503': + $ref: '#/components/responses/ServiceUnavailableError' + /v2/embedded-wallet-api/projects/{projectId}/end-users/{userId}/evm/smart-accounts/{address}/spend-permissions/revoke: + post: + x-audience: public + summary: Revoke a spend permission + description: Revokes an existing spend permission. + operationId: revokeSpendPermissionWithEndUserAccount + tags: + - Embedded Wallets (Core Functionality) + security: + - endUserAuth: [] + parameters: + - $ref: '#/components/parameters/XWalletAuth' + - $ref: '#/components/parameters/IdempotencyKey' + - name: projectId + in: path + required: true + description: The ID of the CDP Project. + schema: + type: string + pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$ + example: 8e03978e-40d5-43e8-bc93-6894a57f9324 + - name: userId + in: path + required: true + description: The ID of the end user. + schema: + type: string + pattern: ^[a-zA-Z0-9-]{1,100}$ + example: e051beeb-7163-4527-a5b6-35e301529ff2 + - name: address + description: The address of the Smart account this spend permission is valid for. + in: path + required: true + schema: + type: string + pattern: ^0x[0-9a-fA-F]{40}$ + example: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/RevokeSpendPermissionRequest' + responses: + '200': + description: Successfully revoked spend permission. + content: + application/json: + schema: + $ref: '#/components/schemas/EvmUserOperation' + '400': + description: Invalid request. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + examples: + invalid_request: + value: + errorType: invalid_request + errorMessage: Invalid request. Please check the request body and parameters. + '401': + $ref: '#/components/responses/UnauthorizedError' + '404': + description: Not found. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + examples: + not_found: + value: + errorType: not_found + errorMessage: Smart account not found. + '500': + $ref: '#/components/responses/InternalServerError' + '502': + $ref: '#/components/responses/BadGatewayError' + '503': + $ref: '#/components/responses/ServiceUnavailableError' + /v2/embedded-wallet-api/projects/{projectId}/end-users/{userId}/solana/sign: + post: + x-audience: public + summary: Sign a hash with end user Solana account + description: Signs an arbitrary 32 byte hash with the end user's given Solana account. + operationId: signSolanaHashWithEndUserAccount + tags: + - Embedded Wallets (Core Functionality) + security: + - endUserAuth: [] + - apiKeyAuth: [] + parameters: + - name: projectId + in: path + required: true + description: The ID of the CDP Project. + schema: + type: string + pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$ + example: 8e03978e-40d5-43e8-bc93-6894a57f9324 + - name: userId + in: path + required: true + description: The ID of the end user. + schema: + type: string + pattern: ^[a-zA-Z0-9-]{1,100}$ + example: e051beeb-7163-4527-a5b6-35e301529ff2 + - $ref: '#/components/parameters/XWalletAuth' + - $ref: '#/components/parameters/IdempotencyKey' + - $ref: '#/components/parameters/XDeveloperAuth' + requestBody: + content: + application/json: + schema: + type: object + properties: + hash: + type: string + description: The arbitrary 32 byte hash to sign as base58 encoded string. + example: 3CSwN61FYbyoT6tM7h2aY7u1YpPLedGrcnxrPv4Fz4xu + address: + type: string + description: The base58 encoded address of the Solana account belonging to the end user. + example: HpabPRRCFbBKSuJr5PdkVvQc85FyxyTWkFM2obBRSvHT + pattern: ^[1-9A-HJ-NP-Za-km-z]{32,44}$ + walletSecretId: + description: Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header. + type: string + pattern: ^[a-zA-Z0-9-]{1,100}$ + example: e051beeb-7163-4527-a5b6-35e301529ff2 + required: + - hash + - address + responses: + '200': + description: Successfully signed hash. + content: + application/json: + schema: + type: object + properties: + signature: + type: string + description: The signature of the hash, as a base58 encoded string. + example: 4YecmNqVT9QFqzuSvE9Zih3toZzNAijjXpj8xupgcC6E4VzwzFjuZBk5P99yz9JQaLRLm1K4L4FpMjxByFxQBe2h + required: + - signature + '400': + description: Invalid request. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + examples: + invalid_request: + value: + errorType: invalid_request + errorMessage: Request body must be specified. + '401': + $ref: '#/components/responses/UnauthorizedError' + '402': + $ref: '#/components/responses/PaymentMethodRequiredError' + '404': + description: Not found. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + examples: + not_found: + value: + errorType: not_found + errorMessage: End user with the given ID not found. + '409': + $ref: '#/components/responses/AlreadyExistsError' + '422': + $ref: '#/components/responses/IdempotencyError' + '500': + $ref: '#/components/responses/InternalServerError' + '502': + $ref: '#/components/responses/BadGatewayError' + '503': + $ref: '#/components/responses/ServiceUnavailableError' + /v2/embedded-wallet-api/projects/{projectId}/end-users/{userId}/solana/sign/message: + post: + x-audience: public + summary: Sign a Base64 encoded message + description: |- + Signs an arbitrary Base64 encoded message with the given Solana account. + **WARNING:** Never sign a message that you didn't generate as it may put your funds at risk. + operationId: signSolanaMessageWithEndUserAccount + tags: + - Embedded Wallets (Core Functionality) + security: + - endUserAuth: [] + - apiKeyAuth: [] + parameters: + - $ref: '#/components/parameters/XWalletAuth' + - $ref: '#/components/parameters/IdempotencyKey' + - name: projectId + description: The ID of the CDP Project. + in: path + required: true + schema: + type: string + pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$ + example: 8e03978e-40d5-43e8-bc93-6894a57f9324 + - name: userId + description: The ID of the end user. + in: path + required: true + schema: + type: string + pattern: ^[a-zA-Z0-9-]{1,100}$ + example: e051beeb-7163-4527-a5b6-35e301529ff2 + - $ref: '#/components/parameters/XDeveloperAuth' + requestBody: + content: + application/json: + schema: + type: object + properties: + address: + type: string + description: The base58 encoded address of the Solana account belonging to the end user. + example: HpabPRRCFbBKSuJr5PdkVvQc85FyxyTWkFM2obBRSvHT + pattern: ^[1-9A-HJ-NP-Za-km-z]{32,44}$ + message: + type: string + description: The base64 encoded arbitrary message to sign. + example: SGVsbG8sIHdvcmxk + walletSecretId: + description: Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header. + type: string + pattern: ^[a-zA-Z0-9-]{1,100}$ + example: e051beeb-7163-4527-a5b6-35e301529ff2 + required: + - address + - message + responses: + '200': + description: Successfully signed message. + content: + application/json: + schema: + type: object + properties: + signature: + type: string + description: The signature of the message, as a base58 encoded string. + example: 4YecmNqVT9QFqzuSvE9Zih3toZzNAijjXpj8xupgcC6E4VzwzFjuZBk5P99yz9JQaLRLm1K4L4FpMjxByFxQBe2h + required: + - signature + '400': + description: Invalid request. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + examples: + malformed_transaction: + value: + errorType: invalid_request + errorMessage: Malformed message to sign. + '401': + $ref: '#/components/responses/UnauthorizedError' + '402': + $ref: '#/components/responses/PaymentMethodRequiredError' + '404': + description: Solana account not found. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + examples: + not_found: + value: + errorType: not_found + errorMessage: Solana account with the given address not found. + '409': + $ref: '#/components/responses/AlreadyExistsError' + '422': + $ref: '#/components/responses/IdempotencyError' + '500': + $ref: '#/components/responses/InternalServerError' + '502': + $ref: '#/components/responses/BadGatewayError' + '503': + $ref: '#/components/responses/ServiceUnavailableError' + /v2/embedded-wallet-api/projects/{projectId}/end-users/{userId}/solana/sign/transaction: + post: + x-audience: public + summary: Sign a transaction with end user Solana account + description: |- + Signs a transaction with the given end user Solana account. + The unsigned transaction should be serialized into a byte array and then encoded as base64. + **Transaction types** + The following transaction types are supported: + * [Legacy transactions](https://solana-labs.github.io/solana-web3.js/classes/Transaction.html) + * [Versioned transactions](https://solana-labs.github.io/solana-web3.js/classes/VersionedTransaction.html) + The developer is responsible for ensuring that the unsigned transaction is valid, as the API will not validate the transaction. + operationId: signSolanaTransactionWithEndUserAccount + tags: + - Embedded Wallets (Core Functionality) + security: + - endUserAuth: [] + - apiKeyAuth: [] + parameters: + - name: projectId + in: path + required: true + description: The ID of the CDP Project. + schema: + type: string + pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$ + example: 8e03978e-40d5-43e8-bc93-6894a57f9324 + - name: userId + in: path + required: true + description: The ID of the end user. + schema: + type: string + pattern: ^[a-zA-Z0-9-]{1,100}$ + example: e051beeb-7163-4527-a5b6-35e301529ff2 + - $ref: '#/components/parameters/XWalletAuth' + - $ref: '#/components/parameters/IdempotencyKey' + - $ref: '#/components/parameters/XDeveloperAuth' + requestBody: + content: + application/json: + schema: + type: object + properties: + address: + type: string + description: The base58 encoded address of the Solana account belonging to the end user. + example: HpabPRRCFbBKSuJr5PdkVvQc85FyxyTWkFM2obBRSvHT + pattern: ^[1-9A-HJ-NP-Za-km-z]{32,44}$ + transaction: + type: string + description: The base64 encoded transaction to sign. + example: AQABAgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAQECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8CBgMBAQAAAAIBAwQAAAAABgIAAAAAAAYDBQEBAAAGBAgAAAAABgUAAAAA6AMAAAAAAAAGBgUBAQEBBgcEAQAAAAYICgMBAQIDBgkCBgAAAAYKAwABAQEGCwMGAQEBBgwDAAABAQAAAAA= + walletSecretId: + description: Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header. + type: string + pattern: ^[a-zA-Z0-9-]{1,100}$ + example: e051beeb-7163-4527-a5b6-35e301529ff2 + required: + - address + - transaction + responses: + '200': + description: Successfully signed transaction. + content: + application/json: + schema: + type: object + properties: + signedTransaction: + type: string + description: The base64 encoded signed transaction. + example: AQACAdSOvpk0UJXs/rQRXYKSI9hcR0bkGp24qGv6t0/M1XjcQpHf6AHwLcPjEtKQI7p/U0Zo98lnJ5/PZMfVq/0BAgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAQECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8CBgMBAQAAAAIBAwQAAAAABgIAAAAAAAYDBQEBAAAGBAgAAAAABgUAAAAA6AMAAAAAAAAGBgUBAQEBBgcEAQAAAAYICgMBAQIDBgkCBgAAAAYKAwABAQEGCwMGAQEBBgwDAAABAQAAAAA= + required: + - signedTransaction + '400': + description: Invalid request. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + examples: + malformed_transaction: + value: + errorType: malformed_transaction + errorMessage: Malformed unsigned transaction. + '401': + $ref: '#/components/responses/UnauthorizedError' + '402': + $ref: '#/components/responses/PaymentMethodRequiredError' + '403': + description: Access to resource forbidden. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + examples: + forbidden: + value: + errorType: forbidden + errorMessage: Unable to sign transaction for this address. + '404': + description: Not found. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + examples: + not_found: + value: + errorType: not_found + errorMessage: End user with the given ID not found. + '409': + $ref: '#/components/responses/AlreadyExistsError' + '422': + $ref: '#/components/responses/IdempotencyError' + '500': + $ref: '#/components/responses/InternalServerError' + '502': + $ref: '#/components/responses/BadGatewayError' + '503': + $ref: '#/components/responses/ServiceUnavailableError' + /v2/embedded-wallet-api/projects/{projectId}/end-users/{userId}/solana/send/transaction: + post: + x-audience: public + summary: Send a transaction with end user Solana account + description: |- + Signs a transaction with the given end user Solana account and sends it to the indicated supported network. + The API handles recent blockhash management and fee estimation, leaving the developer to provide only the minimal set of fields necessary to send the transaction. + The unsigned transaction should be serialized into a byte array and then encoded as base64. + **Transaction types** + The following transaction types are supported: + * [Legacy transactions](https://solana.com/developers/guides/advanced/versions#current-transaction-versions) + * [Versioned transactions](https://solana.com/developers/guides/advanced/versions) + **Instruction Batching** + To batch multiple operations, include multiple instructions within a single transaction. All instructions within a transaction are executed atomically - if any instruction fails, the entire transaction fails and is rolled back. + **Network Support** + The following Solana networks are supported: + * `solana` - Solana Mainnet + * `solana-devnet` - Solana Devnet + The developer is responsible for ensuring that the unsigned transaction is valid, as the API will not validate the transaction. + operationId: sendSolanaTransactionWithEndUserAccount + tags: + - Embedded Wallets (Core Functionality) + security: + - endUserAuth: [] + - apiKeyAuth: [] + parameters: + - $ref: '#/components/parameters/XWalletAuth' + - $ref: '#/components/parameters/IdempotencyKey' + - $ref: '#/components/parameters/XDeveloperAuth' + - name: projectId + in: path + required: true + description: The ID of the CDP Project. + schema: + type: string + pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$ + example: 8e03978e-40d5-43e8-bc93-6894a57f9324 + - name: userId + description: The ID of the end user. + in: path + required: true + schema: + type: string + pattern: ^[a-zA-Z0-9-]{1,100}$ + example: e051beeb-7163-4527-a5b6-35e301529ff2 + requestBody: + content: + application/json: + schema: + type: object + properties: + address: + type: string + description: The base58 encoded address of the Solana account belonging to the end user. + example: HpabPRRCFbBKSuJr5PdkVvQc85FyxyTWkFM2obBRSvHT + pattern: ^[1-9A-HJ-NP-Za-km-z]{32,44}$ + network: + type: string + description: The Solana network to send the transaction to. + enum: + - solana + - solana-devnet + example: solana-devnet + walletSecretId: + description: Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header. + type: string + pattern: ^[a-zA-Z0-9-]{1,100}$ + example: e051beeb-7163-4527-a5b6-35e301529ff2 + transaction: + type: string + description: The base64 encoded transaction to sign and send. This transaction can contain multiple instructions for native Solana batching. + example: AQABAgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAQECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8CBgMBAQAAAAIBAwQAAAAABgIAAAAAAAYDBQEBAAAGBAgAAAAABgUAAAAA6AMAAAAAAAAGBgUBAQEBBgcEAQAAAAYICgMBAQIDBgkCBgAAAAYKAwABAQEGCwMGAQEBBgwDAAABAQAAAAA= + useCdpSponsor: + type: boolean + description: Whether transaction fees should be sponsored by CDP. When true, CDP sponsors the transaction fees on behalf of the end user. When false, the end user is responsible for paying the transaction fees. + example: true + required: + - address + - network + - transaction + examples: + send_transaction: + summary: Send a transaction + value: + address: HpabPRRCFbBKSuJr5PdkVvQc85FyxyTWkFM2obBRSvHT + network: solana-devnet + transaction: AQABAgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAQECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8CBgMBAQAAAAIBAwQAAAAABgIAAAAAAAYDBQEBAAAGBAgAAAAABgUAAAAA6AMAAAAAAAAGBgUBAQEBBgcEAQAAAAYICgMBAQIDBgkCBgAAAAYKAwABAQEGCwMGAQEBBgwDAAABAQAAAAA= + walletSecretId: e051beeb-7163-4527-a5b6-35e301529ff2 + send_transaction_sponsored: + summary: Send a transaction with CDP gas sponsorship + value: + address: HpabPRRCFbBKSuJr5PdkVvQc85FyxyTWkFM2obBRSvHT + network: solana-devnet + transaction: AQABAgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAQECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8CBgMBAQAAAAIBAwQAAAAABgIAAAAAAAYDBQEBAAAGBAgAAAAABgUAAAAA6AMAAAAAAAAGBgUBAQEBBgcEAQAAAAYICgMBAQIDBgkCBgAAAAYKAwABAQEGCwMGAQEBBgwDAAABAQAAAAA= + walletSecretId: e051beeb-7163-4527-a5b6-35e301529ff2 + useCdpSponsor: true + responses: + '200': + description: Successfully signed and sent transaction. + content: + application/json: + schema: + type: object + properties: + transactionSignature: + type: string + description: The base58 encoded transaction signature. + example: 5VERv8NMvzbJMEkV8xnrLkEaWRtSz9CosKDYjCJjBRnbJLgp8uirBgmQpjKhoR4tjF3ZpRzrFmBV6UjKdiSZkQUW + required: + - transactionSignature + '400': + description: Invalid request. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + examples: + malformed_transaction: + value: + errorType: malformed_transaction + errorMessage: Malformed unsigned transaction. + '401': + $ref: '#/components/responses/UnauthorizedError' + '402': + $ref: '#/components/responses/PaymentMethodRequiredError' + '403': + description: Access to resource forbidden. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + examples: + forbidden: + value: + errorType: forbidden + errorMessage: Unable to sign transaction for this address. + '404': + description: Not found. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + examples: + not_found: + value: + errorType: not_found + errorMessage: Solana account with the given address not found. + '422': + $ref: '#/components/responses/IdempotencyError' + '500': + $ref: '#/components/responses/InternalServerError' + '502': + $ref: '#/components/responses/BadGatewayError' + '503': + $ref: '#/components/responses/ServiceUnavailableError' + /v2/embedded-wallet-api/projects/{projectId}/end-users/{userId}/solana/{address}/send/{asset}: + post: + x-audience: public + summary: Send USDC on Solana + description: |- + Sends USDC from an end user's Solana account to a recipient address on the Solana network. This endpoint simplifies USDC transfers by automatically handling mint resolution, Associated Token Account (ATA) creation, decimal conversion, and transaction encoding. + The `amount` field accepts human-readable amounts as decimal strings (e.g., "1.5", "25.50"). + Use the optional `createRecipientAta` parameter to control whether the sender pays for creating the recipient's Associated Token Account if it doesn't exist. + operationId: sendSolanaAssetWithEndUserAccount + tags: + - Embedded Wallets (Core Functionality) + security: + - endUserAuth: [] + - apiKeyAuth: [] + parameters: + - $ref: '#/components/parameters/XWalletAuth' + - $ref: '#/components/parameters/IdempotencyKey' + - $ref: '#/components/parameters/XDeveloperAuth' + - name: projectId + in: path + required: true + description: The ID of the CDP Project. + schema: + type: string + pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$ + example: 8e03978e-40d5-43e8-bc93-6894a57f9324 + - name: userId + in: path + required: true + description: The ID of the end user. + schema: + type: string + pattern: ^[a-zA-Z0-9-]{1,100}$ + example: e051beeb-7163-4527-a5b6-35e301529ff2 + - name: address + description: The base58 encoded address of the Solana account to send USDC from. + in: path + required: true + schema: + allOf: + - $ref: '#/components/schemas/BlockchainAddress' + pattern: ^[1-9A-HJ-NP-Za-km-z]{32,44}$ + example: HpabPRRCFbBKSuJr5PdkVvQc85FyxyTWkFM2obBRSvHT + - name: asset + in: path + required: true + description: The asset to send. Currently only "usdc" is supported. + schema: + allOf: + - $ref: '#/components/schemas/Asset' + enum: + - usdc + example: usdc + requestBody: + content: + application/json: + schema: + type: object + properties: + to: + allOf: + - $ref: '#/components/schemas/BlockchainAddress' + pattern: ^[1-9A-HJ-NP-Za-km-z]{32,44}$ + description: The base58 encoded address of the recipient. + example: ExXhNkgYf6efh7YyqDRVxPZuzafobao1A74drUdp8trd + amount: + type: string + minLength: 1 + maxLength: 32 + description: The amount of USDC to send as a decimal string (e.g., "1.5" or "25.50"). + example: '1.50' + network: + type: string + description: The Solana network to send USDC on. + enum: + - solana + - solana-devnet + example: solana-devnet + createRecipientAta: + type: boolean + description: Whether to automatically create an Associated Token Account (ATA) for the recipient if it doesn't exist. When true, the sender pays the rent-exempt minimum to create the recipient's USDC ATA. When false, the transaction will fail if the recipient doesn't have a USDC ATA. + example: true + walletSecretId: + description: Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header. + type: string + pattern: ^[a-zA-Z0-9-]{1,100}$ + example: e051beeb-7163-4527-a5b6-35e301529ff2 + useCdpSponsor: + type: boolean + description: Whether transaction fees should be sponsored by CDP. When true, CDP sponsors the transaction fees on behalf of the end user. When false, the end user is responsible for paying the transaction fees. + example: true + required: + - to + - amount + - network + examples: + send_usdc_auto_create_ata: + summary: Send USDC (auto-create ATA) + value: + to: ExXhNkgYf6efh7YyqDRVxPZuzafobao1A74drUdp8trd + amount: '25.50' + network: solana-devnet + createRecipientAta: true + walletSecretId: e051beeb-7163-4527-a5b6-35e301529ff2 + send_usdc_no_ata_creation: + summary: Send USDC (no ATA creation) + value: + to: ExXhNkgYf6efh7YyqDRVxPZuzafobao1A74drUdp8trd + amount: '5.00' + network: solana-devnet + createRecipientAta: false + walletSecretId: e051beeb-7163-4527-a5b6-35e301529ff2 + send_usdc_sponsored: + summary: Send USDC with CDP gas sponsorship + value: + to: ExXhNkgYf6efh7YyqDRVxPZuzafobao1A74drUdp8trd + amount: '25.50' + network: solana-devnet + walletSecretId: e051beeb-7163-4527-a5b6-35e301529ff2 + useCdpSponsor: true + responses: + '200': + description: Successfully sent transaction. + content: + application/json: + schema: + type: object + properties: + transactionSignature: + type: string + description: The base58 encoded transaction signature. + example: 5VERv8NMvzbJMEkV8xnrLkEaWRtSz9CosKDYjCJjBRnbJLgp8uirBgmQpjKhoR4tjF3ZpRzrFmBV6UjKdiSZkQUW + required: + - transactionSignature + examples: + successful_transfer: + value: + transactionSignature: 5VERv8NMvzbJMEkV8xnrLkEaWRtSz9CosKDYjCJjBRnbJLgp8uirBgmQpjKhoR4tjF3ZpRzrFmBV6UjKdiSZkQUW + '400': + description: Invalid request. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + examples: + invalid_amount: + value: + errorType: invalid_request + errorMessage: Invalid amount format. Amount must be a valid decimal string. + errorParam: amount + errorLink: https://docs.cdp.coinbase.com/api-reference/v2/errors#invalid-request + invalid_network: + value: + errorType: invalid_request + errorMessage: Unsupported network for USDC transfers. + errorParam: network + errorLink: https://docs.cdp.coinbase.com/get-started/supported-networks#supported-networks + invalid_asset: + value: + errorType: invalid_request + errorMessage: Unsupported asset. Currently only 'usdc' is supported. + errorParam: asset + errorLink: https://docs.cdp.coinbase.com/api-reference/v2/errors#invalid-request + insufficient_balance: + value: + errorType: invalid_request + errorMessage: Account has insufficient USDC balance to complete the transfer. + errorParam: amount + errorLink: https://docs.cdp.coinbase.com/api-reference/v2/errors#invalid-request + insufficient_sol: + value: + errorType: invalid_request + errorMessage: Account has insufficient SOL to pay for transaction fees and rent. + errorLink: https://docs.cdp.coinbase.com/api-reference/v2/errors#invalid-request + recipient_ata_missing: + value: + errorType: invalid_request + errorMessage: 'Recipient does not have a USDC Associated Token Account. Set ''createRecipientAta: true'' to create one automatically.' + errorParam: to + errorLink: https://docs.cdp.coinbase.com/api-reference/v2/errors#invalid-request + '401': + $ref: '#/components/responses/UnauthorizedError' + '402': + $ref: '#/components/responses/PaymentMethodRequiredError' + '404': + description: Not found. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + examples: + not_found: + value: + errorType: not_found + errorMessage: Solana account with the given address not found. + errorParam: address + errorLink: https://docs.cdp.coinbase.com/api-reference/v2/errors#not-found + '422': + $ref: '#/components/responses/IdempotencyError' + '500': + $ref: '#/components/responses/InternalServerError' + '502': + $ref: '#/components/responses/BadGatewayError' + '503': + $ref: '#/components/responses/ServiceUnavailableError' + /v2/evm/accounts: + get: + x-audience: public + summary: List EVM accounts + description: |- + Lists the EVM accounts belonging to the developer's CDP Project. + The response is paginated, and by default, returns 20 accounts per page. + operationId: listEvmAccounts + tags: + - EVM Accounts + security: + - apiKeyAuth: [] + parameters: + - $ref: '#/components/parameters/PageSize' + - $ref: '#/components/parameters/PageToken' + responses: + '200': + description: Successfully listed EVM accounts. + content: + application/json: + schema: + allOf: + - type: object + properties: + accounts: + type: array + items: + $ref: '#/components/schemas/EvmAccount' + description: The list of EVM accounts. + required: + - accounts + - $ref: '#/components/schemas/ListResponse' + '500': + $ref: '#/components/responses/InternalServerError' + '502': + $ref: '#/components/responses/BadGatewayError' + '503': + $ref: '#/components/responses/ServiceUnavailableError' + post: + x-audience: public + summary: Create an EVM account + description: Creates a new EVM account. + operationId: createEvmAccount + tags: + - EVM Accounts + security: + - apiKeyAuth: [] + parameters: + - $ref: '#/components/parameters/XWalletAuth' + - $ref: '#/components/parameters/IdempotencyKey' + requestBody: + required: false + content: + application/json: + schema: + type: object + properties: + name: + type: string + description: |- + An optional name for the account. + Account names can consist of alphanumeric characters and hyphens, and be between 2 and 36 characters long. + Account names must be unique across all EVM accounts in the developer's CDP Project. + example: my-wallet + pattern: ^[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$ + accountPolicy: + type: string + x-audience: public + description: The ID of the account-level policy to apply to the account. + pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$ + example: 123e4567-e89b-12d3-a456-426614174000 + responses: + '201': + description: Successfully created EVM account. + content: + application/json: + schema: + $ref: '#/components/schemas/EvmAccount' + '400': + description: Invalid request. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + examples: + invalid_request: + value: + errorType: invalid_request + errorMessage: Project has no secret. Please register a secret with the project. + '401': + description: Unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + examples: + unauthorized: + value: + errorType: unauthorized + errorMessage: Wallet authentication error. + '402': + $ref: '#/components/responses/PaymentMethodRequiredError' + '409': + description: Resource already exists. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + examples: + already_exists: + value: + errorType: already_exists + errorMessage: EVM account with the given name already exists. + '422': + $ref: '#/components/responses/IdempotencyError' + '500': + $ref: '#/components/responses/InternalServerError' + '502': + $ref: '#/components/responses/BadGatewayError' + '503': + $ref: '#/components/responses/ServiceUnavailableError' + /v2/evm/accounts/{address}: + get: + x-audience: public + summary: Get an EVM account by address + description: Gets an EVM account by its address. + operationId: getEvmAccount + tags: + - EVM Accounts + security: + - apiKeyAuth: [] + parameters: + - name: address + description: The 0x-prefixed address of the EVM account. The address does not need to be checksummed. + in: path + required: true + schema: + type: string + pattern: ^0x[0-9a-fA-F]{40}$ + example: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e' + responses: + '200': + description: Successfully got EVM account. + content: + application/json: + schema: + $ref: '#/components/schemas/EvmAccount' + '400': + description: Invalid request. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + examples: + invalid_request: + value: + errorType: invalid_request + errorMessage: 'request body has an error: doesn''t match schema: Error at "name": string doesn''t match the regular expression "^[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$"' + '404': + description: Not found. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + examples: + not_found: + value: + errorType: not_found + errorMessage: EVM account with the given address not found. + '500': + $ref: '#/components/responses/InternalServerError' + '502': + $ref: '#/components/responses/BadGatewayError' + '503': + $ref: '#/components/responses/ServiceUnavailableError' + put: + x-audience: public + summary: Update an EVM account + description: Updates an existing EVM account. Use this to update the account's name or account-level policy. + operationId: updateEvmAccount + tags: + - EVM Accounts + security: + - apiKeyAuth: [] + parameters: + - $ref: '#/components/parameters/IdempotencyKey' + - name: address + description: The 0x-prefixed address of the EVM account. The address does not need to be checksummed. + in: path + required: true + schema: + type: string + pattern: ^0x[0-9a-fA-F]{40}$ + example: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e' + requestBody: + content: + application/json: + schema: + type: object + properties: + name: + type: string + description: |- + An optional name for the account. + Account names can consist of alphanumeric characters and hyphens, and be between 2 and 36 characters long. + Account names must be unique across all EVM accounts in the developer's CDP Project. + example: my-wallet + pattern: ^[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$ + accountPolicy: type: string x-audience: public description: The ID of the account-level policy to apply to the account, or an empty string to unset attached policy. @@ -3531,7 +5477,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RevokeSpendPermissionRequest' + $ref: '#/components/schemas/evm-spend-permissions_RevokeSpendPermissionRequest' responses: '200': description: Successfully revoked spend permission. @@ -5270,16 +7216,17 @@ paths: description: | Request funds from the CDP Faucet on Solana devnet. - Faucets are available for SOL. + Faucets are available for SOL, USDC, and CBTUSD. To prevent abuse, we enforce rate limits within a rolling 24-hour window to control the amount of funds that can be requested. These limits are applied at both the CDP Project level and the blockchain address level. A single blockchain address cannot exceed the specified limits, even if multiple users submit requests to the same address. - | Token | Amount per Faucet Request |Rolling 24-hour window Rate Limits| - |:-----:|:-------------------------:|:--------------------------------:| - | SOL | 0.00125 SOL | 0.0125 SOL | - | USDC | 1 USDC | 10 USDC | + | Token | Amount per Faucet Request |Rolling 24-hour window Rate Limits| + |:-----: |:-------------------------:|:--------------------------------:| + | SOL | 0.00125 SOL | 0.0125 SOL | + | USDC | 1 USDC | 10 USDC | + | CBTUSD | 1 CBTUSD | 10 CBTUSD | operationId: requestSolanaFaucet tags: - Faucets @@ -5302,6 +7249,7 @@ paths: enum: - sol - usdc + - cbtusd example: sol required: - address @@ -5476,29 +7424,47 @@ paths: Run a read-only SQL query against indexed blockchain data including transactions, events, and decoded logs. This endpoint provides direct SQL access to comprehensive blockchain data across supported networks. + Queries are executed against optimized data structures for high-performance analytics. ### Allowed Queries - - Standard SQL syntax (ClickHouse dialect) + - Standard SQL syntax (CoinbaSeQL dialect, based on ClickHouse dialect) - Read-only queries (SELECT statements) - No DDL or DML operations - - No cartesian products + - Query that follow limits (defined below) ### Supported Tables - - `base.events` - Base mainnet decoded event logs with parameters, event signature, topics, and more. - - `base.transactions` - Base mainnet transaction data including hash, block number, gas usage. - - `base.blocks` - Base mainnet block information. - - `base.encoded_logs` - Encoded log data of event logs that aren't able to be decoded by our event decoder (ex: log0 opcode). - - `base.transfers` - All event logs with event signature `Transfer(address,address,uint256)`. ERC-20, ERC-721, and ERC-1155 transfers are all included. + - `.events` - Base mainnet decoded event logs with parameters, event signature, topics, and more. + - `.transactions` - Base mainnet transaction data including hash, block number, gas usage. + - `.blocks` - Base mainnet block information. + - `.encoded_logs` - Encoded log data of event logs that aren't able to be decoded by our event decoder (ex: log0 opcode). + - `.decoded_user_operations` - Decoded user operations data including hash, block number, gas usage, builder codes, entrypoint version, and more. + - `.transaction_attributions` - Information about the attributions of a transaction to a builder and associated builder codes. + + ### Supported Networks + + - Base Mainnet: `base` + - Base Sepolia: `base_sepolia` + + So for example, valid tables are: `base.events`, `base_sepolia.events`, `base.transactions`, etc. ### Query Limits - - Maximum result set: 100,000 rows + - Maximum result set: 50,000 rows + - Maximum query length: 10,000 characters + - Maximum on-disk data to read: 100GB + - Maximum memory usage: 15GB - Query timeout: 30 seconds + - Maximum JOINs: 12 + + ### Query Caching + + By default, each query result is returned from cache so long as the result is from an identical query and less than 750ms old. This freshness tolerance can be modified upwards, to a maximum of 900000ms (i.e. 900s, 15m). + This can be helpful for users who wish to reduce expensive calls to the SQL API by reusing cached results. tags: - - SQL API (Alpha) + - SQL API security: - apiKeyAuth: [] requestBody: @@ -5518,6 +7484,8 @@ paths: $ref: '#/components/responses/InvalidSQLQueryError' '401': $ref: '#/components/responses/UnauthorizedError' + '402': + $ref: '#/components/responses/PaymentMethodRequiredError' '408': description: Query timeout. content: @@ -5554,11 +7522,13 @@ paths: description: | Retrieve the SQL grammar for the SQL API. - The SQL queries that are supported by the SQL API are defined via an ANTLR4 grammar which is evaluated by server before executing the query. This ensures the safety and soundness of the SQL API. + The SQL queries that are supported by the SQL API are defined in ANTLR4 grammar which is evaluated by server before executing the query. This ensures the safety and soundness of the SQL query before execution. - This endpoint returns the ANTLR4 grammar that is used to evaluate the SQL queries so that developers can understand the SQL API and build SQL queries with high confidence and correctness. LLMs interact well with ANTLR4 grammar as well. + This endpoint returns the ANTLR4 grammar that is used to evaluate the SQL queries so that developers can understand the SQL API and build SQL queries with high confidence and correctness. + + LLMs interact well with ANTLR4 grammar. You can feed the grammar directly into the LLMs to help generate SQL queries. tags: - - SQL API (Alpha) + - SQL API security: - apiKeyAuth: [] responses: @@ -5749,6 +7719,10 @@ paths: operationId: listWebhookSubscriptions summary: List webhook subscriptions x-audience: public + x-required-permissions: + permissions: + - accounts:read@entity + enforcement: any description: | Retrieve a paginated list of webhook subscriptions for the authenticated project. Returns subscriptions for all CDP product events (onchain, onramp/offramp, wallet, etc.) @@ -5821,6 +7795,10 @@ paths: operationId: createWebhookSubscription summary: Create webhook subscription x-audience: public + x-required-permissions: + permissions: + - accounts:write@entity + enforcement: any description: | Subscribe to real-time events across CDP products using flexible filtering. @@ -5976,6 +7954,10 @@ paths: operationId: getWebhookSubscription summary: Get webhook subscription details x-audience: public + x-required-permissions: + permissions: + - accounts:read@entity + enforcement: any description: | Retrieve detailed information about a specific webhook subscription including configuration, status, creation timestamp, and webhook signature secret. @@ -6035,6 +8017,10 @@ paths: operationId: updateWebhookSubscription summary: Update webhook subscription x-audience: public + x-required-permissions: + permissions: + - accounts:write@entity + enforcement: any description: | Update an existing webhook subscription's configuration including event types, target URL, filtering criteria, and enabled status. @@ -6116,6 +8102,10 @@ paths: operationId: deleteWebhookSubscription summary: Delete webhook subscription x-audience: public + x-required-permissions: + permissions: + - accounts:write@entity + enforcement: any description: | Permanently delete a webhook subscription and stop all event deliveries. This action cannot be undone. @@ -6681,6 +8671,12 @@ components: scheme: bearer bearerFormat: JWT description: A JWT signed using your CDP API Key Secret, encoded in base64. Refer to the [Generate Bearer Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-bearer-token) section of our Authentication docs for information on how to generate your Bearer Token. + endUserAuth: + x-audience: public + type: http + scheme: bearer + bearerFormat: JWT + description: A JWT signed using the developer's own JWT private key (in the case of JWT authentication), or an end user JWT signed by CDP, encoded in base64. This is used for End User Account APIs. schemas: EmailAuthentication: type: object @@ -6751,6 +8747,7 @@ components: - apple - x - telegram + - github example: google OAuth2Authentication: type: object @@ -7107,6 +9104,9 @@ components: - order_already_filled - order_already_canceled - account_not_ready + - insufficient_liquidity + - insufficient_allowance + - transaction_simulation_failed x-error-instructions: already_exists: |- This error occurs when trying to create a resource that already exists. @@ -7688,6 +9688,45 @@ components: **Steps to resolve:** 1. Wait a few moments and retry the request 2. If the error persists, the account may still be completing setup — retry with exponential backoff + insufficient_liquidity: |- + This error occurs when no swap route is available for the requested token pair or amount. + + **Steps to resolve:** + 1. Try a smaller `fromAmount` — large orders may exceed available liquidity + 2. Try a different token pair + 3. Retry after a short delay; liquidity conditions change with market activity + insufficient_allowance: |- + This error occurs when the taker has not approved the Permit2 contract to spend the `fromToken` + on their behalf. ERC-20 swaps require a Permit2 allowance. Native ETH swaps do not. + + **Steps to resolve:** + 1. Submit an ERC-20 `approve` transaction on the `fromToken` contract, granting the Permit2 + contract (`0x000000000022D473030F116dDEE9F6B43aC78BA3`) an allowance of at least `fromAmount` + 2. Wait for the approval transaction to be confirmed on-chain + 3. Retry the swap + + **Example:** + ```typescript lines wrap + // Approve Permit2 to spend fromToken + await walletClient.writeContract({ + address: fromToken, + abi: erc20Abi, + functionName: "approve", + args: ["0x000000000022D473030F116dDEE9F6B43aC78BA3", fromAmount], + }); + ``` + transaction_simulation_failed: |- + This error occurs when the pre-broadcast simulation of the swap transaction predicted a revert. + No transaction was submitted and no gas was spent. + + **Common causes:** + - The on-chain price moved past the `slippageBps` tolerance between the price estimate and execution + - Taker balance changed between the price estimate and execution + + **Steps to resolve:** + 1. Retry immediately — prices change quickly and a new quote may succeed + 2. Increase `slippageBps` if retries continue to fail (e.g. from 100 to 200) + 3. For large swaps, consider splitting into smaller amounts to reduce price impact Url: type: string format: uri @@ -7703,63 +9742,38 @@ components: errorType: $ref: '#/components/schemas/ErrorType' errorMessage: - description: The error message. - type: string - example: Unable to create EVM account - correlationId: - description: A unique identifier for the request that generated the error. This can be used to help debug issues with the API. - type: string - example: 41deb8d59a9dc9a7-IAD - errorLink: - allOf: - - $ref: '#/components/schemas/Url' - description: A link to the corresponding error documentation. - example: https://docs.cdp.coinbase.com/api-reference/v2/errors#invalid-request - required: - - errorType - - errorMessage - example: - errorType: invalid_request - errorMessage: Invalid request. - correlationId: 41deb8d59a9dc9a7-IAD - errorLink: https://docs.cdp.coinbase.com/api-reference/v2/errors#invalid-request - EvmAccount: - type: object - properties: - address: - type: string - pattern: ^0x[0-9a-fA-F]{40}$ - description: The 0x-prefixed, checksum EVM address. - example: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e' - name: - type: string - description: |- - An optional name for the account. - Account names can consist of alphanumeric characters and hyphens, and be between 2 and 36 characters long. - Account names are guaranteed to be unique across all EVM accounts in the developer's CDP Project. - example: my-account - pattern: ^[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$ - policies: - type: array - x-audience: public - description: The list of policy IDs that apply to the account. This will include both the project-level policy and the account-level policy, if one exists. - items: - type: string - pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$ - example: - - 123e4567-e89b-12d3-a456-426614174000 - createdAt: + description: The error message. type: string - description: The UTC ISO 8601 timestamp at which the account was created. - example: '2025-03-25T12:00:00Z' - format: date-time - updatedAt: + example: Unable to create EVM account + correlationId: + description: A unique identifier for the request that generated the error. This can be used to help debug issues with the API. type: string - description: The UTC ISO 8601 timestamp at which the account was last updated. - example: '2025-03-26T12:00:00Z' - format: date-time + example: 41deb8d59a9dc9a7-IAD + errorLink: + allOf: + - $ref: '#/components/schemas/Url' + description: A link to the corresponding error documentation. + example: https://docs.cdp.coinbase.com/api-reference/v2/errors#invalid-request required: - - address + - errorType + - errorMessage + example: + errorType: invalid_request + errorMessage: Invalid request. + correlationId: 41deb8d59a9dc9a7-IAD + errorLink: https://docs.cdp.coinbase.com/api-reference/v2/errors#invalid-request + BlockchainAddress: + type: string + minLength: 1 + maxLength: 128 + description: A blockchain address. Format varies by network (e.g., 0x-prefixed for EVM, base58 for Solana). + example: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e' + Asset: + type: string + minLength: 1 + maxLength: 42 + description: The symbol of the asset (e.g., eth, usd, usdc, usdt). + example: usd EIP712Domain: type: object description: The domain of the EIP-712 typed data. @@ -7892,89 +9906,6 @@ components: - ethereum - ethereum-sepolia example: base - EvmEip7702DelegationOperation: - type: object - description: The status of an EIP-7702 delegation operation. - properties: - delegationOperationId: - type: string - format: uuid - description: The unique identifier for the delegation operation. - example: a1b2c3d4-e5f6-7890-abcd-ef1234567890 - status: - type: string - description: |- - The current status of the delegation operation. - UNSPECIFIED means the status has not been set. PENDING means the operation has been created but not yet submitted. SUBMITTED means the operation has been submitted to the network. COMPLETED means the operation has completed successfully. FAILED means the operation has failed. - enum: - - UNSPECIFIED - - PENDING - - SUBMITTED - - COMPLETED - - FAILED - example: COMPLETED - transactionHash: - type: string - pattern: ^0x[0-9a-fA-F]{64}$ - description: The hash of the delegation transaction, if available. Present once the transaction has been submitted to the network. - example: '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef' - network: - $ref: '#/components/schemas/EvmEip7702DelegationNetwork' - delegateAddress: - type: string - pattern: ^0x[0-9a-fA-F]{40}$ - description: The address the account has delegated to, if any. Only present when the account has an active delegation. - example: '0x7702cb554e6bFb442cb743A7dF23154544a7176C' - required: - - delegationOperationId - - status - - network - EvmSmartAccount: - type: object - properties: - address: - type: string - pattern: ^0x[0-9a-fA-F]{40}$ - description: The 0x-prefixed, checksum address of the Smart Account. - example: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e' - owners: - type: array - items: - type: string - pattern: ^0x[0-9a-fA-F]{40}$ - description: Today, only a single owner can be set for a Smart Account, but this is an array to allow having multiple owners in the future. The address is a 0x-prefixed, checksum address. - example: - - '0xfc807D1bE4997e5C7B33E4d8D57e60c5b0f02B1a' - name: - type: string - description: |- - An optional name for the account. - Account names can consist of alphanumeric characters and hyphens, and be between 2 and 36 characters long. - Account names are guaranteed to be unique across all Smart Accounts in the developer's CDP Project. - example: my-smart-account - pattern: ^[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$ - policies: - type: array - x-audience: public - description: The list of policy IDs that apply to the smart account. This will include both the project-level policy and the account-level policy, if one exists. - items: - type: string - pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$ - example: - - 123e4567-e89b-12d3-a456-426614174000 - createdAt: - type: string - description: The UTC ISO 8601 timestamp at which the account was created. - example: '2025-03-25T12:00:00Z' - format: date-time - updatedAt: - type: string - description: The UTC ISO 8601 timestamp at which the account was last updated. - example: '2025-03-26T12:00:00Z' - format: date-time - required: - - address - - owners EvmUserOperationNetwork: type: string description: The network the user operation is for. @@ -8073,66 +10004,215 @@ components: userOpHash: type: string pattern: ^0x[0-9a-fA-F]{64}$ - description: The hash of the user operation. This is not the transaction hash, as a transaction consists of multiple user operations. The user operation hash is the hash of this particular user operation which gets signed by the owner of the Smart Account. + description: The hash of the user operation. This is not the transaction hash, as a transaction consists of multiple user operations. The user operation hash is the hash of this particular user operation which gets signed by the owner of the Smart Account. + example: '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef' + calls: + type: array + description: The list of calls in the user operation. + items: + $ref: '#/components/schemas/EvmCall' + example: + - to: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' + value: '0' + data: '0xa9059cbb000000000000000000000000fc807d1be4997e5c7b33e4d8d57e60c5b0f02b1a0000000000000000000000000000000000000000000000000000000000000064' + - to: '0xdac17f958d2ee523a2206206994597c13d831ec7' + value: '1000000000000000' + data: 0x + status: + type: string + description: The status of the user operation. + enum: + - pending + - signed + - broadcast + - complete + - dropped + - failed + example: pending + transactionHash: + type: string + pattern: ^0x[0-9a-fA-F]{64}$|^$ + description: The hash of the transaction that included this particular user operation. This gets set after the user operation is broadcasted and the transaction is included in a block. + example: '0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef' + receipts: + type: array + description: The list of receipts associated with the user operation. + items: + $ref: '#/components/schemas/UserOperationReceipt' + example: + - revert: + data: '0x123' + message: reason for failure + blockHash: '0x386544b58930c0ec9e8f3ed09fb4cdb76b9ae0a1a37ddcacebe3925b57978e65' + blockNumber: 29338819 + gasUsed: '100000' + required: + - network + - userOpHash + - calls + - status + SpendPermissionNetwork: + type: string + description: The network the spend permission is on. + enum: + - base + - base-sepolia + - ethereum + - ethereum-sepolia + - optimism + - arbitrum + - avalanche + - polygon + example: base + RevokeSpendPermissionRequest: + type: object + description: Request parameters for revoking a Spend Permission. + properties: + walletSecretId: + description: The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header. + type: string + pattern: ^[a-zA-Z0-9-]{1,100}$ + example: e051beeb-7163-4527-a5b6-35e301529ff2 + network: + $ref: '#/components/schemas/SpendPermissionNetwork' + permissionHash: + type: string + description: The hash of the spend permission to revoke. + example: '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef' + useCdpPaymaster: + type: boolean + description: Whether to use the CDP Paymaster for the user operation. + example: true + paymasterUrl: + allOf: + - $ref: '#/components/schemas/Url' + description: The paymaster URL of the spend permission. + example: https://paymaster.cdp.coinbase.com + required: + - walletSecretId + - network + - permissionHash + - useCdpPaymaster + EvmAccount: + type: object + properties: + address: + type: string + pattern: ^0x[0-9a-fA-F]{40}$ + description: The 0x-prefixed, checksum EVM address. + example: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e' + name: + type: string + description: |- + An optional name for the account. + Account names can consist of alphanumeric characters and hyphens, and be between 2 and 36 characters long. + Account names are guaranteed to be unique across all EVM accounts in the developer's CDP Project. + example: my-account + pattern: ^[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$ + policies: + type: array + x-audience: public + description: The list of policy IDs that apply to the account. This will include both the project-level policy and the account-level policy, if one exists. + items: + type: string + pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$ + example: + - 123e4567-e89b-12d3-a456-426614174000 + createdAt: + type: string + description: The UTC ISO 8601 timestamp at which the account was created. + example: '2025-03-25T12:00:00Z' + format: date-time + updatedAt: + type: string + description: The UTC ISO 8601 timestamp at which the account was last updated. + example: '2025-03-26T12:00:00Z' + format: date-time + required: + - address + EvmEip7702DelegationOperation: + type: object + description: The status of an EIP-7702 delegation operation. + properties: + delegationOperationId: + type: string + format: uuid + description: The unique identifier for the delegation operation. + example: a1b2c3d4-e5f6-7890-abcd-ef1234567890 + status: + type: string + description: |- + The current status of the delegation operation. + UNSPECIFIED means the status has not been set. PENDING means the operation has been created but not yet submitted. SUBMITTED means the operation has been submitted to the network. COMPLETED means the operation has completed successfully. FAILED means the operation has failed. + enum: + - UNSPECIFIED + - PENDING + - SUBMITTED + - COMPLETED + - FAILED + example: COMPLETED + transactionHash: + type: string + pattern: ^0x[0-9a-fA-F]{64}$ + description: The hash of the delegation transaction, if available. Present once the transaction has been submitted to the network. example: '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef' - calls: + network: + $ref: '#/components/schemas/EvmEip7702DelegationNetwork' + delegateAddress: + type: string + pattern: ^0x[0-9a-fA-F]{40}$ + description: The address the account has delegated to, if any. Only present when the account has an active delegation. + example: '0x7702cb554e6bFb442cb743A7dF23154544a7176C' + required: + - delegationOperationId + - status + - network + EvmSmartAccount: + type: object + properties: + address: + type: string + pattern: ^0x[0-9a-fA-F]{40}$ + description: The 0x-prefixed, checksum address of the Smart Account. + example: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e' + owners: type: array - description: The list of calls in the user operation. items: - $ref: '#/components/schemas/EvmCall' + type: string + pattern: ^0x[0-9a-fA-F]{40}$ + description: Today, only a single owner can be set for a Smart Account, but this is an array to allow having multiple owners in the future. The address is a 0x-prefixed, checksum address. example: - - to: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' - value: '0' - data: '0xa9059cbb000000000000000000000000fc807d1be4997e5c7b33e4d8d57e60c5b0f02b1a0000000000000000000000000000000000000000000000000000000000000064' - - to: '0xdac17f958d2ee523a2206206994597c13d831ec7' - value: '1000000000000000' - data: 0x - status: - type: string - description: The status of the user operation. - enum: - - pending - - signed - - broadcast - - complete - - dropped - - failed - example: pending - transactionHash: + - '0xfc807D1bE4997e5C7B33E4d8D57e60c5b0f02B1a' + name: type: string - pattern: ^0x[0-9a-fA-F]{64}$|^$ - description: The hash of the transaction that included this particular user operation. This gets set after the user operation is broadcasted and the transaction is included in a block. - example: '0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef' - receipts: + description: |- + An optional name for the account. + Account names can consist of alphanumeric characters and hyphens, and be between 2 and 36 characters long. + Account names are guaranteed to be unique across all Smart Accounts in the developer's CDP Project. + example: my-smart-account + pattern: ^[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$ + policies: type: array - description: The list of receipts associated with the user operation. + x-audience: public + description: The list of policy IDs that apply to the smart account. This will include both the project-level policy and the account-level policy, if one exists. items: - $ref: '#/components/schemas/UserOperationReceipt' + type: string + pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$ example: - - revert: - data: '0x123' - message: reason for failure - blockHash: '0x386544b58930c0ec9e8f3ed09fb4cdb76b9ae0a1a37ddcacebe3925b57978e65' - blockNumber: 29338819 - gasUsed: '100000' + - 123e4567-e89b-12d3-a456-426614174000 + createdAt: + type: string + description: The UTC ISO 8601 timestamp at which the account was created. + example: '2025-03-25T12:00:00Z' + format: date-time + updatedAt: + type: string + description: The UTC ISO 8601 timestamp at which the account was last updated. + example: '2025-03-26T12:00:00Z' + format: date-time required: - - network - - userOpHash - - calls - - status - SpendPermissionNetwork: - type: string - description: The network the spend permission is on. - enum: - - base - - base-sepolia - - ethereum - - ethereum-sepolia - - optimism - - arbitrum - - avalanche - - polygon - example: base + - address + - owners CreateSpendPermissionRequest: type: object description: Request parameters for creating a Spend Permission. @@ -8280,7 +10360,7 @@ components: - revoked - createdAt - network - RevokeSpendPermissionRequest: + evm-spend-permissions_RevokeSpendPermissionRequest: type: object description: Request parameters for revoking a Spend Permission. properties: @@ -11097,6 +13177,11 @@ components: format: date-time description: When the subscription was created. example: '2025-01-15T10:30:00Z' + updatedAt: + type: string + format: date-time + description: When the subscription was last updated. + example: '2025-01-16T14:00:00Z' description: allOf: - $ref: '#/components/schemas/Description' @@ -11164,6 +13249,7 @@ components: transaction_to: '0xf5042e6ffac5a625d4e7848e0b01373d8eb9e222' description: USDC Transfer events to specific address. createdAt: '2025-11-12T09:19:52.051Z' + updatedAt: '2025-11-13T11:30:00.000Z' metadata: secret: a1b2c3d4-e5f6-7890-abcd-ef1234567890 secret: a1b2c3d4-e5f6-7890-abcd-ef1234567890 @@ -11282,7 +13368,7 @@ components: enum: - 1 - 2 - example: 1 + example: 2 x402ExactEvmPayload: type: object title: x402ExactEvmPayload @@ -11469,62 +13555,6 @@ components: transaction: AQABAgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAQECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8CBgMBAQAAAAIBAwQAAAAABgIAAAAAAAYDBQEBAAAGBAgAAAAABgUAAAAA6AMAAAAAAAAGBgUBAQEBBgcEAQAAAAYICgMBAQIDBgkCBgAAAAYKAwABAQEGCwMGAQEBBgwDAAABAQAAAAA= required: - transaction - x402V1PaymentPayload: - type: object - description: The x402 protocol payment payload that the client attaches to x402-paid API requests to the resource server in the X-PAYMENT header. - properties: - x402Version: - $ref: '#/components/schemas/X402Version' - scheme: - type: string - description: The scheme of the payment protocol to use. Currently, the only supported scheme is `exact`. - enum: - - exact - example: exact - network: - type: string - description: The network of the blockchain to send payment on. - enum: - - base-sepolia - - base - - solana-devnet - - solana - - polygon - example: base - payload: - type: object - description: The payload of the payment depending on the x402Version, scheme, and network. - oneOf: - - $ref: '#/components/schemas/x402ExactEvmPayload' - - $ref: '#/components/schemas/x402ExactEvmPermit2Payload' - - $ref: '#/components/schemas/x402ExactSolanaPayload' - example: - signature: '0xf3746613c2d920b5fdabc0856f2aeb2d4f88ee6037b8cc5d04a71a4462f134801234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1b' - authorization: - from: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e' - to: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e' - value: '1000000000000000000' - validAfter: '1716150000' - validBefore: '1716150000' - nonce: '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef' - example: - x402Version: 1 - scheme: exact - network: base - payload: - signature: '0xf3746613c2d920b5fdabc0856f2aeb2d4f88ee6037b8cc5d04a71a4462f134801234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1b' - authorization: - from: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e' - to: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e' - value: '1000000000000000000' - validAfter: '1716150000' - validBefore: '1716150000' - nonce: '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef' - required: - - x402Version - - scheme - - network - - payload x402V2PaymentRequirements: type: object description: The x402 protocol payment requirements that the resource server expects the client's payment payload to meet. @@ -11660,14 +13690,70 @@ components: - x402Version - accepted - payload + x402V1PaymentPayload: + type: object + description: The x402 protocol payment payload that the client attaches to x402-paid API requests to the resource server in the X-PAYMENT header. + properties: + x402Version: + $ref: '#/components/schemas/X402Version' + scheme: + type: string + description: The scheme of the payment protocol to use. Currently, the only supported scheme is `exact`. + enum: + - exact + example: exact + network: + type: string + description: The network of the blockchain to send payment on. + enum: + - base-sepolia + - base + - solana-devnet + - solana + - polygon + example: base + payload: + type: object + description: The payload of the payment depending on the x402Version, scheme, and network. + oneOf: + - $ref: '#/components/schemas/x402ExactEvmPayload' + - $ref: '#/components/schemas/x402ExactEvmPermit2Payload' + - $ref: '#/components/schemas/x402ExactSolanaPayload' + example: + signature: '0xf3746613c2d920b5fdabc0856f2aeb2d4f88ee6037b8cc5d04a71a4462f134801234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1b' + authorization: + from: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e' + to: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e' + value: '1000000000000000000' + validAfter: '1716150000' + validBefore: '1716150000' + nonce: '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef' + example: + x402Version: 1 + scheme: exact + network: base + payload: + signature: '0xf3746613c2d920b5fdabc0856f2aeb2d4f88ee6037b8cc5d04a71a4462f134801234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1b' + authorization: + from: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e' + to: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e' + value: '1000000000000000000' + validAfter: '1716150000' + validBefore: '1716150000' + nonce: '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef' + required: + - x402Version + - scheme + - network + - payload x402PaymentPayload: type: object description: |- The x402 protocol payment payload that the client attaches to x402-paid API requests to the resource server in the X-PAYMENT header. For EVM networks, smart account signatures can be longer than 65 bytes. oneOf: - - $ref: '#/components/schemas/x402V1PaymentPayload' - $ref: '#/components/schemas/x402V2PaymentPayload' + - $ref: '#/components/schemas/x402V1PaymentPayload' x402V1PaymentRequirements: type: object description: The x402 protocol payment requirements that the resource server expects the client's payment payload to meet. @@ -11755,8 +13841,8 @@ components: type: object description: The x402 protocol payment requirements that the resource server expects the client's payment payload to meet. oneOf: - - $ref: '#/components/schemas/x402V1PaymentRequirements' - $ref: '#/components/schemas/x402V2PaymentRequirements' + - $ref: '#/components/schemas/x402V1PaymentRequirements' x402VerifyInvalidReason: type: string description: The reason the payment is invalid on the x402 protocol. @@ -11970,12 +14056,6 @@ components: - x402Version - scheme - network - BlockchainAddress: - type: string - minLength: 1 - maxLength: 128 - description: A blockchain address. Format varies by network (e.g., 0x-prefixed for EVM, base58 for Solana). - example: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e' OnrampOrderPaymentMethodTypeId: type: string description: The type of payment method to be used to complete an onramp order. @@ -12578,6 +14658,28 @@ components: maxLength: 128 minLength: 1 example: 8e03978e-40d5-43e8-bc93-6894a57f9324 + XDeveloperAuth: + name: X-Developer-Auth + in: header + required: false + description: | + A JWT signed using your Wallet Secret, encoded in base64. Refer to the + [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) + section of our Authentication docs for more details on how to generate your Wallet Token. + schema: + type: string + example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjEyMywicm9sZSI6ImFkbWluIiwiZXhwIjoxNzAxOTgwMDAwfQ.HWvMTKmCCTxHaxjvZyLaC6UQ6TV3ErTDWBf7zmdH0Lw + XWalletAuthOptional: + name: X-Wallet-Auth + in: header + required: false + description: | + A JWT signed using your Wallet Secret, encoded in base64. Refer to the + [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) + section of our Authentication docs for more details on how to generate your Wallet Token. + schema: + type: string + example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjEyMywicm9sZSI6ImFkbWluIiwiZXhwIjoxNzAxOTgwMDAwfQ.HWvMTKmCCTxHaxjvZyLaC6UQ6TV3ErTDWBf7zmdH0Lw PageSize: name: pageSize description: The number of resources to return per page. @@ -12595,3 +14697,62 @@ components: schema: type: string example: eyJsYXN0X2lkIjogImFiYzEyMyIsICJ0aW1lc3RhbXAiOiAxNzA3ODIzNzAxfQ== +x-tagGroups: + - name: Wallets + tags: + - End User Accounts + - EVM Accounts + - EVM Smart Accounts + - Policy Engine + - Solana Accounts + - Wallet Secrets (Internal) + - name: Onchain Data + tags: + - EVM Token Balances + - Onchain Data + - Solana Token Balances + - SQL API + - name: EVM Swaps + tags: + - EVM Swaps + - name: Faucets + tags: + - Faucets + - name: Onramp + tags: + - Onramp + - name: Webhooks + tags: + - Webhooks + - name: x402 Facilitator + tags: + - x402 Facilitator + - name: CDP Portal (Non-Public) + tags: + - Entities (Under Development) + - Permissions (Under Development) + - Projects (Under Development) + - Reporting (Under Development) + - Roles (Under Development) + - Team Members (Under Development) + - name: Embedded Wallets (Non-Public) + tags: + - Embedded Wallets (CORS) + - Embedded Wallets (Custom Auth) + - Embedded Wallets (Custom OAuth) + - Embedded Wallets (MFA) + - Embedded Wallets (Mobile Attestation) + - Embedded Wallets (Project Configuration) + - Embedded Wallets (Core Functionality) + - name: Payments (Private Beta) + tags: + - Accounts (Under Development) + - Deposit Destinations (Under Development) + - Payment Methods (Under Development) + - Transfers (Under Development) + - name: Other APIs + tags: + - Customers (Under Development) + - Orders (Under Development) + - Payment Acceptance (Under Development) + - Risk diff --git a/python/cdp/__init__.py b/python/cdp/__init__.py index 8105d8060..5b82d7167 100644 --- a/python/cdp/__init__.py +++ b/python/cdp/__init__.py @@ -1,6 +1,6 @@ from cdp.__version__ import __version__ from cdp.cdp_client import CdpClient -from cdp.end_user_account import EndUserAccount +from cdp.end_user_account import EndUserAccount, SendEvmAssetResult from cdp.end_user_client import ListEndUsersResult from cdp.evm_call_types import ContractCall, EncodedCall, FunctionCall from cdp.evm_local_account import EvmLocalAccount @@ -9,6 +9,7 @@ from cdp.evm_transaction_types import TransactionRequestEIP1559 from cdp.openapi_client import SpendPermissionNetwork from cdp.openapi_client.errors import HttpErrorType, NetworkError +from cdp.openapi_client.models.evm_user_operation import EvmUserOperation from cdp.spend_permissions import ( SPEND_PERMISSION_MANAGER_ABI, SPEND_PERMISSION_MANAGER_ADDRESS, @@ -27,10 +28,12 @@ "EvmLocalAccount", "EvmServerAccount", "EvmSmartAccount", + "EvmUserOperation", "FunctionCall", "HttpErrorType", "ListEndUsersResult", "NetworkError", + "SendEvmAssetResult", "SpendPermissionNetwork", "SpendPermission", "SpendPermissionInput", diff --git a/python/cdp/actions/solana/sign_message.py b/python/cdp/actions/solana/sign_message.py index 975ce1452..f07f2a681 100644 --- a/python/cdp/actions/solana/sign_message.py +++ b/python/cdp/actions/solana/sign_message.py @@ -1,8 +1,8 @@ from cdp.openapi_client.api.solana_accounts_api import SolanaAccountsApi -from cdp.openapi_client.models.sign_solana_message200_response import ( - SignSolanaMessage200Response as SignSolanaMessageResponse, -) from cdp.openapi_client.models.sign_solana_message_request import SignSolanaMessageRequest +from cdp.openapi_client.models.sign_solana_message_with_end_user_account200_response import ( + SignSolanaMessageWithEndUserAccount200Response as SignSolanaMessageResponse, +) async def sign_message( diff --git a/python/cdp/actions/solana/sign_transaction.py b/python/cdp/actions/solana/sign_transaction.py index 2296a963e..480e8e4e0 100644 --- a/python/cdp/actions/solana/sign_transaction.py +++ b/python/cdp/actions/solana/sign_transaction.py @@ -1,10 +1,10 @@ from cdp.openapi_client.api.solana_accounts_api import SolanaAccountsApi -from cdp.openapi_client.models.sign_solana_transaction200_response import ( - SignSolanaTransaction200Response as SignSolanaTransactionResponse, -) from cdp.openapi_client.models.sign_solana_transaction_request import ( SignSolanaTransactionRequest, ) +from cdp.openapi_client.models.sign_solana_transaction_with_end_user_account200_response import ( + SignSolanaTransactionWithEndUserAccount200Response as SignSolanaTransactionResponse, +) async def sign_transaction( diff --git a/python/cdp/api_clients.py b/python/cdp/api_clients.py index d88684ad0..6061270b9 100644 --- a/python/cdp/api_clients.py +++ b/python/cdp/api_clients.py @@ -1,3 +1,6 @@ +from cdp.openapi_client.api.embedded_wallets_core_functionality_api import ( + EmbeddedWalletsCoreFunctionalityApi, +) from cdp.openapi_client.api.end_user_accounts_api import EndUserAccountsApi from cdp.openapi_client.api.evm_accounts_api import EVMAccountsApi from cdp.openapi_client.api.evm_smart_accounts_api import EVMSmartAccountsApi @@ -39,6 +42,7 @@ def __init__(self, cdp_client: CdpApiClient) -> None: """ self._cdp_client: CdpApiClient = cdp_client + self._embedded_wallets: EmbeddedWalletsCoreFunctionalityApi | None = None self._evm_accounts: EVMAccountsApi | None = None self._evm_smart_accounts: EVMSmartAccountsApi | None = None self._evm_swaps: EVMSwapsApi | None = None @@ -59,6 +63,21 @@ def _check_closed(self) -> None: "This error occurs when trying to use a client after calling close()." ) + @property + def embedded_wallets(self) -> EmbeddedWalletsCoreFunctionalityApi: + """Get the EmbeddedWalletsCoreFunctionalityApi client instance. + + Returns: + EmbeddedWalletsCoreFunctionalityApi: The EmbeddedWalletsCoreFunctionalityApi client instance. + + """ + self._check_closed() + if self._embedded_wallets is None: + self._embedded_wallets = EmbeddedWalletsCoreFunctionalityApi( + api_client=self._cdp_client + ) + return self._embedded_wallets + @property def solana_token_balances(self) -> SolanaTokenBalancesApi: """Get the SolanaTokenBalancesApi client instance. diff --git a/python/cdp/cdp_client.py b/python/cdp/cdp_client.py index 92172de39..aa6b4cb27 100644 --- a/python/cdp/cdp_client.py +++ b/python/cdp/cdp_client.py @@ -24,6 +24,7 @@ def __init__( max_network_retries: int = 3, source: str = SDK_DEFAULT_SOURCE, source_version: str = __version__, + project_id: str | None = None, ): """Instantiate the CdpClient. @@ -36,11 +37,14 @@ def __init__( max_network_retries (int, optional): The maximum number of network retries. Defaults to 3. source (str, optional): The source. Defaults to SDK_DEFAULT_SOURCE. source_version (str, optional): The source version. Defaults to __version__. + project_id (str, optional): The CDP Project ID. Required for end user delegation operations. + Defaults to the CDP_PROJECT_ID environment variable. """ api_key_id = api_key_id or os.getenv("CDP_API_KEY_ID") or os.getenv("CDP_API_KEY_NAME") api_key_secret = api_key_secret or os.getenv("CDP_API_KEY_SECRET") wallet_secret = wallet_secret or os.getenv("CDP_WALLET_SECRET") + project_id = project_id or os.getenv("CDP_PROJECT_ID") if not api_key_id or not api_key_secret: raise ValueError(""" @@ -92,7 +96,7 @@ def __init__( self._evm = EvmClient(self.api_clients) self._solana = SolanaClient(self.api_clients) self._policies = PoliciesClient(self.api_clients) - self._end_user = EndUserClient(self.api_clients) + self._end_user = EndUserClient(self.api_clients, project_id=project_id) self._closed = False if ( diff --git a/python/cdp/end_user_account.py b/python/cdp/end_user_account.py index 05e68dba5..b8cefd728 100644 --- a/python/cdp/end_user_account.py +++ b/python/cdp/end_user_account.py @@ -1,9 +1,11 @@ +from dataclasses import dataclass from datetime import datetime from pydantic import BaseModel, ConfigDict from cdp.analytics import track_action from cdp.api_clients import ApiClients +from cdp.errors import UserInputValidationError from cdp.openapi_client.models.add_end_user_evm_account201_response import ( AddEndUserEvmAccount201Response, ) @@ -17,18 +19,80 @@ AddEndUserSolanaAccount201Response, ) from cdp.openapi_client.models.authentication_method import AuthenticationMethod +from cdp.openapi_client.models.create_evm_eip7702_delegation_with_end_user_account_request import ( + CreateEvmEip7702DelegationWithEndUserAccountRequest, +) +from cdp.openapi_client.models.eip712_message import EIP712Message from cdp.openapi_client.models.end_user import EndUser as EndUserModel from cdp.openapi_client.models.end_user_evm_account import EndUserEvmAccount from cdp.openapi_client.models.end_user_evm_smart_account import EndUserEvmSmartAccount from cdp.openapi_client.models.end_user_solana_account import EndUserSolanaAccount +from cdp.openapi_client.models.evm_call import EvmCall +from cdp.openapi_client.models.evm_eip7702_delegation_network import EvmEip7702DelegationNetwork +from cdp.openapi_client.models.evm_user_operation import EvmUserOperation +from cdp.openapi_client.models.evm_user_operation_network import EvmUserOperationNetwork from cdp.openapi_client.models.mfa_methods import MFAMethods +from cdp.openapi_client.models.revoke_delegation_for_end_user_request import ( + RevokeDelegationForEndUserRequest, +) +from cdp.openapi_client.models.send_evm_asset_with_end_user_account_request import ( + SendEvmAssetWithEndUserAccountRequest, +) +from cdp.openapi_client.models.send_evm_transaction_with_end_user_account_request import ( + SendEvmTransactionWithEndUserAccountRequest, +) +from cdp.openapi_client.models.send_solana_asset_with_end_user_account_request import ( + SendSolanaAssetWithEndUserAccountRequest, +) +from cdp.openapi_client.models.send_solana_transaction_with_end_user_account_request import ( + SendSolanaTransactionWithEndUserAccountRequest, +) +from cdp.openapi_client.models.send_user_operation_with_end_user_account_request import ( + SendUserOperationWithEndUserAccountRequest, +) +from cdp.openapi_client.models.sign_evm_hash_with_end_user_account_request import ( + SignEvmHashWithEndUserAccountRequest, +) +from cdp.openapi_client.models.sign_evm_message_with_end_user_account_request import ( + SignEvmMessageWithEndUserAccountRequest, +) +from cdp.openapi_client.models.sign_evm_transaction_with_end_user_account_request import ( + SignEvmTransactionWithEndUserAccountRequest, +) +from cdp.openapi_client.models.sign_evm_typed_data_with_end_user_account_request import ( + SignEvmTypedDataWithEndUserAccountRequest, +) +from cdp.openapi_client.models.sign_solana_hash_with_end_user_account_request import ( + SignSolanaHashWithEndUserAccountRequest, +) +from cdp.openapi_client.models.sign_solana_message_with_end_user_account_request import ( + SignSolanaMessageWithEndUserAccountRequest, +) +from cdp.openapi_client.models.sign_solana_transaction_with_end_user_account_request import ( + SignSolanaTransactionWithEndUserAccountRequest, +) + + +@dataclass +class SendEvmAssetResult: + """Result of sending an EVM asset from an end user account. + + Attributes: + transaction_hash: The transaction hash for EOA accounts. None for Smart Accounts. + user_op_hash: The user operation hash for Smart Accounts. None for EOA accounts. + + """ + + transaction_hash: str | None + user_op_hash: str | None class EndUserAccount(BaseModel): """A class representing an end user with action methods. This wraps the OpenAPI EndUser model and adds convenience methods for - adding accounts directly on the object. + adding accounts and performing signing and sending operations directly + on the object. """ model_config = ConfigDict(arbitrary_types_allowed=True) @@ -37,12 +101,14 @@ def __init__( self, end_user_model: EndUserModel, api_clients: ApiClients, + project_id: str | None = None, ) -> None: """Initialize the EndUserAccount class. Args: end_user_model (EndUserModel): The end user model from the API. api_clients (ApiClients): The API clients. + project_id (str | None): The CDP Project ID. Required for delegation operations. """ super().__init__() @@ -58,6 +124,7 @@ def __init__( self.__solana_account_objects = end_user_model.solana_account_objects self.__created_at = end_user_model.created_at self.__api_clients = api_clients + self.__project_id = project_id def __str__(self) -> str: """Get the string representation of the end user account. @@ -77,6 +144,87 @@ def __repr__(self) -> str: """ return f"EndUserAccount(user_id={self.__user_id})" + def _require_project_id(self) -> str: + """Return the project ID or raise an error if it is not set. + + Returns: + str: The project ID. + + Raises: + UserInputValidationError: If the project ID is not configured. + + """ + if not self.__project_id: + raise UserInputValidationError( + "project_id is required for delegation operations. " + "Set it via the CDP_PROJECT_ID environment variable or pass it as " + "project_id to CdpClient." + ) + return self.__project_id + + def _resolve_evm_address(self, address: str | None) -> str: + """Resolve an EVM address, defaulting to the first account if not provided. + + Args: + address: An explicit address, or None to use the first account. + + Returns: + str: The resolved address. + + Raises: + UserInputValidationError: If no EVM accounts exist on this end user. + + """ + if address is not None: + return address + if not self.__evm_accounts: + raise UserInputValidationError( + "This end user has no EVM accounts. Add one with add_evm_account() first." + ) + return self.__evm_accounts[0] + + def _resolve_evm_smart_account_address(self, address: str | None) -> str: + """Resolve an EVM Smart Account address, defaulting to the first if not provided. + + Args: + address: An explicit address, or None to use the first smart account. + + Returns: + str: The resolved address. + + Raises: + UserInputValidationError: If no EVM smart accounts exist on this end user. + + """ + if address is not None: + return address + if not self.__evm_smart_accounts: + raise UserInputValidationError( + "This end user has no EVM smart accounts. Add one with add_evm_smart_account() first." + ) + return self.__evm_smart_accounts[0] + + def _resolve_solana_address(self, address: str | None) -> str: + """Resolve a Solana address, defaulting to the first account if not provided. + + Args: + address: An explicit address, or None to use the first account. + + Returns: + str: The resolved address. + + Raises: + UserInputValidationError: If no Solana accounts exist on this end user. + + """ + if address is not None: + return address + if not self.__solana_accounts: + raise UserInputValidationError( + "This end user has no Solana accounts. Add one with add_solana_account() first." + ) + return self.__solana_accounts[0] + @property def user_id(self) -> str: """Get the user ID of the end user. @@ -258,3 +406,631 @@ async def add_solana_account(self) -> AddEndUserSolanaAccount201Response: user_id=self.__user_id, body={}, ) + + # ------------------------------------------------------------------------- + # Delegation convenience methods + # ------------------------------------------------------------------------- + + async def revoke_delegation( + self, + wallet_secret_id: str | None = None, + ) -> None: + """Revoke all active delegations for this end user. + + Args: + wallet_secret_id: The ID of the Temporary Wallet Secret used to sign the + X-Wallet-Auth header. Required when not using delegated signing. + + Example: + >>> await end_user.revoke_delegation() + + """ + track_action(action="end_user_revoke_delegation") + + project_id = self._require_project_id() + + await self.__api_clients.embedded_wallets.revoke_delegation_for_end_user( + project_id=project_id, + user_id=self.__user_id, + revoke_delegation_for_end_user_request=RevokeDelegationForEndUserRequest( + wallet_secret_id=wallet_secret_id, + ), + ) + + async def create_evm_eip7702_delegation( + self, + network: EvmEip7702DelegationNetwork, + address: str | None = None, + enable_spend_permissions: bool = False, + wallet_secret_id: str | None = None, + ) -> str: + """Create an EIP-7702 delegation for this end user's EVM EOA account. + + Upgrades an EVM EOA with smart account capabilities. If `address` is not provided, + the first EVM account on this end user is used. + + Args: + network: The network on which to create the delegation. + address: The 0x-prefixed EVM account address. Defaults to the first EVM account. + enable_spend_permissions: Whether to configure spend permissions. Defaults to False. + wallet_secret_id: The ID of the Temporary Wallet Secret. Required when not + using delegated signing. + + Returns: + str: The delegation operation ID. Use this to poll the operation status. + + Example: + >>> op_id = await end_user.create_evm_eip7702_delegation( + ... network=EvmEip7702DelegationNetwork.BASE_SEPOLIA + ... ) + + """ + track_action(action="end_user_create_evm_eip7702_delegation") + + project_id = self._require_project_id() + resolved_address = self._resolve_evm_address(address) + + result = await self.__api_clients.embedded_wallets.create_evm_eip7702_delegation_with_end_user_account( + project_id=project_id, + user_id=self.__user_id, + create_evm_eip7702_delegation_with_end_user_account_request=CreateEvmEip7702DelegationWithEndUserAccountRequest( + address=resolved_address, + network=network, + enable_spend_permissions=enable_spend_permissions, + wallet_secret_id=wallet_secret_id, + ), + ) + + return result.delegation_operation_id + + async def sign_evm_hash( + self, + hash: str, + address: str | None = None, + wallet_secret_id: str | None = None, + ) -> str: + """Sign an arbitrary 32-byte hash with this end user's EVM account. + + If `address` is not provided, the first EVM account on this end user is used. + + Args: + hash: The arbitrary 32-byte hash to sign. + address: The 0x-prefixed EVM account address. Defaults to the first EVM account. + wallet_secret_id: The ID of the Temporary Wallet Secret. Required when not + using delegated signing. + + Returns: + str: The signature as a 0x-prefixed hex string. + + Example: + >>> sig = await end_user.sign_evm_hash(hash="0xdeadbeef...") + + """ + track_action(action="end_user_sign_evm_hash") + + project_id = self._require_project_id() + resolved_address = self._resolve_evm_address(address) + + result = await self.__api_clients.embedded_wallets.sign_evm_hash_with_end_user_account( + project_id=project_id, + user_id=self.__user_id, + sign_evm_hash_with_end_user_account_request=SignEvmHashWithEndUserAccountRequest( + hash=hash, + address=resolved_address, + wallet_secret_id=wallet_secret_id, + ), + ) + + return result.signature + + async def sign_evm_message( + self, + message: str, + address: str | None = None, + wallet_secret_id: str | None = None, + ) -> str: + """Sign a message with this end user's EVM account (EIP-191). + + If `address` is not provided, the first EVM account on this end user is used. + + Args: + message: The message to sign. + address: The 0x-prefixed EVM account address. Defaults to the first EVM account. + wallet_secret_id: The ID of the Temporary Wallet Secret. Required when not + using delegated signing. + + Returns: + str: The signature as a 0x-prefixed hex string. + + Example: + >>> sig = await end_user.sign_evm_message(message="Hello, world!") + + """ + track_action(action="end_user_sign_evm_message") + + project_id = self._require_project_id() + resolved_address = self._resolve_evm_address(address) + + result = await self.__api_clients.embedded_wallets.sign_evm_message_with_end_user_account( + project_id=project_id, + user_id=self.__user_id, + sign_evm_message_with_end_user_account_request=SignEvmMessageWithEndUserAccountRequest( + address=resolved_address, + message=message, + wallet_secret_id=wallet_secret_id, + ), + ) + + return result.signature + + async def sign_evm_transaction( + self, + transaction: str, + address: str | None = None, + wallet_secret_id: str | None = None, + ) -> str: + """Sign an RLP-encoded EVM transaction with this end user's EVM account. + + If `address` is not provided, the first EVM account on this end user is used. + + Args: + transaction: The RLP-encoded transaction to sign, as a 0x-prefixed hex string. + address: The 0x-prefixed EVM account address. Defaults to the first EVM account. + wallet_secret_id: The ID of the Temporary Wallet Secret. Required when not + using delegated signing. + + Returns: + str: The RLP-encoded signed transaction as a 0x-prefixed hex string. + + Example: + >>> signed = await end_user.sign_evm_transaction(transaction="0x02...") + + """ + track_action(action="end_user_sign_evm_transaction") + + project_id = self._require_project_id() + resolved_address = self._resolve_evm_address(address) + + result = await self.__api_clients.embedded_wallets.sign_evm_transaction_with_end_user_account( + project_id=project_id, + user_id=self.__user_id, + sign_evm_transaction_with_end_user_account_request=SignEvmTransactionWithEndUserAccountRequest( + address=resolved_address, + transaction=transaction, + wallet_secret_id=wallet_secret_id, + ), + ) + + return result.signed_transaction + + async def sign_evm_typed_data( + self, + typed_data: EIP712Message, + address: str | None = None, + wallet_secret_id: str | None = None, + ) -> str: + """Sign EIP-712 typed data with this end user's EVM account. + + If `address` is not provided, the first EVM account on this end user is used. + + Args: + typed_data: The EIP-712 typed data to sign. + address: The 0x-prefixed EVM account address. Defaults to the first EVM account. + wallet_secret_id: The ID of the Temporary Wallet Secret. Required when not + using delegated signing. + + Returns: + str: The signature as a 0x-prefixed hex string. + + Example: + >>> sig = await end_user.sign_evm_typed_data(typed_data=my_eip712_message) + + """ + track_action(action="end_user_sign_evm_typed_data") + + project_id = self._require_project_id() + resolved_address = self._resolve_evm_address(address) + + result = await self.__api_clients.embedded_wallets.sign_evm_typed_data_with_end_user_account( + project_id=project_id, + user_id=self.__user_id, + sign_evm_typed_data_with_end_user_account_request=SignEvmTypedDataWithEndUserAccountRequest( + address=resolved_address, + typed_data=typed_data, + wallet_secret_id=wallet_secret_id, + ), + ) + + return result.signature + + async def send_evm_transaction( + self, + network: str, + transaction: str, + address: str | None = None, + wallet_secret_id: str | None = None, + ) -> str: + """Sign and send an RLP-encoded EVM transaction for this end user. + + If `address` is not provided, the first EVM account on this end user is used. + + Args: + network: The network to send the transaction to (e.g. "base", "base-sepolia"). + transaction: The RLP-encoded transaction to sign and send, as a 0x-prefixed hex string. + address: The 0x-prefixed EVM account address. Defaults to the first EVM account. + wallet_secret_id: The ID of the Temporary Wallet Secret. Required when not + using delegated signing. + + Returns: + str: The transaction hash as a 0x-prefixed hex string. + + Example: + >>> tx_hash = await end_user.send_evm_transaction( + ... network="base-sepolia", + ... transaction="0x02..." + ... ) + + """ + track_action(action="end_user_send_evm_transaction") + + project_id = self._require_project_id() + resolved_address = self._resolve_evm_address(address) + + result = await self.__api_clients.embedded_wallets.send_evm_transaction_with_end_user_account( + project_id=project_id, + user_id=self.__user_id, + send_evm_transaction_with_end_user_account_request=SendEvmTransactionWithEndUserAccountRequest( + address=resolved_address, + network=network, + transaction=transaction, + wallet_secret_id=wallet_secret_id, + ), + ) + + return result.transaction_hash + + async def send_evm_asset( + self, + network: str, + to: str, + amount: str, + address: str | None = None, + use_cdp_paymaster: bool | None = None, + paymaster_url: str | None = None, + wallet_secret_id: str | None = None, + ) -> SendEvmAssetResult: + """Send USDC from this end user's EVM account (EOA or Smart Account). + + If `address` is not provided, the first EVM account on this end user is used. + + Args: + network: The EVM network to send USDC on (e.g. "base", "base-sepolia"). + to: The 0x-prefixed address of the recipient. + amount: The amount of USDC to send as a decimal string (e.g. "1.5" or "25.50"). + address: The 0x-prefixed EVM account address. Defaults to the first EVM account. + use_cdp_paymaster: Whether to use CDP Paymaster to sponsor gas fees. Only + applicable for EVM Smart Accounts. + paymaster_url: Custom Paymaster URL. Cannot be used together with use_cdp_paymaster. + wallet_secret_id: The ID of the Temporary Wallet Secret. Required when not + using delegated signing. + + Returns: + SendEvmAssetResult: Contains transaction_hash (for EOA) or user_op_hash (for Smart Accounts). + + Example: + >>> result = await end_user.send_evm_asset( + ... network="base-sepolia", + ... to="0xRecipient...", + ... amount="1.5" + ... ) + >>> print(result.transaction_hash) + + """ + # Import here to avoid circular import + from cdp.end_user_client import SendEvmAssetResult + + track_action(action="end_user_send_evm_asset") + + project_id = self._require_project_id() + resolved_address = self._resolve_evm_address(address) + + result = await self.__api_clients.embedded_wallets.send_evm_asset_with_end_user_account( + project_id=project_id, + user_id=self.__user_id, + address=resolved_address, + asset="usdc", + send_evm_asset_with_end_user_account_request=SendEvmAssetWithEndUserAccountRequest( + to=to, + amount=amount, + network=network, + use_cdp_paymaster=use_cdp_paymaster, + paymaster_url=paymaster_url, + wallet_secret_id=wallet_secret_id, + ), + ) + + return SendEvmAssetResult( + transaction_hash=result.transaction_hash, + user_op_hash=result.user_op_hash, + ) + + async def send_user_operation( + self, + network: EvmUserOperationNetwork, + calls: list[EvmCall], + use_cdp_paymaster: bool, + address: str | None = None, + paymaster_url: str | None = None, + data_suffix: str | None = None, + wallet_secret_id: str | None = None, + ) -> EvmUserOperation: + """Prepare, sign, and send a user operation from this end user's EVM Smart Account. + + If `address` is not provided, the first EVM smart account on this end user is used. + + Args: + network: The network on which to send the user operation. + calls: The list of calls to make from the Smart Account. + use_cdp_paymaster: Whether to use the CDP Paymaster for gas sponsorship. + address: The EVM Smart Account address. Defaults to the first smart account. + paymaster_url: Custom Paymaster URL. Cannot be used together with use_cdp_paymaster. + data_suffix: The EIP-8021 data suffix (hex-encoded) for transaction attribution. + wallet_secret_id: The ID of the Temporary Wallet Secret. Required when not + using delegated signing. + + Returns: + EvmUserOperation: The submitted user operation. + + Example: + >>> user_op = await end_user.send_user_operation( + ... network=EvmUserOperationNetwork.BASE_SEPOLIA, + ... calls=[EvmCall(to="0x...", value=0, data="0x")], + ... use_cdp_paymaster=True, + ... ) + + """ + track_action(action="end_user_send_user_operation") + + project_id = self._require_project_id() + resolved_address = self._resolve_evm_smart_account_address(address) + + return await self.__api_clients.embedded_wallets.send_user_operation_with_end_user_account( + project_id=project_id, + user_id=self.__user_id, + address=resolved_address, + send_user_operation_with_end_user_account_request=SendUserOperationWithEndUserAccountRequest( + network=network, + calls=calls, + use_cdp_paymaster=use_cdp_paymaster, + paymaster_url=paymaster_url, + data_suffix=data_suffix, + wallet_secret_id=wallet_secret_id, + ), + ) + + async def sign_solana_hash( + self, + hash: str, + address: str | None = None, + wallet_secret_id: str | None = None, + ) -> str: + """Sign an arbitrary 32-byte hash with this end user's Solana account. + + If `address` is not provided, the first Solana account on this end user is used. + + Args: + hash: The arbitrary 32-byte hash to sign, as a base58-encoded string. + address: The base58-encoded Solana account address. Defaults to the first Solana account. + wallet_secret_id: The ID of the Temporary Wallet Secret. Required when not + using delegated signing. + + Returns: + str: The signature as a base58-encoded string. + + Example: + >>> sig = await end_user.sign_solana_hash(hash="...") + + """ + track_action(action="end_user_sign_solana_hash") + + project_id = self._require_project_id() + resolved_address = self._resolve_solana_address(address) + + result = await self.__api_clients.embedded_wallets.sign_solana_hash_with_end_user_account( + project_id=project_id, + user_id=self.__user_id, + sign_solana_hash_with_end_user_account_request=SignSolanaHashWithEndUserAccountRequest( + hash=hash, + address=resolved_address, + wallet_secret_id=wallet_secret_id, + ), + ) + + return result.signature + + async def sign_solana_message( + self, + message: str, + address: str | None = None, + wallet_secret_id: str | None = None, + ) -> str: + """Sign a message with this end user's Solana account. + + If `address` is not provided, the first Solana account on this end user is used. + + Args: + message: The base64-encoded message to sign. + address: The base58-encoded Solana account address. Defaults to the first Solana account. + wallet_secret_id: The ID of the Temporary Wallet Secret. Required when not + using delegated signing. + + Returns: + str: The signature as a base58-encoded string. + + Example: + >>> sig = await end_user.sign_solana_message(message="base64encodedmessage==") + + """ + track_action(action="end_user_sign_solana_message") + + project_id = self._require_project_id() + resolved_address = self._resolve_solana_address(address) + + result = await self.__api_clients.embedded_wallets.sign_solana_message_with_end_user_account( + project_id=project_id, + user_id=self.__user_id, + sign_solana_message_with_end_user_account_request=SignSolanaMessageWithEndUserAccountRequest( + address=resolved_address, + message=message, + wallet_secret_id=wallet_secret_id, + ), + ) + + return result.signature + + async def sign_solana_transaction( + self, + transaction: str, + address: str | None = None, + wallet_secret_id: str | None = None, + ) -> str: + """Sign a Solana transaction with this end user's Solana account. + + If `address` is not provided, the first Solana account on this end user is used. + + Args: + transaction: The base64-encoded transaction to sign. + address: The base58-encoded Solana account address. Defaults to the first Solana account. + wallet_secret_id: The ID of the Temporary Wallet Secret. Required when not + using delegated signing. + + Returns: + str: The base64-encoded signed transaction. + + Example: + >>> signed = await end_user.sign_solana_transaction(transaction="base64tx==") + + """ + track_action(action="end_user_sign_solana_transaction") + + project_id = self._require_project_id() + resolved_address = self._resolve_solana_address(address) + + result = await self.__api_clients.embedded_wallets.sign_solana_transaction_with_end_user_account( + project_id=project_id, + user_id=self.__user_id, + sign_solana_transaction_with_end_user_account_request=SignSolanaTransactionWithEndUserAccountRequest( + address=resolved_address, + transaction=transaction, + wallet_secret_id=wallet_secret_id, + ), + ) + + return result.signed_transaction + + async def send_solana_transaction( + self, + network: str, + transaction: str, + address: str | None = None, + use_cdp_sponsor: bool | None = None, + wallet_secret_id: str | None = None, + ) -> str: + """Sign and send a Solana transaction for this end user. + + If `address` is not provided, the first Solana account on this end user is used. + + Args: + network: The Solana network (e.g. "solana", "solana-devnet"). + transaction: The base64-encoded transaction to sign and send. + address: The base58-encoded Solana account address. Defaults to the first Solana account. + use_cdp_sponsor: Whether CDP sponsors the transaction fees on behalf of the end user. + wallet_secret_id: The ID of the Temporary Wallet Secret. Required when not + using delegated signing. + + Returns: + str: The base58-encoded transaction signature. + + Example: + >>> sig = await end_user.send_solana_transaction( + ... network="solana-devnet", + ... transaction="base64tx==" + ... ) + + """ + track_action(action="end_user_send_solana_transaction") + + project_id = self._require_project_id() + resolved_address = self._resolve_solana_address(address) + + result = await self.__api_clients.embedded_wallets.send_solana_transaction_with_end_user_account( + project_id=project_id, + user_id=self.__user_id, + send_solana_transaction_with_end_user_account_request=SendSolanaTransactionWithEndUserAccountRequest( + address=resolved_address, + network=network, + transaction=transaction, + use_cdp_sponsor=use_cdp_sponsor, + wallet_secret_id=wallet_secret_id, + ), + ) + + return result.transaction_signature + + async def send_solana_asset( + self, + network: str, + to: str, + amount: str, + address: str | None = None, + create_recipient_ata: bool | None = None, + use_cdp_sponsor: bool | None = None, + wallet_secret_id: str | None = None, + ) -> str: + """Send USDC from this end user's Solana account. + + If `address` is not provided, the first Solana account on this end user is used. + + Args: + network: The Solana network (e.g. "solana", "solana-devnet"). + to: The base58-encoded address of the recipient. + amount: The amount of USDC to send as a decimal string (e.g. "1.5" or "25.50"). + address: The base58-encoded Solana account address. Defaults to the first Solana account. + create_recipient_ata: Whether to automatically create an Associated Token Account + for the recipient if it doesn't exist. + use_cdp_sponsor: Whether CDP sponsors the transaction fees on behalf of the end user. + wallet_secret_id: The ID of the Temporary Wallet Secret. Required when not + using delegated signing. + + Returns: + str: The base58-encoded transaction signature. + + Example: + >>> sig = await end_user.send_solana_asset( + ... network="solana-devnet", + ... to="RecipientAddress...", + ... amount="1.5" + ... ) + + """ + track_action(action="end_user_send_solana_asset") + + project_id = self._require_project_id() + resolved_address = self._resolve_solana_address(address) + + result = await self.__api_clients.embedded_wallets.send_solana_asset_with_end_user_account( + project_id=project_id, + user_id=self.__user_id, + address=resolved_address, + asset="usdc", + send_solana_asset_with_end_user_account_request=SendSolanaAssetWithEndUserAccountRequest( + to=to, + amount=amount, + network=network, + create_recipient_ata=create_recipient_ata, + use_cdp_sponsor=use_cdp_sponsor, + wallet_secret_id=wallet_secret_id, + ), + ) + + return result.transaction_signature diff --git a/python/cdp/end_user_client.py b/python/cdp/end_user_client.py index 4c37d754f..3633f3837 100644 --- a/python/cdp/end_user_client.py +++ b/python/cdp/end_user_client.py @@ -11,7 +11,7 @@ from cdp.analytics import track_action from cdp.api_clients import ApiClients from cdp.constants import ImportAccountPublicRSAKey -from cdp.end_user_account import EndUserAccount +from cdp.end_user_account import EndUserAccount, SendEvmAssetResult from cdp.errors import UserInputValidationError from cdp.openapi_client.models.add_end_user_evm_account201_response import ( AddEndUserEvmAccount201Response, @@ -33,7 +33,54 @@ from cdp.openapi_client.models.create_end_user_request_solana_account import ( CreateEndUserRequestSolanaAccount, ) +from cdp.openapi_client.models.create_evm_eip7702_delegation_with_end_user_account_request import ( + CreateEvmEip7702DelegationWithEndUserAccountRequest, +) +from cdp.openapi_client.models.eip712_message import EIP712Message +from cdp.openapi_client.models.evm_call import EvmCall +from cdp.openapi_client.models.evm_eip7702_delegation_network import EvmEip7702DelegationNetwork +from cdp.openapi_client.models.evm_user_operation import EvmUserOperation +from cdp.openapi_client.models.evm_user_operation_network import EvmUserOperationNetwork from cdp.openapi_client.models.import_end_user_request import ImportEndUserRequest +from cdp.openapi_client.models.revoke_delegation_for_end_user_request import ( + RevokeDelegationForEndUserRequest, +) +from cdp.openapi_client.models.send_evm_asset_with_end_user_account_request import ( + SendEvmAssetWithEndUserAccountRequest, +) +from cdp.openapi_client.models.send_evm_transaction_with_end_user_account_request import ( + SendEvmTransactionWithEndUserAccountRequest, +) +from cdp.openapi_client.models.send_solana_asset_with_end_user_account_request import ( + SendSolanaAssetWithEndUserAccountRequest, +) +from cdp.openapi_client.models.send_solana_transaction_with_end_user_account_request import ( + SendSolanaTransactionWithEndUserAccountRequest, +) +from cdp.openapi_client.models.send_user_operation_with_end_user_account_request import ( + SendUserOperationWithEndUserAccountRequest, +) +from cdp.openapi_client.models.sign_evm_hash_with_end_user_account_request import ( + SignEvmHashWithEndUserAccountRequest, +) +from cdp.openapi_client.models.sign_evm_message_with_end_user_account_request import ( + SignEvmMessageWithEndUserAccountRequest, +) +from cdp.openapi_client.models.sign_evm_transaction_with_end_user_account_request import ( + SignEvmTransactionWithEndUserAccountRequest, +) +from cdp.openapi_client.models.sign_evm_typed_data_with_end_user_account_request import ( + SignEvmTypedDataWithEndUserAccountRequest, +) +from cdp.openapi_client.models.sign_solana_hash_with_end_user_account_request import ( + SignSolanaHashWithEndUserAccountRequest, +) +from cdp.openapi_client.models.sign_solana_message_with_end_user_account_request import ( + SignSolanaMessageWithEndUserAccountRequest, +) +from cdp.openapi_client.models.sign_solana_transaction_with_end_user_account_request import ( + SignSolanaTransactionWithEndUserAccountRequest, +) from cdp.openapi_client.models.validate_end_user_access_token_request import ( ValidateEndUserAccessTokenRequest, ) @@ -56,8 +103,27 @@ def __init__(self, end_users: list[EndUserAccount], next_page_token: str | None class EndUserClient: """The EndUserClient class is responsible for CDP API calls for the end user.""" - def __init__(self, api_clients: ApiClients): + def __init__(self, api_clients: ApiClients, project_id: str | None = None): self.api_clients = api_clients + self._project_id = project_id + + def _require_project_id(self) -> str: + """Return the project ID or raise an error if it is not set. + + Returns: + str: The project ID. + + Raises: + UserInputValidationError: If the project ID is not configured. + + """ + if not self._project_id: + raise UserInputValidationError( + "project_id is required for delegation operations. " + "Set it via the CDP_PROJECT_ID environment variable or pass it as " + "project_id to CdpClient." + ) + return self._project_id async def create_end_user( self, @@ -96,7 +162,7 @@ async def create_end_user( ), ) - return EndUserAccount(end_user, self.api_clients) + return EndUserAccount(end_user, self.api_clients, project_id=self._project_id) async def list_end_users( self, @@ -124,7 +190,8 @@ async def list_end_users( ) end_user_accounts = [ - EndUserAccount(end_user, self.api_clients) for end_user in response.end_users + EndUserAccount(end_user, self.api_clients, project_id=self._project_id) + for end_user in response.end_users ] return ListEndUsersResult( @@ -239,7 +306,7 @@ async def import_end_user( ), ) - return EndUserAccount(end_user, self.api_clients) + return EndUserAccount(end_user, self.api_clients, project_id=self._project_id) async def add_end_user_evm_account( self, @@ -310,3 +377,566 @@ async def add_end_user_solana_account( user_id=user_id, body={}, ) + + # ------------------------------------------------------------------------- + # Delegation operations + # ------------------------------------------------------------------------- + + async def revoke_delegation_for_end_user( + self, + user_id: str, + wallet_secret_id: str | None = None, + ) -> None: + """Revoke all active delegations for an end user. + + This operation can be performed by the end user themselves or by a developer + using their API key. + + Args: + user_id: The unique identifier of the end user. + wallet_secret_id: The ID of the Temporary Wallet Secret used to sign the + X-Wallet-Auth header. Required when not using delegated signing. + + """ + track_action(action="revoke_delegation_for_end_user") + + project_id = self._require_project_id() + + await self.api_clients.embedded_wallets.revoke_delegation_for_end_user( + project_id=project_id, + user_id=user_id, + revoke_delegation_for_end_user_request=RevokeDelegationForEndUserRequest( + wallet_secret_id=wallet_secret_id, + ), + ) + + async def create_evm_eip7702_delegation( + self, + user_id: str, + address: str, + network: EvmEip7702DelegationNetwork, + enable_spend_permissions: bool = False, + wallet_secret_id: str | None = None, + ) -> str: + """Create an EIP-7702 delegation for an end user's EVM EOA account. + + Upgrades an EVM EOA with smart account capabilities, enabling batched + transactions and gas sponsorship via paymaster. + + Args: + user_id: The unique identifier of the end user. + address: The 0x-prefixed address of the EVM account to delegate. + network: The network on which to create the delegation. + enable_spend_permissions: Whether to configure spend permissions. Defaults to False. + wallet_secret_id: The ID of the Temporary Wallet Secret. Required when not + using delegated signing. + + Returns: + str: The delegation operation ID. Use this to poll the operation status. + + """ + track_action(action="create_evm_eip7702_delegation") + + project_id = self._require_project_id() + + result = await self.api_clients.embedded_wallets.create_evm_eip7702_delegation_with_end_user_account( + project_id=project_id, + user_id=user_id, + create_evm_eip7702_delegation_with_end_user_account_request=CreateEvmEip7702DelegationWithEndUserAccountRequest( + address=address, + network=network, + enable_spend_permissions=enable_spend_permissions, + wallet_secret_id=wallet_secret_id, + ), + ) + + return result.delegation_operation_id + + async def sign_evm_hash( + self, + user_id: str, + address: str, + hash: str, + wallet_secret_id: str | None = None, + ) -> str: + """Sign an arbitrary 32-byte hash with an end user's EVM account. + + Args: + user_id: The unique identifier of the end user. + address: The 0x-prefixed address of the EVM account. + hash: The arbitrary 32-byte hash to sign. + wallet_secret_id: The ID of the Temporary Wallet Secret. Required when not + using delegated signing. + + Returns: + str: The signature as a 0x-prefixed hex string. + + """ + track_action(action="sign_evm_hash") + + project_id = self._require_project_id() + + result = await self.api_clients.embedded_wallets.sign_evm_hash_with_end_user_account( + project_id=project_id, + user_id=user_id, + sign_evm_hash_with_end_user_account_request=SignEvmHashWithEndUserAccountRequest( + hash=hash, + address=address, + wallet_secret_id=wallet_secret_id, + ), + ) + + return result.signature + + async def sign_evm_message( + self, + user_id: str, + address: str, + message: str, + wallet_secret_id: str | None = None, + ) -> str: + """Sign a message with an end user's EVM account (EIP-191). + + Args: + user_id: The unique identifier of the end user. + address: The 0x-prefixed address of the EVM account. + message: The message to sign. + wallet_secret_id: The ID of the Temporary Wallet Secret. Required when not + using delegated signing. + + Returns: + str: The signature as a 0x-prefixed hex string. + + """ + track_action(action="sign_evm_message") + + project_id = self._require_project_id() + + result = await self.api_clients.embedded_wallets.sign_evm_message_with_end_user_account( + project_id=project_id, + user_id=user_id, + sign_evm_message_with_end_user_account_request=SignEvmMessageWithEndUserAccountRequest( + address=address, + message=message, + wallet_secret_id=wallet_secret_id, + ), + ) + + return result.signature + + async def sign_evm_transaction( + self, + user_id: str, + address: str, + transaction: str, + wallet_secret_id: str | None = None, + ) -> str: + """Sign an RLP-encoded EVM transaction with an end user's EVM account. + + Args: + user_id: The unique identifier of the end user. + address: The 0x-prefixed address of the EVM account. + transaction: The RLP-encoded transaction to sign, as a 0x-prefixed hex string. + wallet_secret_id: The ID of the Temporary Wallet Secret. Required when not + using delegated signing. + + Returns: + str: The RLP-encoded signed transaction as a 0x-prefixed hex string. + + """ + track_action(action="sign_evm_transaction") + + project_id = self._require_project_id() + + result = await self.api_clients.embedded_wallets.sign_evm_transaction_with_end_user_account( + project_id=project_id, + user_id=user_id, + sign_evm_transaction_with_end_user_account_request=SignEvmTransactionWithEndUserAccountRequest( + address=address, + transaction=transaction, + wallet_secret_id=wallet_secret_id, + ), + ) + + return result.signed_transaction + + async def sign_evm_typed_data( + self, + user_id: str, + address: str, + typed_data: EIP712Message, + wallet_secret_id: str | None = None, + ) -> str: + """Sign EIP-712 typed data with an end user's EVM account. + + Args: + user_id: The unique identifier of the end user. + address: The 0x-prefixed address of the EVM account. + typed_data: The EIP-712 typed data to sign. + wallet_secret_id: The ID of the Temporary Wallet Secret. Required when not + using delegated signing. + + Returns: + str: The signature as a 0x-prefixed hex string. + + """ + track_action(action="sign_evm_typed_data") + + project_id = self._require_project_id() + + result = await self.api_clients.embedded_wallets.sign_evm_typed_data_with_end_user_account( + project_id=project_id, + user_id=user_id, + sign_evm_typed_data_with_end_user_account_request=SignEvmTypedDataWithEndUserAccountRequest( + address=address, + typed_data=typed_data, + wallet_secret_id=wallet_secret_id, + ), + ) + + return result.signature + + async def send_evm_transaction( + self, + user_id: str, + address: str, + network: str, + transaction: str, + wallet_secret_id: str | None = None, + ) -> str: + """Sign and send an RLP-encoded EVM transaction for an end user. + + Args: + user_id: The unique identifier of the end user. + address: The 0x-prefixed address of the EVM account. + network: The network to send the transaction to (e.g. "base", "base-sepolia"). + transaction: The RLP-encoded transaction to sign and send, as a 0x-prefixed hex string. + wallet_secret_id: The ID of the Temporary Wallet Secret. Required when not + using delegated signing. + + Returns: + str: The transaction hash as a 0x-prefixed hex string. + + """ + track_action(action="send_evm_transaction") + + project_id = self._require_project_id() + + result = await self.api_clients.embedded_wallets.send_evm_transaction_with_end_user_account( + project_id=project_id, + user_id=user_id, + send_evm_transaction_with_end_user_account_request=SendEvmTransactionWithEndUserAccountRequest( + address=address, + network=network, + transaction=transaction, + wallet_secret_id=wallet_secret_id, + ), + ) + + return result.transaction_hash + + async def send_evm_asset( + self, + user_id: str, + address: str, + network: str, + to: str, + amount: str, + use_cdp_paymaster: bool | None = None, + paymaster_url: str | None = None, + wallet_secret_id: str | None = None, + ) -> SendEvmAssetResult: + """Send USDC from an end user's EVM account (EOA or Smart Account). + + Automatically handles contract resolution, decimal conversion, gas estimation, + and transaction encoding. + + Args: + user_id: The unique identifier of the end user. + address: The 0x-prefixed address of the EVM account (EOA or Smart Account). + network: The EVM network to send USDC on (e.g. "base", "base-sepolia"). + to: The 0x-prefixed address of the recipient. + amount: The amount of USDC to send as a decimal string (e.g. "1.5" or "25.50"). + use_cdp_paymaster: Whether to use CDP Paymaster to sponsor gas fees. Only + applicable for EVM Smart Accounts. Cannot be used together with paymaster_url. + paymaster_url: Custom Paymaster URL for gas sponsorship. Only applicable for + EVM Smart Accounts. Cannot be used together with use_cdp_paymaster. + wallet_secret_id: The ID of the Temporary Wallet Secret. Required when not + using delegated signing. + + Returns: + SendEvmAssetResult: Contains transaction_hash (for EOA) or user_op_hash (for Smart Accounts). + + """ + track_action(action="send_evm_asset") + + project_id = self._require_project_id() + + result = await self.api_clients.embedded_wallets.send_evm_asset_with_end_user_account( + project_id=project_id, + user_id=user_id, + address=address, + asset="usdc", + send_evm_asset_with_end_user_account_request=SendEvmAssetWithEndUserAccountRequest( + to=to, + amount=amount, + network=network, + use_cdp_paymaster=use_cdp_paymaster, + paymaster_url=paymaster_url, + wallet_secret_id=wallet_secret_id, + ), + ) + + return SendEvmAssetResult( + transaction_hash=result.transaction_hash, + user_op_hash=result.user_op_hash, + ) + + async def send_user_operation( + self, + user_id: str, + address: str, + network: EvmUserOperationNetwork, + calls: list[EvmCall], + use_cdp_paymaster: bool, + paymaster_url: str | None = None, + data_suffix: str | None = None, + wallet_secret_id: str | None = None, + ) -> EvmUserOperation: + """Prepare, sign, and send a user operation for an end user's EVM Smart Account. + + Args: + user_id: The unique identifier of the end user. + address: The address of the EVM Smart Account to execute the user operation from. + network: The network on which to send the user operation. + calls: The list of calls to make from the Smart Account. + use_cdp_paymaster: Whether to use the CDP Paymaster for gas sponsorship. + paymaster_url: Custom Paymaster URL. Cannot be used together with use_cdp_paymaster. + data_suffix: The EIP-8021 data suffix (hex-encoded) for transaction attribution. + wallet_secret_id: The ID of the Temporary Wallet Secret. Required when not + using delegated signing. + + Returns: + EvmUserOperation: The submitted user operation. + + """ + track_action(action="send_user_operation") + + project_id = self._require_project_id() + + return await self.api_clients.embedded_wallets.send_user_operation_with_end_user_account( + project_id=project_id, + user_id=user_id, + address=address, + send_user_operation_with_end_user_account_request=SendUserOperationWithEndUserAccountRequest( + network=network, + calls=calls, + use_cdp_paymaster=use_cdp_paymaster, + paymaster_url=paymaster_url, + data_suffix=data_suffix, + wallet_secret_id=wallet_secret_id, + ), + ) + + async def sign_solana_hash( + self, + user_id: str, + address: str, + hash: str, + wallet_secret_id: str | None = None, + ) -> str: + """Sign an arbitrary 32-byte hash with an end user's Solana account. + + Args: + user_id: The unique identifier of the end user. + address: The base58-encoded address of the Solana account. + hash: The arbitrary 32-byte hash to sign, as a base58-encoded string. + wallet_secret_id: The ID of the Temporary Wallet Secret. Required when not + using delegated signing. + + Returns: + str: The signature as a base58-encoded string. + + """ + track_action(action="sign_solana_hash") + + project_id = self._require_project_id() + + result = await self.api_clients.embedded_wallets.sign_solana_hash_with_end_user_account( + project_id=project_id, + user_id=user_id, + sign_solana_hash_with_end_user_account_request=SignSolanaHashWithEndUserAccountRequest( + hash=hash, + address=address, + wallet_secret_id=wallet_secret_id, + ), + ) + + return result.signature + + async def sign_solana_message( + self, + user_id: str, + address: str, + message: str, + wallet_secret_id: str | None = None, + ) -> str: + """Sign a message with an end user's Solana account. + + Args: + user_id: The unique identifier of the end user. + address: The base58-encoded address of the Solana account. + message: The base64-encoded message to sign. + wallet_secret_id: The ID of the Temporary Wallet Secret. Required when not + using delegated signing. + + Returns: + str: The signature as a base58-encoded string. + + """ + track_action(action="sign_solana_message") + + project_id = self._require_project_id() + + result = await self.api_clients.embedded_wallets.sign_solana_message_with_end_user_account( + project_id=project_id, + user_id=user_id, + sign_solana_message_with_end_user_account_request=SignSolanaMessageWithEndUserAccountRequest( + address=address, + message=message, + wallet_secret_id=wallet_secret_id, + ), + ) + + return result.signature + + async def sign_solana_transaction( + self, + user_id: str, + address: str, + transaction: str, + wallet_secret_id: str | None = None, + ) -> str: + """Sign a Solana transaction with an end user's Solana account. + + Args: + user_id: The unique identifier of the end user. + address: The base58-encoded address of the Solana account. + transaction: The base64-encoded transaction to sign. + wallet_secret_id: The ID of the Temporary Wallet Secret. Required when not + using delegated signing. + + Returns: + str: The base64-encoded signed transaction. + + """ + track_action(action="sign_solana_transaction") + + project_id = self._require_project_id() + + result = await self.api_clients.embedded_wallets.sign_solana_transaction_with_end_user_account( + project_id=project_id, + user_id=user_id, + sign_solana_transaction_with_end_user_account_request=SignSolanaTransactionWithEndUserAccountRequest( + address=address, + transaction=transaction, + wallet_secret_id=wallet_secret_id, + ), + ) + + return result.signed_transaction + + async def send_solana_transaction( + self, + user_id: str, + address: str, + network: str, + transaction: str, + use_cdp_sponsor: bool | None = None, + wallet_secret_id: str | None = None, + ) -> str: + """Sign and send a Solana transaction for an end user. + + Args: + user_id: The unique identifier of the end user. + address: The base58-encoded address of the Solana account. + network: The Solana network to send the transaction to (e.g. "solana", "solana-devnet"). + transaction: The base64-encoded transaction to sign and send. + use_cdp_sponsor: Whether CDP sponsors the transaction fees on behalf of the end user. + wallet_secret_id: The ID of the Temporary Wallet Secret. Required when not + using delegated signing. + + Returns: + str: The base58-encoded transaction signature. + + """ + track_action(action="send_solana_transaction") + + project_id = self._require_project_id() + + result = await self.api_clients.embedded_wallets.send_solana_transaction_with_end_user_account( + project_id=project_id, + user_id=user_id, + send_solana_transaction_with_end_user_account_request=SendSolanaTransactionWithEndUserAccountRequest( + address=address, + network=network, + transaction=transaction, + use_cdp_sponsor=use_cdp_sponsor, + wallet_secret_id=wallet_secret_id, + ), + ) + + return result.transaction_signature + + async def send_solana_asset( + self, + user_id: str, + address: str, + network: str, + to: str, + amount: str, + create_recipient_ata: bool | None = None, + use_cdp_sponsor: bool | None = None, + wallet_secret_id: str | None = None, + ) -> str: + """Send USDC from an end user's Solana account. + + Automatically handles mint resolution, ATA creation, decimal conversion, + and transaction encoding. + + Args: + user_id: The unique identifier of the end user. + address: The base58-encoded address of the Solana account. + network: The Solana network to send USDC on (e.g. "solana", "solana-devnet"). + to: The base58-encoded address of the recipient. + amount: The amount of USDC to send as a decimal string (e.g. "1.5" or "25.50"). + create_recipient_ata: Whether to automatically create an Associated Token Account + for the recipient if it doesn't exist. When true, the sender pays the rent. + use_cdp_sponsor: Whether CDP sponsors the transaction fees on behalf of the end user. + wallet_secret_id: The ID of the Temporary Wallet Secret. Required when not + using delegated signing. + + Returns: + str: The base58-encoded transaction signature. + + """ + track_action(action="send_solana_asset") + + project_id = self._require_project_id() + + result = await self.api_clients.embedded_wallets.send_solana_asset_with_end_user_account( + project_id=project_id, + user_id=user_id, + address=address, + asset="usdc", + send_solana_asset_with_end_user_account_request=SendSolanaAssetWithEndUserAccountRequest( + to=to, + amount=amount, + network=network, + create_recipient_ata=create_recipient_ata, + use_cdp_sponsor=use_cdp_sponsor, + wallet_secret_id=wallet_secret_id, + ), + ) + + return result.transaction_signature diff --git a/python/cdp/openapi_client/__init__.py b/python/cdp/openapi_client/__init__.py index b3594b5f3..ef195f7bc 100644 --- a/python/cdp/openapi_client/__init__.py +++ b/python/cdp/openapi_client/__init__.py @@ -22,12 +22,13 @@ from cdp.openapi_client.api.evm_smart_accounts_api import EVMSmartAccountsApi from cdp.openapi_client.api.evm_swaps_api import EVMSwapsApi from cdp.openapi_client.api.evm_token_balances_api import EVMTokenBalancesApi +from cdp.openapi_client.api.embedded_wallets_core_functionality_api import EmbeddedWalletsCoreFunctionalityApi from cdp.openapi_client.api.end_user_accounts_api import EndUserAccountsApi from cdp.openapi_client.api.faucets_api import FaucetsApi from cdp.openapi_client.api.onchain_data_api import OnchainDataApi from cdp.openapi_client.api.onramp_api import OnrampApi from cdp.openapi_client.api.policy_engine_api import PolicyEngineApi -from cdp.openapi_client.api.sqlapi_alpha_api import SQLAPIAlphaApi +from cdp.openapi_client.api.sqlapi_api import SQLAPIApi from cdp.openapi_client.api.solana_accounts_api import SolanaAccountsApi from cdp.openapi_client.api.solana_token_balances_api import SolanaTokenBalancesApi from cdp.openapi_client.api.webhooks_api import WebhooksApi @@ -66,8 +67,9 @@ from cdp.openapi_client.models.create_end_user_request_evm_account import CreateEndUserRequestEvmAccount from cdp.openapi_client.models.create_end_user_request_solana_account import CreateEndUserRequestSolanaAccount from cdp.openapi_client.models.create_evm_account_request import CreateEvmAccountRequest -from cdp.openapi_client.models.create_evm_eip7702_delegation201_response import CreateEvmEip7702Delegation201Response from cdp.openapi_client.models.create_evm_eip7702_delegation_request import CreateEvmEip7702DelegationRequest +from cdp.openapi_client.models.create_evm_eip7702_delegation_with_end_user_account201_response import CreateEvmEip7702DelegationWithEndUserAccount201Response +from cdp.openapi_client.models.create_evm_eip7702_delegation_with_end_user_account_request import CreateEvmEip7702DelegationWithEndUserAccountRequest from cdp.openapi_client.models.create_evm_smart_account_request import CreateEvmSmartAccountRequest from cdp.openapi_client.models.create_evm_swap_quote_request import CreateEvmSwapQuoteRequest from cdp.openapi_client.models.create_onramp_order201_response import CreateOnrampOrder201Response @@ -106,6 +108,7 @@ from cdp.openapi_client.models.evm_message_criterion import EvmMessageCriterion from cdp.openapi_client.models.evm_network_criterion import EvmNetworkCriterion from cdp.openapi_client.models.evm_smart_account import EvmSmartAccount +from cdp.openapi_client.models.evm_spend_permissions_revoke_spend_permission_request import EvmSpendPermissionsRevokeSpendPermissionRequest from cdp.openapi_client.models.evm_swaps_network import EvmSwapsNetwork from cdp.openapi_client.models.evm_typed_address_condition import EvmTypedAddressCondition from cdp.openapi_client.models.evm_typed_numerical_condition import EvmTypedNumericalCondition @@ -178,37 +181,46 @@ from cdp.openapi_client.models.request_evm_faucet_request import RequestEvmFaucetRequest from cdp.openapi_client.models.request_solana_faucet200_response import RequestSolanaFaucet200Response from cdp.openapi_client.models.request_solana_faucet_request import RequestSolanaFaucetRequest +from cdp.openapi_client.models.revoke_delegation_for_end_user_request import RevokeDelegationForEndUserRequest from cdp.openapi_client.models.revoke_spend_permission_request import RevokeSpendPermissionRequest from cdp.openapi_client.models.rule import Rule from cdp.openapi_client.models.send_end_user_evm_transaction_rule import SendEndUserEvmTransactionRule from cdp.openapi_client.models.send_end_user_sol_transaction_rule import SendEndUserSolTransactionRule -from cdp.openapi_client.models.send_evm_transaction200_response import SendEvmTransaction200Response +from cdp.openapi_client.models.send_evm_asset_with_end_user_account200_response import SendEvmAssetWithEndUserAccount200Response +from cdp.openapi_client.models.send_evm_asset_with_end_user_account_request import SendEvmAssetWithEndUserAccountRequest from cdp.openapi_client.models.send_evm_transaction_criteria_inner import SendEvmTransactionCriteriaInner from cdp.openapi_client.models.send_evm_transaction_request import SendEvmTransactionRequest from cdp.openapi_client.models.send_evm_transaction_rule import SendEvmTransactionRule +from cdp.openapi_client.models.send_evm_transaction_with_end_user_account200_response import SendEvmTransactionWithEndUserAccount200Response +from cdp.openapi_client.models.send_evm_transaction_with_end_user_account_request import SendEvmTransactionWithEndUserAccountRequest from cdp.openapi_client.models.send_sol_transaction_criteria_inner import SendSolTransactionCriteriaInner from cdp.openapi_client.models.send_sol_transaction_rule import SendSolTransactionRule -from cdp.openapi_client.models.send_solana_transaction200_response import SendSolanaTransaction200Response +from cdp.openapi_client.models.send_solana_asset_with_end_user_account_request import SendSolanaAssetWithEndUserAccountRequest from cdp.openapi_client.models.send_solana_transaction_request import SendSolanaTransactionRequest +from cdp.openapi_client.models.send_solana_transaction_with_end_user_account200_response import SendSolanaTransactionWithEndUserAccount200Response +from cdp.openapi_client.models.send_solana_transaction_with_end_user_account_request import SendSolanaTransactionWithEndUserAccountRequest from cdp.openapi_client.models.send_user_operation_request import SendUserOperationRequest from cdp.openapi_client.models.send_user_operation_rule import SendUserOperationRule +from cdp.openapi_client.models.send_user_operation_with_end_user_account_request import SendUserOperationWithEndUserAccountRequest from cdp.openapi_client.models.sign_end_user_evm_message_rule import SignEndUserEvmMessageRule from cdp.openapi_client.models.sign_end_user_evm_transaction_rule import SignEndUserEvmTransactionRule from cdp.openapi_client.models.sign_end_user_evm_typed_data_rule import SignEndUserEvmTypedDataRule from cdp.openapi_client.models.sign_end_user_sol_message_rule import SignEndUserSolMessageRule from cdp.openapi_client.models.sign_end_user_sol_transaction_rule import SignEndUserSolTransactionRule -from cdp.openapi_client.models.sign_evm_hash200_response import SignEvmHash200Response from cdp.openapi_client.models.sign_evm_hash_request import SignEvmHashRequest from cdp.openapi_client.models.sign_evm_hash_rule import SignEvmHashRule -from cdp.openapi_client.models.sign_evm_message200_response import SignEvmMessage200Response +from cdp.openapi_client.models.sign_evm_hash_with_end_user_account200_response import SignEvmHashWithEndUserAccount200Response +from cdp.openapi_client.models.sign_evm_hash_with_end_user_account_request import SignEvmHashWithEndUserAccountRequest from cdp.openapi_client.models.sign_evm_message_criteria_inner import SignEvmMessageCriteriaInner from cdp.openapi_client.models.sign_evm_message_request import SignEvmMessageRequest from cdp.openapi_client.models.sign_evm_message_rule import SignEvmMessageRule -from cdp.openapi_client.models.sign_evm_transaction200_response import SignEvmTransaction200Response +from cdp.openapi_client.models.sign_evm_message_with_end_user_account200_response import SignEvmMessageWithEndUserAccount200Response +from cdp.openapi_client.models.sign_evm_message_with_end_user_account_request import SignEvmMessageWithEndUserAccountRequest from cdp.openapi_client.models.sign_evm_transaction_criteria_inner import SignEvmTransactionCriteriaInner from cdp.openapi_client.models.sign_evm_transaction_request import SignEvmTransactionRequest from cdp.openapi_client.models.sign_evm_transaction_rule import SignEvmTransactionRule -from cdp.openapi_client.models.sign_evm_typed_data200_response import SignEvmTypedData200Response +from cdp.openapi_client.models.sign_evm_transaction_with_end_user_account200_response import SignEvmTransactionWithEndUserAccount200Response +from cdp.openapi_client.models.sign_evm_transaction_with_end_user_account_request import SignEvmTransactionWithEndUserAccountRequest from cdp.openapi_client.models.sign_evm_typed_data_criteria_inner import SignEvmTypedDataCriteriaInner from cdp.openapi_client.models.sign_evm_typed_data_field_criterion import SignEvmTypedDataFieldCriterion from cdp.openapi_client.models.sign_evm_typed_data_field_criterion_conditions_inner import SignEvmTypedDataFieldCriterionConditionsInner @@ -216,14 +228,20 @@ from cdp.openapi_client.models.sign_evm_typed_data_field_criterion_types_types_value_inner import SignEvmTypedDataFieldCriterionTypesTypesValueInner from cdp.openapi_client.models.sign_evm_typed_data_rule import SignEvmTypedDataRule from cdp.openapi_client.models.sign_evm_typed_data_verifying_contract_criterion import SignEvmTypedDataVerifyingContractCriterion +from cdp.openapi_client.models.sign_evm_typed_data_with_end_user_account200_response import SignEvmTypedDataWithEndUserAccount200Response +from cdp.openapi_client.models.sign_evm_typed_data_with_end_user_account_request import SignEvmTypedDataWithEndUserAccountRequest from cdp.openapi_client.models.sign_sol_message_criteria_inner import SignSolMessageCriteriaInner from cdp.openapi_client.models.sign_sol_message_rule import SignSolMessageRule from cdp.openapi_client.models.sign_sol_transaction_criteria_inner import SignSolTransactionCriteriaInner from cdp.openapi_client.models.sign_sol_transaction_rule import SignSolTransactionRule -from cdp.openapi_client.models.sign_solana_message200_response import SignSolanaMessage200Response +from cdp.openapi_client.models.sign_solana_hash_with_end_user_account200_response import SignSolanaHashWithEndUserAccount200Response +from cdp.openapi_client.models.sign_solana_hash_with_end_user_account_request import SignSolanaHashWithEndUserAccountRequest from cdp.openapi_client.models.sign_solana_message_request import SignSolanaMessageRequest -from cdp.openapi_client.models.sign_solana_transaction200_response import SignSolanaTransaction200Response +from cdp.openapi_client.models.sign_solana_message_with_end_user_account200_response import SignSolanaMessageWithEndUserAccount200Response +from cdp.openapi_client.models.sign_solana_message_with_end_user_account_request import SignSolanaMessageWithEndUserAccountRequest from cdp.openapi_client.models.sign_solana_transaction_request import SignSolanaTransactionRequest +from cdp.openapi_client.models.sign_solana_transaction_with_end_user_account200_response import SignSolanaTransactionWithEndUserAccount200Response +from cdp.openapi_client.models.sign_solana_transaction_with_end_user_account_request import SignSolanaTransactionWithEndUserAccountRequest from cdp.openapi_client.models.sms_authentication import SmsAuthentication from cdp.openapi_client.models.sol_address_criterion import SolAddressCriterion from cdp.openapi_client.models.sol_data_condition import SolDataCondition @@ -278,9 +296,9 @@ from cdp.openapi_client.models.x402_settle_payment_rejection import X402SettlePaymentRejection from cdp.openapi_client.models.x402_supported_payment_kind import X402SupportedPaymentKind from cdp.openapi_client.models.x402_v1_payment_payload import X402V1PaymentPayload -from cdp.openapi_client.models.x402_v1_payment_payload_payload import X402V1PaymentPayloadPayload from cdp.openapi_client.models.x402_v1_payment_requirements import X402V1PaymentRequirements from cdp.openapi_client.models.x402_v2_payment_payload import X402V2PaymentPayload +from cdp.openapi_client.models.x402_v2_payment_payload_payload import X402V2PaymentPayloadPayload from cdp.openapi_client.models.x402_v2_payment_requirements import X402V2PaymentRequirements from cdp.openapi_client.models.x402_verify_invalid_reason import X402VerifyInvalidReason from cdp.openapi_client.models.x402_verify_payment_rejection import X402VerifyPaymentRejection diff --git a/python/cdp/openapi_client/api/__init__.py b/python/cdp/openapi_client/api/__init__.py index 32ca5ac3f..629877074 100644 --- a/python/cdp/openapi_client/api/__init__.py +++ b/python/cdp/openapi_client/api/__init__.py @@ -5,12 +5,13 @@ from cdp.openapi_client.api.evm_smart_accounts_api import EVMSmartAccountsApi from cdp.openapi_client.api.evm_swaps_api import EVMSwapsApi from cdp.openapi_client.api.evm_token_balances_api import EVMTokenBalancesApi +from cdp.openapi_client.api.embedded_wallets_core_functionality_api import EmbeddedWalletsCoreFunctionalityApi from cdp.openapi_client.api.end_user_accounts_api import EndUserAccountsApi from cdp.openapi_client.api.faucets_api import FaucetsApi from cdp.openapi_client.api.onchain_data_api import OnchainDataApi from cdp.openapi_client.api.onramp_api import OnrampApi from cdp.openapi_client.api.policy_engine_api import PolicyEngineApi -from cdp.openapi_client.api.sqlapi_alpha_api import SQLAPIAlphaApi +from cdp.openapi_client.api.sqlapi_api import SQLAPIApi from cdp.openapi_client.api.solana_accounts_api import SolanaAccountsApi from cdp.openapi_client.api.solana_token_balances_api import SolanaTokenBalancesApi from cdp.openapi_client.api.webhooks_api import WebhooksApi diff --git a/python/cdp/openapi_client/api/embedded_wallets_core_functionality_api.py b/python/cdp/openapi_client/api/embedded_wallets_core_functionality_api.py new file mode 100644 index 000000000..323f7a134 --- /dev/null +++ b/python/cdp/openapi_client/api/embedded_wallets_core_functionality_api.py @@ -0,0 +1,5771 @@ +# coding: utf-8 + +""" + Coinbase Developer Platform APIs + + The Coinbase Developer Platform APIs - leading the world's transition onchain. + + The version of the OpenAPI document: 2.0.0 + Contact: cdp@coinbase.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr, field_validator +from typing import Any, Optional +from typing_extensions import Annotated +from cdp.openapi_client.models.create_evm_eip7702_delegation_with_end_user_account201_response import CreateEvmEip7702DelegationWithEndUserAccount201Response +from cdp.openapi_client.models.create_evm_eip7702_delegation_with_end_user_account_request import CreateEvmEip7702DelegationWithEndUserAccountRequest +from cdp.openapi_client.models.evm_user_operation import EvmUserOperation +from cdp.openapi_client.models.revoke_delegation_for_end_user_request import RevokeDelegationForEndUserRequest +from cdp.openapi_client.models.revoke_spend_permission_request import RevokeSpendPermissionRequest +from cdp.openapi_client.models.send_evm_asset_with_end_user_account200_response import SendEvmAssetWithEndUserAccount200Response +from cdp.openapi_client.models.send_evm_asset_with_end_user_account_request import SendEvmAssetWithEndUserAccountRequest +from cdp.openapi_client.models.send_evm_transaction_with_end_user_account200_response import SendEvmTransactionWithEndUserAccount200Response +from cdp.openapi_client.models.send_evm_transaction_with_end_user_account_request import SendEvmTransactionWithEndUserAccountRequest +from cdp.openapi_client.models.send_solana_asset_with_end_user_account_request import SendSolanaAssetWithEndUserAccountRequest +from cdp.openapi_client.models.send_solana_transaction_with_end_user_account200_response import SendSolanaTransactionWithEndUserAccount200Response +from cdp.openapi_client.models.send_solana_transaction_with_end_user_account_request import SendSolanaTransactionWithEndUserAccountRequest +from cdp.openapi_client.models.send_user_operation_with_end_user_account_request import SendUserOperationWithEndUserAccountRequest +from cdp.openapi_client.models.sign_evm_hash_with_end_user_account200_response import SignEvmHashWithEndUserAccount200Response +from cdp.openapi_client.models.sign_evm_hash_with_end_user_account_request import SignEvmHashWithEndUserAccountRequest +from cdp.openapi_client.models.sign_evm_message_with_end_user_account200_response import SignEvmMessageWithEndUserAccount200Response +from cdp.openapi_client.models.sign_evm_message_with_end_user_account_request import SignEvmMessageWithEndUserAccountRequest +from cdp.openapi_client.models.sign_evm_transaction_with_end_user_account200_response import SignEvmTransactionWithEndUserAccount200Response +from cdp.openapi_client.models.sign_evm_transaction_with_end_user_account_request import SignEvmTransactionWithEndUserAccountRequest +from cdp.openapi_client.models.sign_evm_typed_data_with_end_user_account200_response import SignEvmTypedDataWithEndUserAccount200Response +from cdp.openapi_client.models.sign_evm_typed_data_with_end_user_account_request import SignEvmTypedDataWithEndUserAccountRequest +from cdp.openapi_client.models.sign_solana_hash_with_end_user_account200_response import SignSolanaHashWithEndUserAccount200Response +from cdp.openapi_client.models.sign_solana_hash_with_end_user_account_request import SignSolanaHashWithEndUserAccountRequest +from cdp.openapi_client.models.sign_solana_message_with_end_user_account200_response import SignSolanaMessageWithEndUserAccount200Response +from cdp.openapi_client.models.sign_solana_message_with_end_user_account_request import SignSolanaMessageWithEndUserAccountRequest +from cdp.openapi_client.models.sign_solana_transaction_with_end_user_account200_response import SignSolanaTransactionWithEndUserAccount200Response +from cdp.openapi_client.models.sign_solana_transaction_with_end_user_account_request import SignSolanaTransactionWithEndUserAccountRequest + +from cdp.openapi_client.api_client import ApiClient, RequestSerialized +from cdp.openapi_client.api_response import ApiResponse +from cdp.openapi_client.rest import RESTResponseType + + +class EmbeddedWalletsCoreFunctionalityApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def create_evm_eip7702_delegation_with_end_user_account( + self, + project_id: Annotated[str, Field(strict=True, description="The ID of the CDP Project.")], + user_id: Annotated[str, Field(strict=True, description="The ID of the end user.")], + create_evm_eip7702_delegation_with_end_user_account_request: CreateEvmEip7702DelegationWithEndUserAccountRequest, + x_wallet_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + x_idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=128)]], Field(description="An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. ")] = None, + x_developer_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CreateEvmEip7702DelegationWithEndUserAccount201Response: + """Create EIP-7702 delegation for end user EVM account + + Creates an EIP-7702 delegation for an end user's EVM EOA account, upgrading it with smart account capabilities. This endpoint: - Retrieves delegation artifacts from onchain - Signs the EIP-7702 authorization for delegation - Assembles and submits a Type 4 transaction - Creates an associated smart account object The delegation allows the EVM EOA to be used as a smart account, which enables batched transactions and gas sponsorship via paymaster. + + :param project_id: The ID of the CDP Project. (required) + :type project_id: str + :param user_id: The ID of the end user. (required) + :type user_id: str + :param create_evm_eip7702_delegation_with_end_user_account_request: (required) + :type create_evm_eip7702_delegation_with_end_user_account_request: CreateEvmEip7702DelegationWithEndUserAccountRequest + :param x_wallet_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_wallet_auth: str + :param x_idempotency_key: An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. + :type x_idempotency_key: str + :param x_developer_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_developer_auth: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_evm_eip7702_delegation_with_end_user_account_serialize( + project_id=project_id, + user_id=user_id, + create_evm_eip7702_delegation_with_end_user_account_request=create_evm_eip7702_delegation_with_end_user_account_request, + x_wallet_auth=x_wallet_auth, + x_idempotency_key=x_idempotency_key, + x_developer_auth=x_developer_auth, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateEvmEip7702DelegationWithEndUserAccount201Response", + '400': "Error", + '401': "Error", + '402': "Error", + '404': "Error", + '409': "Error", + '422': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + '503': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def create_evm_eip7702_delegation_with_end_user_account_with_http_info( + self, + project_id: Annotated[str, Field(strict=True, description="The ID of the CDP Project.")], + user_id: Annotated[str, Field(strict=True, description="The ID of the end user.")], + create_evm_eip7702_delegation_with_end_user_account_request: CreateEvmEip7702DelegationWithEndUserAccountRequest, + x_wallet_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + x_idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=128)]], Field(description="An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. ")] = None, + x_developer_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CreateEvmEip7702DelegationWithEndUserAccount201Response]: + """Create EIP-7702 delegation for end user EVM account + + Creates an EIP-7702 delegation for an end user's EVM EOA account, upgrading it with smart account capabilities. This endpoint: - Retrieves delegation artifacts from onchain - Signs the EIP-7702 authorization for delegation - Assembles and submits a Type 4 transaction - Creates an associated smart account object The delegation allows the EVM EOA to be used as a smart account, which enables batched transactions and gas sponsorship via paymaster. + + :param project_id: The ID of the CDP Project. (required) + :type project_id: str + :param user_id: The ID of the end user. (required) + :type user_id: str + :param create_evm_eip7702_delegation_with_end_user_account_request: (required) + :type create_evm_eip7702_delegation_with_end_user_account_request: CreateEvmEip7702DelegationWithEndUserAccountRequest + :param x_wallet_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_wallet_auth: str + :param x_idempotency_key: An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. + :type x_idempotency_key: str + :param x_developer_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_developer_auth: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_evm_eip7702_delegation_with_end_user_account_serialize( + project_id=project_id, + user_id=user_id, + create_evm_eip7702_delegation_with_end_user_account_request=create_evm_eip7702_delegation_with_end_user_account_request, + x_wallet_auth=x_wallet_auth, + x_idempotency_key=x_idempotency_key, + x_developer_auth=x_developer_auth, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateEvmEip7702DelegationWithEndUserAccount201Response", + '400': "Error", + '401': "Error", + '402': "Error", + '404': "Error", + '409': "Error", + '422': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + '503': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def create_evm_eip7702_delegation_with_end_user_account_without_preload_content( + self, + project_id: Annotated[str, Field(strict=True, description="The ID of the CDP Project.")], + user_id: Annotated[str, Field(strict=True, description="The ID of the end user.")], + create_evm_eip7702_delegation_with_end_user_account_request: CreateEvmEip7702DelegationWithEndUserAccountRequest, + x_wallet_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + x_idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=128)]], Field(description="An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. ")] = None, + x_developer_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create EIP-7702 delegation for end user EVM account + + Creates an EIP-7702 delegation for an end user's EVM EOA account, upgrading it with smart account capabilities. This endpoint: - Retrieves delegation artifacts from onchain - Signs the EIP-7702 authorization for delegation - Assembles and submits a Type 4 transaction - Creates an associated smart account object The delegation allows the EVM EOA to be used as a smart account, which enables batched transactions and gas sponsorship via paymaster. + + :param project_id: The ID of the CDP Project. (required) + :type project_id: str + :param user_id: The ID of the end user. (required) + :type user_id: str + :param create_evm_eip7702_delegation_with_end_user_account_request: (required) + :type create_evm_eip7702_delegation_with_end_user_account_request: CreateEvmEip7702DelegationWithEndUserAccountRequest + :param x_wallet_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_wallet_auth: str + :param x_idempotency_key: An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. + :type x_idempotency_key: str + :param x_developer_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_developer_auth: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_evm_eip7702_delegation_with_end_user_account_serialize( + project_id=project_id, + user_id=user_id, + create_evm_eip7702_delegation_with_end_user_account_request=create_evm_eip7702_delegation_with_end_user_account_request, + x_wallet_auth=x_wallet_auth, + x_idempotency_key=x_idempotency_key, + x_developer_auth=x_developer_auth, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateEvmEip7702DelegationWithEndUserAccount201Response", + '400': "Error", + '401': "Error", + '402': "Error", + '404': "Error", + '409': "Error", + '422': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + '503': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_evm_eip7702_delegation_with_end_user_account_serialize( + self, + project_id, + user_id, + create_evm_eip7702_delegation_with_end_user_account_request, + x_wallet_auth, + x_idempotency_key, + x_developer_auth, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params['projectId'] = project_id + if user_id is not None: + _path_params['userId'] = user_id + # process the query parameters + # process the header parameters + if x_wallet_auth is not None: + _header_params['X-Wallet-Auth'] = x_wallet_auth + if x_idempotency_key is not None: + _header_params['X-Idempotency-Key'] = x_idempotency_key + if x_developer_auth is not None: + _header_params['X-Developer-Auth'] = x_developer_auth + # process the form parameters + # process the body parameter + if create_evm_eip7702_delegation_with_end_user_account_request is not None: + _body_params = create_evm_eip7702_delegation_with_end_user_account_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'endUserAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/embedded-wallet-api/projects/{projectId}/end-users/{userId}/evm/eip7702/delegation', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def revoke_delegation_for_end_user( + self, + project_id: Annotated[str, Field(strict=True, description="The ID of the CDP Project.")], + user_id: Annotated[str, Field(strict=True, description="The ID of the end user.")], + revoke_delegation_for_end_user_request: RevokeDelegationForEndUserRequest, + x_wallet_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + x_developer_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + x_idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=128)]], Field(description="An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Revoke delegation for end user + + Revokes all active delegations for the specified end user. This operation can be performed by the end user themselves or by a developer using their API key. + + :param project_id: The ID of the CDP Project. (required) + :type project_id: str + :param user_id: The ID of the end user. (required) + :type user_id: str + :param revoke_delegation_for_end_user_request: (required) + :type revoke_delegation_for_end_user_request: RevokeDelegationForEndUserRequest + :param x_wallet_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_wallet_auth: str + :param x_developer_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_developer_auth: str + :param x_idempotency_key: An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. + :type x_idempotency_key: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._revoke_delegation_for_end_user_serialize( + project_id=project_id, + user_id=user_id, + revoke_delegation_for_end_user_request=revoke_delegation_for_end_user_request, + x_wallet_auth=x_wallet_auth, + x_developer_auth=x_developer_auth, + x_idempotency_key=x_idempotency_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + '500': "Error", + '502': "Error", + '503': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def revoke_delegation_for_end_user_with_http_info( + self, + project_id: Annotated[str, Field(strict=True, description="The ID of the CDP Project.")], + user_id: Annotated[str, Field(strict=True, description="The ID of the end user.")], + revoke_delegation_for_end_user_request: RevokeDelegationForEndUserRequest, + x_wallet_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + x_developer_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + x_idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=128)]], Field(description="An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Revoke delegation for end user + + Revokes all active delegations for the specified end user. This operation can be performed by the end user themselves or by a developer using their API key. + + :param project_id: The ID of the CDP Project. (required) + :type project_id: str + :param user_id: The ID of the end user. (required) + :type user_id: str + :param revoke_delegation_for_end_user_request: (required) + :type revoke_delegation_for_end_user_request: RevokeDelegationForEndUserRequest + :param x_wallet_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_wallet_auth: str + :param x_developer_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_developer_auth: str + :param x_idempotency_key: An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. + :type x_idempotency_key: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._revoke_delegation_for_end_user_serialize( + project_id=project_id, + user_id=user_id, + revoke_delegation_for_end_user_request=revoke_delegation_for_end_user_request, + x_wallet_auth=x_wallet_auth, + x_developer_auth=x_developer_auth, + x_idempotency_key=x_idempotency_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + '500': "Error", + '502': "Error", + '503': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def revoke_delegation_for_end_user_without_preload_content( + self, + project_id: Annotated[str, Field(strict=True, description="The ID of the CDP Project.")], + user_id: Annotated[str, Field(strict=True, description="The ID of the end user.")], + revoke_delegation_for_end_user_request: RevokeDelegationForEndUserRequest, + x_wallet_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + x_developer_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + x_idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=128)]], Field(description="An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Revoke delegation for end user + + Revokes all active delegations for the specified end user. This operation can be performed by the end user themselves or by a developer using their API key. + + :param project_id: The ID of the CDP Project. (required) + :type project_id: str + :param user_id: The ID of the end user. (required) + :type user_id: str + :param revoke_delegation_for_end_user_request: (required) + :type revoke_delegation_for_end_user_request: RevokeDelegationForEndUserRequest + :param x_wallet_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_wallet_auth: str + :param x_developer_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_developer_auth: str + :param x_idempotency_key: An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. + :type x_idempotency_key: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._revoke_delegation_for_end_user_serialize( + project_id=project_id, + user_id=user_id, + revoke_delegation_for_end_user_request=revoke_delegation_for_end_user_request, + x_wallet_auth=x_wallet_auth, + x_developer_auth=x_developer_auth, + x_idempotency_key=x_idempotency_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + '500': "Error", + '502': "Error", + '503': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _revoke_delegation_for_end_user_serialize( + self, + project_id, + user_id, + revoke_delegation_for_end_user_request, + x_wallet_auth, + x_developer_auth, + x_idempotency_key, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params['projectId'] = project_id + if user_id is not None: + _path_params['userId'] = user_id + # process the query parameters + # process the header parameters + if x_wallet_auth is not None: + _header_params['X-Wallet-Auth'] = x_wallet_auth + if x_developer_auth is not None: + _header_params['X-Developer-Auth'] = x_developer_auth + if x_idempotency_key is not None: + _header_params['X-Idempotency-Key'] = x_idempotency_key + # process the form parameters + # process the body parameter + if revoke_delegation_for_end_user_request is not None: + _body_params = revoke_delegation_for_end_user_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'apiKeyAuth', + 'endUserAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v2/embedded-wallet-api/projects/{projectId}/end-users/{userId}/delegation', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def revoke_spend_permission_with_end_user_account( + self, + project_id: Annotated[str, Field(strict=True, description="The ID of the CDP Project.")], + user_id: Annotated[str, Field(strict=True, description="The ID of the end user.")], + address: Annotated[str, Field(strict=True, description="The address of the Smart account this spend permission is valid for.")], + revoke_spend_permission_request: RevokeSpendPermissionRequest, + x_wallet_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + x_idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=128)]], Field(description="An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> EvmUserOperation: + """Revoke a spend permission + + Revokes an existing spend permission. + + :param project_id: The ID of the CDP Project. (required) + :type project_id: str + :param user_id: The ID of the end user. (required) + :type user_id: str + :param address: The address of the Smart account this spend permission is valid for. (required) + :type address: str + :param revoke_spend_permission_request: (required) + :type revoke_spend_permission_request: RevokeSpendPermissionRequest + :param x_wallet_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_wallet_auth: str + :param x_idempotency_key: An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. + :type x_idempotency_key: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._revoke_spend_permission_with_end_user_account_serialize( + project_id=project_id, + user_id=user_id, + address=address, + revoke_spend_permission_request=revoke_spend_permission_request, + x_wallet_auth=x_wallet_auth, + x_idempotency_key=x_idempotency_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EvmUserOperation", + '400': "Error", + '401': "Error", + '404': "Error", + '500': "Error", + '502': "Error", + '503': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def revoke_spend_permission_with_end_user_account_with_http_info( + self, + project_id: Annotated[str, Field(strict=True, description="The ID of the CDP Project.")], + user_id: Annotated[str, Field(strict=True, description="The ID of the end user.")], + address: Annotated[str, Field(strict=True, description="The address of the Smart account this spend permission is valid for.")], + revoke_spend_permission_request: RevokeSpendPermissionRequest, + x_wallet_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + x_idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=128)]], Field(description="An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[EvmUserOperation]: + """Revoke a spend permission + + Revokes an existing spend permission. + + :param project_id: The ID of the CDP Project. (required) + :type project_id: str + :param user_id: The ID of the end user. (required) + :type user_id: str + :param address: The address of the Smart account this spend permission is valid for. (required) + :type address: str + :param revoke_spend_permission_request: (required) + :type revoke_spend_permission_request: RevokeSpendPermissionRequest + :param x_wallet_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_wallet_auth: str + :param x_idempotency_key: An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. + :type x_idempotency_key: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._revoke_spend_permission_with_end_user_account_serialize( + project_id=project_id, + user_id=user_id, + address=address, + revoke_spend_permission_request=revoke_spend_permission_request, + x_wallet_auth=x_wallet_auth, + x_idempotency_key=x_idempotency_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EvmUserOperation", + '400': "Error", + '401': "Error", + '404': "Error", + '500': "Error", + '502': "Error", + '503': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def revoke_spend_permission_with_end_user_account_without_preload_content( + self, + project_id: Annotated[str, Field(strict=True, description="The ID of the CDP Project.")], + user_id: Annotated[str, Field(strict=True, description="The ID of the end user.")], + address: Annotated[str, Field(strict=True, description="The address of the Smart account this spend permission is valid for.")], + revoke_spend_permission_request: RevokeSpendPermissionRequest, + x_wallet_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + x_idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=128)]], Field(description="An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Revoke a spend permission + + Revokes an existing spend permission. + + :param project_id: The ID of the CDP Project. (required) + :type project_id: str + :param user_id: The ID of the end user. (required) + :type user_id: str + :param address: The address of the Smart account this spend permission is valid for. (required) + :type address: str + :param revoke_spend_permission_request: (required) + :type revoke_spend_permission_request: RevokeSpendPermissionRequest + :param x_wallet_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_wallet_auth: str + :param x_idempotency_key: An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. + :type x_idempotency_key: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._revoke_spend_permission_with_end_user_account_serialize( + project_id=project_id, + user_id=user_id, + address=address, + revoke_spend_permission_request=revoke_spend_permission_request, + x_wallet_auth=x_wallet_auth, + x_idempotency_key=x_idempotency_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EvmUserOperation", + '400': "Error", + '401': "Error", + '404': "Error", + '500': "Error", + '502': "Error", + '503': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _revoke_spend_permission_with_end_user_account_serialize( + self, + project_id, + user_id, + address, + revoke_spend_permission_request, + x_wallet_auth, + x_idempotency_key, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params['projectId'] = project_id + if user_id is not None: + _path_params['userId'] = user_id + if address is not None: + _path_params['address'] = address + # process the query parameters + # process the header parameters + if x_wallet_auth is not None: + _header_params['X-Wallet-Auth'] = x_wallet_auth + if x_idempotency_key is not None: + _header_params['X-Idempotency-Key'] = x_idempotency_key + # process the form parameters + # process the body parameter + if revoke_spend_permission_request is not None: + _body_params = revoke_spend_permission_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'endUserAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/embedded-wallet-api/projects/{projectId}/end-users/{userId}/evm/smart-accounts/{address}/spend-permissions/revoke', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def send_evm_asset_with_end_user_account( + self, + project_id: Annotated[str, Field(strict=True, description="The ID of the CDP Project.")], + user_id: Annotated[str, Field(strict=True, description="The ID of the end user.")], + address: Annotated[Any, Field(description="The 0x-prefixed address of the EVM account (EOA or Smart Account) to send USDC from. The address does not need to be checksummed.")], + asset: Annotated[StrictStr, Field(description="The asset to send. Currently only \"usdc\" is supported.")], + x_wallet_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + x_idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=128)]], Field(description="An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. ")] = None, + x_developer_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + send_evm_asset_with_end_user_account_request: Optional[SendEvmAssetWithEndUserAccountRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SendEvmAssetWithEndUserAccount200Response: + """Send USDC on EVM + + Sends USDC from an end user's EVM account (EOA or Smart Account) to a recipient address on a supported EVM network. This endpoint simplifies USDC transfers by automatically handling contract resolution, decimal conversion, gas estimation, and transaction encoding. The `amount` field accepts human-readable amounts as decimal strings (e.g., \"1.5\", \"25.50\"). + + :param project_id: The ID of the CDP Project. (required) + :type project_id: str + :param user_id: The ID of the end user. (required) + :type user_id: str + :param address: The 0x-prefixed address of the EVM account (EOA or Smart Account) to send USDC from. The address does not need to be checksummed. (required) + :type address: str + :param asset: The asset to send. Currently only \"usdc\" is supported. (required) + :type asset: str + :param x_wallet_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_wallet_auth: str + :param x_idempotency_key: An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. + :type x_idempotency_key: str + :param x_developer_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_developer_auth: str + :param send_evm_asset_with_end_user_account_request: + :type send_evm_asset_with_end_user_account_request: SendEvmAssetWithEndUserAccountRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._send_evm_asset_with_end_user_account_serialize( + project_id=project_id, + user_id=user_id, + address=address, + asset=asset, + x_wallet_auth=x_wallet_auth, + x_idempotency_key=x_idempotency_key, + x_developer_auth=x_developer_auth, + send_evm_asset_with_end_user_account_request=send_evm_asset_with_end_user_account_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SendEvmAssetWithEndUserAccount200Response", + '400': "Error", + '401': "Error", + '402': "Error", + '404': "Error", + '422': "Error", + '500': "Error", + '502': "Error", + '503': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def send_evm_asset_with_end_user_account_with_http_info( + self, + project_id: Annotated[str, Field(strict=True, description="The ID of the CDP Project.")], + user_id: Annotated[str, Field(strict=True, description="The ID of the end user.")], + address: Annotated[Any, Field(description="The 0x-prefixed address of the EVM account (EOA or Smart Account) to send USDC from. The address does not need to be checksummed.")], + asset: Annotated[StrictStr, Field(description="The asset to send. Currently only \"usdc\" is supported.")], + x_wallet_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + x_idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=128)]], Field(description="An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. ")] = None, + x_developer_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + send_evm_asset_with_end_user_account_request: Optional[SendEvmAssetWithEndUserAccountRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SendEvmAssetWithEndUserAccount200Response]: + """Send USDC on EVM + + Sends USDC from an end user's EVM account (EOA or Smart Account) to a recipient address on a supported EVM network. This endpoint simplifies USDC transfers by automatically handling contract resolution, decimal conversion, gas estimation, and transaction encoding. The `amount` field accepts human-readable amounts as decimal strings (e.g., \"1.5\", \"25.50\"). + + :param project_id: The ID of the CDP Project. (required) + :type project_id: str + :param user_id: The ID of the end user. (required) + :type user_id: str + :param address: The 0x-prefixed address of the EVM account (EOA or Smart Account) to send USDC from. The address does not need to be checksummed. (required) + :type address: str + :param asset: The asset to send. Currently only \"usdc\" is supported. (required) + :type asset: str + :param x_wallet_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_wallet_auth: str + :param x_idempotency_key: An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. + :type x_idempotency_key: str + :param x_developer_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_developer_auth: str + :param send_evm_asset_with_end_user_account_request: + :type send_evm_asset_with_end_user_account_request: SendEvmAssetWithEndUserAccountRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._send_evm_asset_with_end_user_account_serialize( + project_id=project_id, + user_id=user_id, + address=address, + asset=asset, + x_wallet_auth=x_wallet_auth, + x_idempotency_key=x_idempotency_key, + x_developer_auth=x_developer_auth, + send_evm_asset_with_end_user_account_request=send_evm_asset_with_end_user_account_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SendEvmAssetWithEndUserAccount200Response", + '400': "Error", + '401': "Error", + '402': "Error", + '404': "Error", + '422': "Error", + '500': "Error", + '502': "Error", + '503': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def send_evm_asset_with_end_user_account_without_preload_content( + self, + project_id: Annotated[str, Field(strict=True, description="The ID of the CDP Project.")], + user_id: Annotated[str, Field(strict=True, description="The ID of the end user.")], + address: Annotated[Any, Field(description="The 0x-prefixed address of the EVM account (EOA or Smart Account) to send USDC from. The address does not need to be checksummed.")], + asset: Annotated[StrictStr, Field(description="The asset to send. Currently only \"usdc\" is supported.")], + x_wallet_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + x_idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=128)]], Field(description="An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. ")] = None, + x_developer_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + send_evm_asset_with_end_user_account_request: Optional[SendEvmAssetWithEndUserAccountRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Send USDC on EVM + + Sends USDC from an end user's EVM account (EOA or Smart Account) to a recipient address on a supported EVM network. This endpoint simplifies USDC transfers by automatically handling contract resolution, decimal conversion, gas estimation, and transaction encoding. The `amount` field accepts human-readable amounts as decimal strings (e.g., \"1.5\", \"25.50\"). + + :param project_id: The ID of the CDP Project. (required) + :type project_id: str + :param user_id: The ID of the end user. (required) + :type user_id: str + :param address: The 0x-prefixed address of the EVM account (EOA or Smart Account) to send USDC from. The address does not need to be checksummed. (required) + :type address: str + :param asset: The asset to send. Currently only \"usdc\" is supported. (required) + :type asset: str + :param x_wallet_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_wallet_auth: str + :param x_idempotency_key: An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. + :type x_idempotency_key: str + :param x_developer_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_developer_auth: str + :param send_evm_asset_with_end_user_account_request: + :type send_evm_asset_with_end_user_account_request: SendEvmAssetWithEndUserAccountRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._send_evm_asset_with_end_user_account_serialize( + project_id=project_id, + user_id=user_id, + address=address, + asset=asset, + x_wallet_auth=x_wallet_auth, + x_idempotency_key=x_idempotency_key, + x_developer_auth=x_developer_auth, + send_evm_asset_with_end_user_account_request=send_evm_asset_with_end_user_account_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SendEvmAssetWithEndUserAccount200Response", + '400': "Error", + '401': "Error", + '402': "Error", + '404': "Error", + '422': "Error", + '500': "Error", + '502': "Error", + '503': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _send_evm_asset_with_end_user_account_serialize( + self, + project_id, + user_id, + address, + asset, + x_wallet_auth, + x_idempotency_key, + x_developer_auth, + send_evm_asset_with_end_user_account_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params['projectId'] = project_id + if user_id is not None: + _path_params['userId'] = user_id + if address is not None: + _path_params['address'] = address + if asset is not None: + _path_params['asset'] = asset + # process the query parameters + # process the header parameters + if x_wallet_auth is not None: + _header_params['X-Wallet-Auth'] = x_wallet_auth + if x_idempotency_key is not None: + _header_params['X-Idempotency-Key'] = x_idempotency_key + if x_developer_auth is not None: + _header_params['X-Developer-Auth'] = x_developer_auth + # process the form parameters + # process the body parameter + if send_evm_asset_with_end_user_account_request is not None: + _body_params = send_evm_asset_with_end_user_account_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'apiKeyAuth', + 'endUserAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/embedded-wallet-api/projects/{projectId}/end-users/{userId}/evm/{address}/send/{asset}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def send_evm_transaction_with_end_user_account( + self, + project_id: Annotated[str, Field(strict=True, description="The ID of the CDP Project.")], + user_id: Annotated[str, Field(strict=True, description="The ID of the end user.")], + x_wallet_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + x_idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=128)]], Field(description="An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. ")] = None, + x_developer_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + send_evm_transaction_with_end_user_account_request: Optional[SendEvmTransactionWithEndUserAccountRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SendEvmTransactionWithEndUserAccount200Response: + """Send a transaction with end user EVM account + + Signs a transaction with the given end user EVM account and sends it to the indicated supported network. This API handles nonce management and gas estimation, leaving the developer to provide only the minimal set of fields necessary to send the transaction. The transaction should be serialized as a hex string using [RLP](https://ethereum.org/en/developers/docs/data-structures-and-encoding/rlp/). The transaction must be an [EIP-1559 dynamic fee transaction](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1559.md). **Transaction fields and API behavior** - `to` *(Required)*: The address of the contract or account to send the transaction to. - `chainId` *(Ignored)*: The value of the `chainId` field in the transaction is ignored. The transaction will be sent to the network indicated by the `network` field in the request body. - `nonce` *(Optional)*: The nonce to use for the transaction. If not provided, the API will assign a nonce to the transaction based on the current state of the account. - `maxPriorityFeePerGas` *(Optional)*: The maximum priority fee per gas to use for the transaction. If not provided, the API will estimate a value based on current network conditions. - `maxFeePerGas` *(Optional)*: The maximum fee per gas to use for the transaction. If not provided, the API will estimate a value based on current network conditions. - `gasLimit` *(Optional)*: The gas limit to use for the transaction. If not provided, the API will estimate a value based on the `to` and `data` fields of the transaction. - `value` *(Optional)*: The amount of ETH, in wei, to send with the transaction. - `data` *(Optional)*: The data to send with the transaction; only used for contract calls. - `accessList` *(Optional)*: The access list to use for the transaction. + + :param project_id: The ID of the CDP Project. (required) + :type project_id: str + :param user_id: The ID of the end user. (required) + :type user_id: str + :param x_wallet_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_wallet_auth: str + :param x_idempotency_key: An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. + :type x_idempotency_key: str + :param x_developer_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_developer_auth: str + :param send_evm_transaction_with_end_user_account_request: + :type send_evm_transaction_with_end_user_account_request: SendEvmTransactionWithEndUserAccountRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._send_evm_transaction_with_end_user_account_serialize( + project_id=project_id, + user_id=user_id, + x_wallet_auth=x_wallet_auth, + x_idempotency_key=x_idempotency_key, + x_developer_auth=x_developer_auth, + send_evm_transaction_with_end_user_account_request=send_evm_transaction_with_end_user_account_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SendEvmTransactionWithEndUserAccount200Response", + '400': "Error", + '401': "Error", + '402': "Error", + '403': "Error", + '404': "Error", + '409': "Error", + '422': "Error", + '500': "Error", + '502': "Error", + '503': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def send_evm_transaction_with_end_user_account_with_http_info( + self, + project_id: Annotated[str, Field(strict=True, description="The ID of the CDP Project.")], + user_id: Annotated[str, Field(strict=True, description="The ID of the end user.")], + x_wallet_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + x_idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=128)]], Field(description="An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. ")] = None, + x_developer_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + send_evm_transaction_with_end_user_account_request: Optional[SendEvmTransactionWithEndUserAccountRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SendEvmTransactionWithEndUserAccount200Response]: + """Send a transaction with end user EVM account + + Signs a transaction with the given end user EVM account and sends it to the indicated supported network. This API handles nonce management and gas estimation, leaving the developer to provide only the minimal set of fields necessary to send the transaction. The transaction should be serialized as a hex string using [RLP](https://ethereum.org/en/developers/docs/data-structures-and-encoding/rlp/). The transaction must be an [EIP-1559 dynamic fee transaction](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1559.md). **Transaction fields and API behavior** - `to` *(Required)*: The address of the contract or account to send the transaction to. - `chainId` *(Ignored)*: The value of the `chainId` field in the transaction is ignored. The transaction will be sent to the network indicated by the `network` field in the request body. - `nonce` *(Optional)*: The nonce to use for the transaction. If not provided, the API will assign a nonce to the transaction based on the current state of the account. - `maxPriorityFeePerGas` *(Optional)*: The maximum priority fee per gas to use for the transaction. If not provided, the API will estimate a value based on current network conditions. - `maxFeePerGas` *(Optional)*: The maximum fee per gas to use for the transaction. If not provided, the API will estimate a value based on current network conditions. - `gasLimit` *(Optional)*: The gas limit to use for the transaction. If not provided, the API will estimate a value based on the `to` and `data` fields of the transaction. - `value` *(Optional)*: The amount of ETH, in wei, to send with the transaction. - `data` *(Optional)*: The data to send with the transaction; only used for contract calls. - `accessList` *(Optional)*: The access list to use for the transaction. + + :param project_id: The ID of the CDP Project. (required) + :type project_id: str + :param user_id: The ID of the end user. (required) + :type user_id: str + :param x_wallet_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_wallet_auth: str + :param x_idempotency_key: An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. + :type x_idempotency_key: str + :param x_developer_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_developer_auth: str + :param send_evm_transaction_with_end_user_account_request: + :type send_evm_transaction_with_end_user_account_request: SendEvmTransactionWithEndUserAccountRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._send_evm_transaction_with_end_user_account_serialize( + project_id=project_id, + user_id=user_id, + x_wallet_auth=x_wallet_auth, + x_idempotency_key=x_idempotency_key, + x_developer_auth=x_developer_auth, + send_evm_transaction_with_end_user_account_request=send_evm_transaction_with_end_user_account_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SendEvmTransactionWithEndUserAccount200Response", + '400': "Error", + '401': "Error", + '402': "Error", + '403': "Error", + '404': "Error", + '409': "Error", + '422': "Error", + '500': "Error", + '502': "Error", + '503': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def send_evm_transaction_with_end_user_account_without_preload_content( + self, + project_id: Annotated[str, Field(strict=True, description="The ID of the CDP Project.")], + user_id: Annotated[str, Field(strict=True, description="The ID of the end user.")], + x_wallet_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + x_idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=128)]], Field(description="An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. ")] = None, + x_developer_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + send_evm_transaction_with_end_user_account_request: Optional[SendEvmTransactionWithEndUserAccountRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Send a transaction with end user EVM account + + Signs a transaction with the given end user EVM account and sends it to the indicated supported network. This API handles nonce management and gas estimation, leaving the developer to provide only the minimal set of fields necessary to send the transaction. The transaction should be serialized as a hex string using [RLP](https://ethereum.org/en/developers/docs/data-structures-and-encoding/rlp/). The transaction must be an [EIP-1559 dynamic fee transaction](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1559.md). **Transaction fields and API behavior** - `to` *(Required)*: The address of the contract or account to send the transaction to. - `chainId` *(Ignored)*: The value of the `chainId` field in the transaction is ignored. The transaction will be sent to the network indicated by the `network` field in the request body. - `nonce` *(Optional)*: The nonce to use for the transaction. If not provided, the API will assign a nonce to the transaction based on the current state of the account. - `maxPriorityFeePerGas` *(Optional)*: The maximum priority fee per gas to use for the transaction. If not provided, the API will estimate a value based on current network conditions. - `maxFeePerGas` *(Optional)*: The maximum fee per gas to use for the transaction. If not provided, the API will estimate a value based on current network conditions. - `gasLimit` *(Optional)*: The gas limit to use for the transaction. If not provided, the API will estimate a value based on the `to` and `data` fields of the transaction. - `value` *(Optional)*: The amount of ETH, in wei, to send with the transaction. - `data` *(Optional)*: The data to send with the transaction; only used for contract calls. - `accessList` *(Optional)*: The access list to use for the transaction. + + :param project_id: The ID of the CDP Project. (required) + :type project_id: str + :param user_id: The ID of the end user. (required) + :type user_id: str + :param x_wallet_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_wallet_auth: str + :param x_idempotency_key: An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. + :type x_idempotency_key: str + :param x_developer_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_developer_auth: str + :param send_evm_transaction_with_end_user_account_request: + :type send_evm_transaction_with_end_user_account_request: SendEvmTransactionWithEndUserAccountRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._send_evm_transaction_with_end_user_account_serialize( + project_id=project_id, + user_id=user_id, + x_wallet_auth=x_wallet_auth, + x_idempotency_key=x_idempotency_key, + x_developer_auth=x_developer_auth, + send_evm_transaction_with_end_user_account_request=send_evm_transaction_with_end_user_account_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SendEvmTransactionWithEndUserAccount200Response", + '400': "Error", + '401': "Error", + '402': "Error", + '403': "Error", + '404': "Error", + '409': "Error", + '422': "Error", + '500': "Error", + '502': "Error", + '503': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _send_evm_transaction_with_end_user_account_serialize( + self, + project_id, + user_id, + x_wallet_auth, + x_idempotency_key, + x_developer_auth, + send_evm_transaction_with_end_user_account_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params['projectId'] = project_id + if user_id is not None: + _path_params['userId'] = user_id + # process the query parameters + # process the header parameters + if x_wallet_auth is not None: + _header_params['X-Wallet-Auth'] = x_wallet_auth + if x_idempotency_key is not None: + _header_params['X-Idempotency-Key'] = x_idempotency_key + if x_developer_auth is not None: + _header_params['X-Developer-Auth'] = x_developer_auth + # process the form parameters + # process the body parameter + if send_evm_transaction_with_end_user_account_request is not None: + _body_params = send_evm_transaction_with_end_user_account_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'apiKeyAuth', + 'endUserAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/embedded-wallet-api/projects/{projectId}/end-users/{userId}/evm/send/transaction', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def send_solana_asset_with_end_user_account( + self, + project_id: Annotated[str, Field(strict=True, description="The ID of the CDP Project.")], + user_id: Annotated[str, Field(strict=True, description="The ID of the end user.")], + address: Annotated[Any, Field(description="The base58 encoded address of the Solana account to send USDC from.")], + asset: Annotated[StrictStr, Field(description="The asset to send. Currently only \"usdc\" is supported.")], + x_wallet_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + x_idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=128)]], Field(description="An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. ")] = None, + x_developer_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + send_solana_asset_with_end_user_account_request: Optional[SendSolanaAssetWithEndUserAccountRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SendSolanaTransactionWithEndUserAccount200Response: + """Send USDC on Solana + + Sends USDC from an end user's Solana account to a recipient address on the Solana network. This endpoint simplifies USDC transfers by automatically handling mint resolution, Associated Token Account (ATA) creation, decimal conversion, and transaction encoding. The `amount` field accepts human-readable amounts as decimal strings (e.g., \"1.5\", \"25.50\"). Use the optional `createRecipientAta` parameter to control whether the sender pays for creating the recipient's Associated Token Account if it doesn't exist. + + :param project_id: The ID of the CDP Project. (required) + :type project_id: str + :param user_id: The ID of the end user. (required) + :type user_id: str + :param address: The base58 encoded address of the Solana account to send USDC from. (required) + :type address: str + :param asset: The asset to send. Currently only \"usdc\" is supported. (required) + :type asset: str + :param x_wallet_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_wallet_auth: str + :param x_idempotency_key: An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. + :type x_idempotency_key: str + :param x_developer_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_developer_auth: str + :param send_solana_asset_with_end_user_account_request: + :type send_solana_asset_with_end_user_account_request: SendSolanaAssetWithEndUserAccountRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._send_solana_asset_with_end_user_account_serialize( + project_id=project_id, + user_id=user_id, + address=address, + asset=asset, + x_wallet_auth=x_wallet_auth, + x_idempotency_key=x_idempotency_key, + x_developer_auth=x_developer_auth, + send_solana_asset_with_end_user_account_request=send_solana_asset_with_end_user_account_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SendSolanaTransactionWithEndUserAccount200Response", + '400': "Error", + '401': "Error", + '402': "Error", + '404': "Error", + '422': "Error", + '500': "Error", + '502': "Error", + '503': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def send_solana_asset_with_end_user_account_with_http_info( + self, + project_id: Annotated[str, Field(strict=True, description="The ID of the CDP Project.")], + user_id: Annotated[str, Field(strict=True, description="The ID of the end user.")], + address: Annotated[Any, Field(description="The base58 encoded address of the Solana account to send USDC from.")], + asset: Annotated[StrictStr, Field(description="The asset to send. Currently only \"usdc\" is supported.")], + x_wallet_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + x_idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=128)]], Field(description="An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. ")] = None, + x_developer_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + send_solana_asset_with_end_user_account_request: Optional[SendSolanaAssetWithEndUserAccountRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SendSolanaTransactionWithEndUserAccount200Response]: + """Send USDC on Solana + + Sends USDC from an end user's Solana account to a recipient address on the Solana network. This endpoint simplifies USDC transfers by automatically handling mint resolution, Associated Token Account (ATA) creation, decimal conversion, and transaction encoding. The `amount` field accepts human-readable amounts as decimal strings (e.g., \"1.5\", \"25.50\"). Use the optional `createRecipientAta` parameter to control whether the sender pays for creating the recipient's Associated Token Account if it doesn't exist. + + :param project_id: The ID of the CDP Project. (required) + :type project_id: str + :param user_id: The ID of the end user. (required) + :type user_id: str + :param address: The base58 encoded address of the Solana account to send USDC from. (required) + :type address: str + :param asset: The asset to send. Currently only \"usdc\" is supported. (required) + :type asset: str + :param x_wallet_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_wallet_auth: str + :param x_idempotency_key: An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. + :type x_idempotency_key: str + :param x_developer_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_developer_auth: str + :param send_solana_asset_with_end_user_account_request: + :type send_solana_asset_with_end_user_account_request: SendSolanaAssetWithEndUserAccountRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._send_solana_asset_with_end_user_account_serialize( + project_id=project_id, + user_id=user_id, + address=address, + asset=asset, + x_wallet_auth=x_wallet_auth, + x_idempotency_key=x_idempotency_key, + x_developer_auth=x_developer_auth, + send_solana_asset_with_end_user_account_request=send_solana_asset_with_end_user_account_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SendSolanaTransactionWithEndUserAccount200Response", + '400': "Error", + '401': "Error", + '402': "Error", + '404': "Error", + '422': "Error", + '500': "Error", + '502': "Error", + '503': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def send_solana_asset_with_end_user_account_without_preload_content( + self, + project_id: Annotated[str, Field(strict=True, description="The ID of the CDP Project.")], + user_id: Annotated[str, Field(strict=True, description="The ID of the end user.")], + address: Annotated[Any, Field(description="The base58 encoded address of the Solana account to send USDC from.")], + asset: Annotated[StrictStr, Field(description="The asset to send. Currently only \"usdc\" is supported.")], + x_wallet_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + x_idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=128)]], Field(description="An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. ")] = None, + x_developer_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + send_solana_asset_with_end_user_account_request: Optional[SendSolanaAssetWithEndUserAccountRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Send USDC on Solana + + Sends USDC from an end user's Solana account to a recipient address on the Solana network. This endpoint simplifies USDC transfers by automatically handling mint resolution, Associated Token Account (ATA) creation, decimal conversion, and transaction encoding. The `amount` field accepts human-readable amounts as decimal strings (e.g., \"1.5\", \"25.50\"). Use the optional `createRecipientAta` parameter to control whether the sender pays for creating the recipient's Associated Token Account if it doesn't exist. + + :param project_id: The ID of the CDP Project. (required) + :type project_id: str + :param user_id: The ID of the end user. (required) + :type user_id: str + :param address: The base58 encoded address of the Solana account to send USDC from. (required) + :type address: str + :param asset: The asset to send. Currently only \"usdc\" is supported. (required) + :type asset: str + :param x_wallet_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_wallet_auth: str + :param x_idempotency_key: An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. + :type x_idempotency_key: str + :param x_developer_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_developer_auth: str + :param send_solana_asset_with_end_user_account_request: + :type send_solana_asset_with_end_user_account_request: SendSolanaAssetWithEndUserAccountRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._send_solana_asset_with_end_user_account_serialize( + project_id=project_id, + user_id=user_id, + address=address, + asset=asset, + x_wallet_auth=x_wallet_auth, + x_idempotency_key=x_idempotency_key, + x_developer_auth=x_developer_auth, + send_solana_asset_with_end_user_account_request=send_solana_asset_with_end_user_account_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SendSolanaTransactionWithEndUserAccount200Response", + '400': "Error", + '401': "Error", + '402': "Error", + '404': "Error", + '422': "Error", + '500': "Error", + '502': "Error", + '503': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _send_solana_asset_with_end_user_account_serialize( + self, + project_id, + user_id, + address, + asset, + x_wallet_auth, + x_idempotency_key, + x_developer_auth, + send_solana_asset_with_end_user_account_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params['projectId'] = project_id + if user_id is not None: + _path_params['userId'] = user_id + if address is not None: + _path_params['address'] = address + if asset is not None: + _path_params['asset'] = asset + # process the query parameters + # process the header parameters + if x_wallet_auth is not None: + _header_params['X-Wallet-Auth'] = x_wallet_auth + if x_idempotency_key is not None: + _header_params['X-Idempotency-Key'] = x_idempotency_key + if x_developer_auth is not None: + _header_params['X-Developer-Auth'] = x_developer_auth + # process the form parameters + # process the body parameter + if send_solana_asset_with_end_user_account_request is not None: + _body_params = send_solana_asset_with_end_user_account_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'apiKeyAuth', + 'endUserAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/embedded-wallet-api/projects/{projectId}/end-users/{userId}/solana/{address}/send/{asset}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def send_solana_transaction_with_end_user_account( + self, + project_id: Annotated[str, Field(strict=True, description="The ID of the CDP Project.")], + user_id: Annotated[str, Field(strict=True, description="The ID of the end user.")], + x_wallet_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + x_idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=128)]], Field(description="An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. ")] = None, + x_developer_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + send_solana_transaction_with_end_user_account_request: Optional[SendSolanaTransactionWithEndUserAccountRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SendSolanaTransactionWithEndUserAccount200Response: + """Send a transaction with end user Solana account + + Signs a transaction with the given end user Solana account and sends it to the indicated supported network. The API handles recent blockhash management and fee estimation, leaving the developer to provide only the minimal set of fields necessary to send the transaction. The unsigned transaction should be serialized into a byte array and then encoded as base64. **Transaction types** The following transaction types are supported: * [Legacy transactions](https://solana.com/developers/guides/advanced/versions#current-transaction-versions) * [Versioned transactions](https://solana.com/developers/guides/advanced/versions) **Instruction Batching** To batch multiple operations, include multiple instructions within a single transaction. All instructions within a transaction are executed atomically - if any instruction fails, the entire transaction fails and is rolled back. **Network Support** The following Solana networks are supported: * `solana` - Solana Mainnet * `solana-devnet` - Solana Devnet The developer is responsible for ensuring that the unsigned transaction is valid, as the API will not validate the transaction. + + :param project_id: The ID of the CDP Project. (required) + :type project_id: str + :param user_id: The ID of the end user. (required) + :type user_id: str + :param x_wallet_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_wallet_auth: str + :param x_idempotency_key: An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. + :type x_idempotency_key: str + :param x_developer_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_developer_auth: str + :param send_solana_transaction_with_end_user_account_request: + :type send_solana_transaction_with_end_user_account_request: SendSolanaTransactionWithEndUserAccountRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._send_solana_transaction_with_end_user_account_serialize( + project_id=project_id, + user_id=user_id, + x_wallet_auth=x_wallet_auth, + x_idempotency_key=x_idempotency_key, + x_developer_auth=x_developer_auth, + send_solana_transaction_with_end_user_account_request=send_solana_transaction_with_end_user_account_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SendSolanaTransactionWithEndUserAccount200Response", + '400': "Error", + '401': "Error", + '402': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + '500': "Error", + '502': "Error", + '503': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def send_solana_transaction_with_end_user_account_with_http_info( + self, + project_id: Annotated[str, Field(strict=True, description="The ID of the CDP Project.")], + user_id: Annotated[str, Field(strict=True, description="The ID of the end user.")], + x_wallet_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + x_idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=128)]], Field(description="An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. ")] = None, + x_developer_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + send_solana_transaction_with_end_user_account_request: Optional[SendSolanaTransactionWithEndUserAccountRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SendSolanaTransactionWithEndUserAccount200Response]: + """Send a transaction with end user Solana account + + Signs a transaction with the given end user Solana account and sends it to the indicated supported network. The API handles recent blockhash management and fee estimation, leaving the developer to provide only the minimal set of fields necessary to send the transaction. The unsigned transaction should be serialized into a byte array and then encoded as base64. **Transaction types** The following transaction types are supported: * [Legacy transactions](https://solana.com/developers/guides/advanced/versions#current-transaction-versions) * [Versioned transactions](https://solana.com/developers/guides/advanced/versions) **Instruction Batching** To batch multiple operations, include multiple instructions within a single transaction. All instructions within a transaction are executed atomically - if any instruction fails, the entire transaction fails and is rolled back. **Network Support** The following Solana networks are supported: * `solana` - Solana Mainnet * `solana-devnet` - Solana Devnet The developer is responsible for ensuring that the unsigned transaction is valid, as the API will not validate the transaction. + + :param project_id: The ID of the CDP Project. (required) + :type project_id: str + :param user_id: The ID of the end user. (required) + :type user_id: str + :param x_wallet_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_wallet_auth: str + :param x_idempotency_key: An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. + :type x_idempotency_key: str + :param x_developer_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_developer_auth: str + :param send_solana_transaction_with_end_user_account_request: + :type send_solana_transaction_with_end_user_account_request: SendSolanaTransactionWithEndUserAccountRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._send_solana_transaction_with_end_user_account_serialize( + project_id=project_id, + user_id=user_id, + x_wallet_auth=x_wallet_auth, + x_idempotency_key=x_idempotency_key, + x_developer_auth=x_developer_auth, + send_solana_transaction_with_end_user_account_request=send_solana_transaction_with_end_user_account_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SendSolanaTransactionWithEndUserAccount200Response", + '400': "Error", + '401': "Error", + '402': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + '500': "Error", + '502': "Error", + '503': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def send_solana_transaction_with_end_user_account_without_preload_content( + self, + project_id: Annotated[str, Field(strict=True, description="The ID of the CDP Project.")], + user_id: Annotated[str, Field(strict=True, description="The ID of the end user.")], + x_wallet_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + x_idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=128)]], Field(description="An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. ")] = None, + x_developer_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + send_solana_transaction_with_end_user_account_request: Optional[SendSolanaTransactionWithEndUserAccountRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Send a transaction with end user Solana account + + Signs a transaction with the given end user Solana account and sends it to the indicated supported network. The API handles recent blockhash management and fee estimation, leaving the developer to provide only the minimal set of fields necessary to send the transaction. The unsigned transaction should be serialized into a byte array and then encoded as base64. **Transaction types** The following transaction types are supported: * [Legacy transactions](https://solana.com/developers/guides/advanced/versions#current-transaction-versions) * [Versioned transactions](https://solana.com/developers/guides/advanced/versions) **Instruction Batching** To batch multiple operations, include multiple instructions within a single transaction. All instructions within a transaction are executed atomically - if any instruction fails, the entire transaction fails and is rolled back. **Network Support** The following Solana networks are supported: * `solana` - Solana Mainnet * `solana-devnet` - Solana Devnet The developer is responsible for ensuring that the unsigned transaction is valid, as the API will not validate the transaction. + + :param project_id: The ID of the CDP Project. (required) + :type project_id: str + :param user_id: The ID of the end user. (required) + :type user_id: str + :param x_wallet_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_wallet_auth: str + :param x_idempotency_key: An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. + :type x_idempotency_key: str + :param x_developer_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_developer_auth: str + :param send_solana_transaction_with_end_user_account_request: + :type send_solana_transaction_with_end_user_account_request: SendSolanaTransactionWithEndUserAccountRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._send_solana_transaction_with_end_user_account_serialize( + project_id=project_id, + user_id=user_id, + x_wallet_auth=x_wallet_auth, + x_idempotency_key=x_idempotency_key, + x_developer_auth=x_developer_auth, + send_solana_transaction_with_end_user_account_request=send_solana_transaction_with_end_user_account_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SendSolanaTransactionWithEndUserAccount200Response", + '400': "Error", + '401': "Error", + '402': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + '500': "Error", + '502': "Error", + '503': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _send_solana_transaction_with_end_user_account_serialize( + self, + project_id, + user_id, + x_wallet_auth, + x_idempotency_key, + x_developer_auth, + send_solana_transaction_with_end_user_account_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params['projectId'] = project_id + if user_id is not None: + _path_params['userId'] = user_id + # process the query parameters + # process the header parameters + if x_wallet_auth is not None: + _header_params['X-Wallet-Auth'] = x_wallet_auth + if x_idempotency_key is not None: + _header_params['X-Idempotency-Key'] = x_idempotency_key + if x_developer_auth is not None: + _header_params['X-Developer-Auth'] = x_developer_auth + # process the form parameters + # process the body parameter + if send_solana_transaction_with_end_user_account_request is not None: + _body_params = send_solana_transaction_with_end_user_account_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'apiKeyAuth', + 'endUserAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/embedded-wallet-api/projects/{projectId}/end-users/{userId}/solana/send/transaction', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def send_user_operation_with_end_user_account( + self, + project_id: Annotated[str, Field(strict=True, description="The ID of the CDP Project.")], + user_id: Annotated[str, Field(strict=True, description="The ID of the end user.")], + address: Annotated[str, Field(strict=True, description="The address of the EVM Smart Account to execute the user operation from.")], + x_idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=128)]], Field(description="An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. ")] = None, + x_wallet_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + x_developer_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + send_user_operation_with_end_user_account_request: Optional[SendUserOperationWithEndUserAccountRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> EvmUserOperation: + """Send a user operation for end user Smart Account + + Prepares, signs, and sends a user operation for an end user's Smart Account. + + :param project_id: The ID of the CDP Project. (required) + :type project_id: str + :param user_id: The ID of the end user. (required) + :type user_id: str + :param address: The address of the EVM Smart Account to execute the user operation from. (required) + :type address: str + :param x_idempotency_key: An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. + :type x_idempotency_key: str + :param x_wallet_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_wallet_auth: str + :param x_developer_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_developer_auth: str + :param send_user_operation_with_end_user_account_request: + :type send_user_operation_with_end_user_account_request: SendUserOperationWithEndUserAccountRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._send_user_operation_with_end_user_account_serialize( + project_id=project_id, + user_id=user_id, + address=address, + x_idempotency_key=x_idempotency_key, + x_wallet_auth=x_wallet_auth, + x_developer_auth=x_developer_auth, + send_user_operation_with_end_user_account_request=send_user_operation_with_end_user_account_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EvmUserOperation", + '400': "Error", + '401': "Error", + '402': "Error", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + '503': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def send_user_operation_with_end_user_account_with_http_info( + self, + project_id: Annotated[str, Field(strict=True, description="The ID of the CDP Project.")], + user_id: Annotated[str, Field(strict=True, description="The ID of the end user.")], + address: Annotated[str, Field(strict=True, description="The address of the EVM Smart Account to execute the user operation from.")], + x_idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=128)]], Field(description="An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. ")] = None, + x_wallet_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + x_developer_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + send_user_operation_with_end_user_account_request: Optional[SendUserOperationWithEndUserAccountRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[EvmUserOperation]: + """Send a user operation for end user Smart Account + + Prepares, signs, and sends a user operation for an end user's Smart Account. + + :param project_id: The ID of the CDP Project. (required) + :type project_id: str + :param user_id: The ID of the end user. (required) + :type user_id: str + :param address: The address of the EVM Smart Account to execute the user operation from. (required) + :type address: str + :param x_idempotency_key: An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. + :type x_idempotency_key: str + :param x_wallet_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_wallet_auth: str + :param x_developer_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_developer_auth: str + :param send_user_operation_with_end_user_account_request: + :type send_user_operation_with_end_user_account_request: SendUserOperationWithEndUserAccountRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._send_user_operation_with_end_user_account_serialize( + project_id=project_id, + user_id=user_id, + address=address, + x_idempotency_key=x_idempotency_key, + x_wallet_auth=x_wallet_auth, + x_developer_auth=x_developer_auth, + send_user_operation_with_end_user_account_request=send_user_operation_with_end_user_account_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EvmUserOperation", + '400': "Error", + '401': "Error", + '402': "Error", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + '503': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def send_user_operation_with_end_user_account_without_preload_content( + self, + project_id: Annotated[str, Field(strict=True, description="The ID of the CDP Project.")], + user_id: Annotated[str, Field(strict=True, description="The ID of the end user.")], + address: Annotated[str, Field(strict=True, description="The address of the EVM Smart Account to execute the user operation from.")], + x_idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=128)]], Field(description="An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. ")] = None, + x_wallet_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + x_developer_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + send_user_operation_with_end_user_account_request: Optional[SendUserOperationWithEndUserAccountRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Send a user operation for end user Smart Account + + Prepares, signs, and sends a user operation for an end user's Smart Account. + + :param project_id: The ID of the CDP Project. (required) + :type project_id: str + :param user_id: The ID of the end user. (required) + :type user_id: str + :param address: The address of the EVM Smart Account to execute the user operation from. (required) + :type address: str + :param x_idempotency_key: An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. + :type x_idempotency_key: str + :param x_wallet_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_wallet_auth: str + :param x_developer_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_developer_auth: str + :param send_user_operation_with_end_user_account_request: + :type send_user_operation_with_end_user_account_request: SendUserOperationWithEndUserAccountRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._send_user_operation_with_end_user_account_serialize( + project_id=project_id, + user_id=user_id, + address=address, + x_idempotency_key=x_idempotency_key, + x_wallet_auth=x_wallet_auth, + x_developer_auth=x_developer_auth, + send_user_operation_with_end_user_account_request=send_user_operation_with_end_user_account_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EvmUserOperation", + '400': "Error", + '401': "Error", + '402': "Error", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + '503': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _send_user_operation_with_end_user_account_serialize( + self, + project_id, + user_id, + address, + x_idempotency_key, + x_wallet_auth, + x_developer_auth, + send_user_operation_with_end_user_account_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params['projectId'] = project_id + if user_id is not None: + _path_params['userId'] = user_id + if address is not None: + _path_params['address'] = address + # process the query parameters + # process the header parameters + if x_idempotency_key is not None: + _header_params['X-Idempotency-Key'] = x_idempotency_key + if x_wallet_auth is not None: + _header_params['X-Wallet-Auth'] = x_wallet_auth + if x_developer_auth is not None: + _header_params['X-Developer-Auth'] = x_developer_auth + # process the form parameters + # process the body parameter + if send_user_operation_with_end_user_account_request is not None: + _body_params = send_user_operation_with_end_user_account_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'endUserAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/embedded-wallet-api/projects/{projectId}/end-users/{userId}/evm/smart-accounts/{address}/send', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def sign_evm_hash_with_end_user_account( + self, + project_id: Annotated[str, Field(strict=True, description="The ID of the CDP Project.")], + user_id: Annotated[str, Field(strict=True, description="The ID of the end user.")], + x_wallet_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + x_idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=128)]], Field(description="An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. ")] = None, + x_developer_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + sign_evm_hash_with_end_user_account_request: Optional[SignEvmHashWithEndUserAccountRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SignEvmHashWithEndUserAccount200Response: + """Sign a hash with end user EVM account + + Signs an arbitrary 32 byte hash with the end user's given EVM account. + + :param project_id: The ID of the CDP Project. (required) + :type project_id: str + :param user_id: The ID of the end user. (required) + :type user_id: str + :param x_wallet_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_wallet_auth: str + :param x_idempotency_key: An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. + :type x_idempotency_key: str + :param x_developer_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_developer_auth: str + :param sign_evm_hash_with_end_user_account_request: + :type sign_evm_hash_with_end_user_account_request: SignEvmHashWithEndUserAccountRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._sign_evm_hash_with_end_user_account_serialize( + project_id=project_id, + user_id=user_id, + x_wallet_auth=x_wallet_auth, + x_idempotency_key=x_idempotency_key, + x_developer_auth=x_developer_auth, + sign_evm_hash_with_end_user_account_request=sign_evm_hash_with_end_user_account_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignEvmHashWithEndUserAccount200Response", + '400': "Error", + '401': "Error", + '402': "Error", + '404': "Error", + '409': "Error", + '422': "Error", + '500': "Error", + '502': "Error", + '503': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def sign_evm_hash_with_end_user_account_with_http_info( + self, + project_id: Annotated[str, Field(strict=True, description="The ID of the CDP Project.")], + user_id: Annotated[str, Field(strict=True, description="The ID of the end user.")], + x_wallet_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + x_idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=128)]], Field(description="An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. ")] = None, + x_developer_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + sign_evm_hash_with_end_user_account_request: Optional[SignEvmHashWithEndUserAccountRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SignEvmHashWithEndUserAccount200Response]: + """Sign a hash with end user EVM account + + Signs an arbitrary 32 byte hash with the end user's given EVM account. + + :param project_id: The ID of the CDP Project. (required) + :type project_id: str + :param user_id: The ID of the end user. (required) + :type user_id: str + :param x_wallet_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_wallet_auth: str + :param x_idempotency_key: An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. + :type x_idempotency_key: str + :param x_developer_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_developer_auth: str + :param sign_evm_hash_with_end_user_account_request: + :type sign_evm_hash_with_end_user_account_request: SignEvmHashWithEndUserAccountRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._sign_evm_hash_with_end_user_account_serialize( + project_id=project_id, + user_id=user_id, + x_wallet_auth=x_wallet_auth, + x_idempotency_key=x_idempotency_key, + x_developer_auth=x_developer_auth, + sign_evm_hash_with_end_user_account_request=sign_evm_hash_with_end_user_account_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignEvmHashWithEndUserAccount200Response", + '400': "Error", + '401': "Error", + '402': "Error", + '404': "Error", + '409': "Error", + '422': "Error", + '500': "Error", + '502': "Error", + '503': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def sign_evm_hash_with_end_user_account_without_preload_content( + self, + project_id: Annotated[str, Field(strict=True, description="The ID of the CDP Project.")], + user_id: Annotated[str, Field(strict=True, description="The ID of the end user.")], + x_wallet_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + x_idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=128)]], Field(description="An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. ")] = None, + x_developer_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + sign_evm_hash_with_end_user_account_request: Optional[SignEvmHashWithEndUserAccountRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Sign a hash with end user EVM account + + Signs an arbitrary 32 byte hash with the end user's given EVM account. + + :param project_id: The ID of the CDP Project. (required) + :type project_id: str + :param user_id: The ID of the end user. (required) + :type user_id: str + :param x_wallet_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_wallet_auth: str + :param x_idempotency_key: An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. + :type x_idempotency_key: str + :param x_developer_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_developer_auth: str + :param sign_evm_hash_with_end_user_account_request: + :type sign_evm_hash_with_end_user_account_request: SignEvmHashWithEndUserAccountRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._sign_evm_hash_with_end_user_account_serialize( + project_id=project_id, + user_id=user_id, + x_wallet_auth=x_wallet_auth, + x_idempotency_key=x_idempotency_key, + x_developer_auth=x_developer_auth, + sign_evm_hash_with_end_user_account_request=sign_evm_hash_with_end_user_account_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignEvmHashWithEndUserAccount200Response", + '400': "Error", + '401': "Error", + '402': "Error", + '404': "Error", + '409': "Error", + '422': "Error", + '500': "Error", + '502': "Error", + '503': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _sign_evm_hash_with_end_user_account_serialize( + self, + project_id, + user_id, + x_wallet_auth, + x_idempotency_key, + x_developer_auth, + sign_evm_hash_with_end_user_account_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params['projectId'] = project_id + if user_id is not None: + _path_params['userId'] = user_id + # process the query parameters + # process the header parameters + if x_wallet_auth is not None: + _header_params['X-Wallet-Auth'] = x_wallet_auth + if x_idempotency_key is not None: + _header_params['X-Idempotency-Key'] = x_idempotency_key + if x_developer_auth is not None: + _header_params['X-Developer-Auth'] = x_developer_auth + # process the form parameters + # process the body parameter + if sign_evm_hash_with_end_user_account_request is not None: + _body_params = sign_evm_hash_with_end_user_account_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'endUserAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/embedded-wallet-api/projects/{projectId}/end-users/{userId}/evm/sign', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def sign_evm_message_with_end_user_account( + self, + project_id: Annotated[str, Field(strict=True, description="The ID of the CDP Project.")], + user_id: Annotated[str, Field(strict=True, description="The ID of the end user.")], + x_wallet_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + x_idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=128)]], Field(description="An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. ")] = None, + x_developer_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + sign_evm_message_with_end_user_account_request: Optional[SignEvmMessageWithEndUserAccountRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SignEvmMessageWithEndUserAccount200Response: + """Sign an EIP-191 message with end user EVM account + + Signs an [EIP-191](https://eips.ethereum.org/EIPS/eip-191) message with the given end user EVM account. Per the specification, the message in the request body is prepended with `0x19 <0x45 (E)> ` before being signed. + + :param project_id: The ID of the CDP Project. (required) + :type project_id: str + :param user_id: The ID of the end user. (required) + :type user_id: str + :param x_wallet_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_wallet_auth: str + :param x_idempotency_key: An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. + :type x_idempotency_key: str + :param x_developer_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_developer_auth: str + :param sign_evm_message_with_end_user_account_request: + :type sign_evm_message_with_end_user_account_request: SignEvmMessageWithEndUserAccountRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._sign_evm_message_with_end_user_account_serialize( + project_id=project_id, + user_id=user_id, + x_wallet_auth=x_wallet_auth, + x_idempotency_key=x_idempotency_key, + x_developer_auth=x_developer_auth, + sign_evm_message_with_end_user_account_request=sign_evm_message_with_end_user_account_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignEvmMessageWithEndUserAccount200Response", + '401': "Error", + '402': "Error", + '404': "Error", + '409': "Error", + '422': "Error", + '500': "Error", + '502': "Error", + '503': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def sign_evm_message_with_end_user_account_with_http_info( + self, + project_id: Annotated[str, Field(strict=True, description="The ID of the CDP Project.")], + user_id: Annotated[str, Field(strict=True, description="The ID of the end user.")], + x_wallet_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + x_idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=128)]], Field(description="An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. ")] = None, + x_developer_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + sign_evm_message_with_end_user_account_request: Optional[SignEvmMessageWithEndUserAccountRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SignEvmMessageWithEndUserAccount200Response]: + """Sign an EIP-191 message with end user EVM account + + Signs an [EIP-191](https://eips.ethereum.org/EIPS/eip-191) message with the given end user EVM account. Per the specification, the message in the request body is prepended with `0x19 <0x45 (E)> ` before being signed. + + :param project_id: The ID of the CDP Project. (required) + :type project_id: str + :param user_id: The ID of the end user. (required) + :type user_id: str + :param x_wallet_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_wallet_auth: str + :param x_idempotency_key: An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. + :type x_idempotency_key: str + :param x_developer_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_developer_auth: str + :param sign_evm_message_with_end_user_account_request: + :type sign_evm_message_with_end_user_account_request: SignEvmMessageWithEndUserAccountRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._sign_evm_message_with_end_user_account_serialize( + project_id=project_id, + user_id=user_id, + x_wallet_auth=x_wallet_auth, + x_idempotency_key=x_idempotency_key, + x_developer_auth=x_developer_auth, + sign_evm_message_with_end_user_account_request=sign_evm_message_with_end_user_account_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignEvmMessageWithEndUserAccount200Response", + '401': "Error", + '402': "Error", + '404': "Error", + '409': "Error", + '422': "Error", + '500': "Error", + '502': "Error", + '503': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def sign_evm_message_with_end_user_account_without_preload_content( + self, + project_id: Annotated[str, Field(strict=True, description="The ID of the CDP Project.")], + user_id: Annotated[str, Field(strict=True, description="The ID of the end user.")], + x_wallet_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + x_idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=128)]], Field(description="An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. ")] = None, + x_developer_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + sign_evm_message_with_end_user_account_request: Optional[SignEvmMessageWithEndUserAccountRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Sign an EIP-191 message with end user EVM account + + Signs an [EIP-191](https://eips.ethereum.org/EIPS/eip-191) message with the given end user EVM account. Per the specification, the message in the request body is prepended with `0x19 <0x45 (E)> ` before being signed. + + :param project_id: The ID of the CDP Project. (required) + :type project_id: str + :param user_id: The ID of the end user. (required) + :type user_id: str + :param x_wallet_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_wallet_auth: str + :param x_idempotency_key: An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. + :type x_idempotency_key: str + :param x_developer_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_developer_auth: str + :param sign_evm_message_with_end_user_account_request: + :type sign_evm_message_with_end_user_account_request: SignEvmMessageWithEndUserAccountRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._sign_evm_message_with_end_user_account_serialize( + project_id=project_id, + user_id=user_id, + x_wallet_auth=x_wallet_auth, + x_idempotency_key=x_idempotency_key, + x_developer_auth=x_developer_auth, + sign_evm_message_with_end_user_account_request=sign_evm_message_with_end_user_account_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignEvmMessageWithEndUserAccount200Response", + '401': "Error", + '402': "Error", + '404': "Error", + '409': "Error", + '422': "Error", + '500': "Error", + '502': "Error", + '503': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _sign_evm_message_with_end_user_account_serialize( + self, + project_id, + user_id, + x_wallet_auth, + x_idempotency_key, + x_developer_auth, + sign_evm_message_with_end_user_account_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params['projectId'] = project_id + if user_id is not None: + _path_params['userId'] = user_id + # process the query parameters + # process the header parameters + if x_wallet_auth is not None: + _header_params['X-Wallet-Auth'] = x_wallet_auth + if x_idempotency_key is not None: + _header_params['X-Idempotency-Key'] = x_idempotency_key + if x_developer_auth is not None: + _header_params['X-Developer-Auth'] = x_developer_auth + # process the form parameters + # process the body parameter + if sign_evm_message_with_end_user_account_request is not None: + _body_params = sign_evm_message_with_end_user_account_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'apiKeyAuth', + 'endUserAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/embedded-wallet-api/projects/{projectId}/end-users/{userId}/evm/sign/message', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def sign_evm_transaction_with_end_user_account( + self, + project_id: Annotated[str, Field(strict=True, description="The ID of the CDP Project.")], + user_id: Annotated[str, Field(strict=True, description="The ID of the end user.")], + x_wallet_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + x_idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=128)]], Field(description="An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. ")] = None, + x_developer_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + sign_evm_transaction_with_end_user_account_request: Optional[SignEvmTransactionWithEndUserAccountRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SignEvmTransactionWithEndUserAccount200Response: + """Sign a transaction with end user EVM account + + Signs a transaction with the given end user EVM account. The transaction should be serialized as a hex string using [RLP](https://ethereum.org/en/developers/docs/data-structures-and-encoding/rlp/). The transaction must be an [EIP-1559 dynamic fee transaction](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1559.md). The developer is responsible for ensuring that the unsigned transaction is valid, as the API will not validate the transaction. + + :param project_id: The ID of the CDP Project. (required) + :type project_id: str + :param user_id: The ID of the end user. (required) + :type user_id: str + :param x_wallet_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_wallet_auth: str + :param x_idempotency_key: An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. + :type x_idempotency_key: str + :param x_developer_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_developer_auth: str + :param sign_evm_transaction_with_end_user_account_request: + :type sign_evm_transaction_with_end_user_account_request: SignEvmTransactionWithEndUserAccountRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._sign_evm_transaction_with_end_user_account_serialize( + project_id=project_id, + user_id=user_id, + x_wallet_auth=x_wallet_auth, + x_idempotency_key=x_idempotency_key, + x_developer_auth=x_developer_auth, + sign_evm_transaction_with_end_user_account_request=sign_evm_transaction_with_end_user_account_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignEvmTransactionWithEndUserAccount200Response", + '400': "Error", + '401': "Error", + '402': "Error", + '403': "Error", + '404': "Error", + '409': "Error", + '422': "Error", + '500': "Error", + '502': "Error", + '503': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def sign_evm_transaction_with_end_user_account_with_http_info( + self, + project_id: Annotated[str, Field(strict=True, description="The ID of the CDP Project.")], + user_id: Annotated[str, Field(strict=True, description="The ID of the end user.")], + x_wallet_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + x_idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=128)]], Field(description="An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. ")] = None, + x_developer_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + sign_evm_transaction_with_end_user_account_request: Optional[SignEvmTransactionWithEndUserAccountRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SignEvmTransactionWithEndUserAccount200Response]: + """Sign a transaction with end user EVM account + + Signs a transaction with the given end user EVM account. The transaction should be serialized as a hex string using [RLP](https://ethereum.org/en/developers/docs/data-structures-and-encoding/rlp/). The transaction must be an [EIP-1559 dynamic fee transaction](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1559.md). The developer is responsible for ensuring that the unsigned transaction is valid, as the API will not validate the transaction. + + :param project_id: The ID of the CDP Project. (required) + :type project_id: str + :param user_id: The ID of the end user. (required) + :type user_id: str + :param x_wallet_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_wallet_auth: str + :param x_idempotency_key: An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. + :type x_idempotency_key: str + :param x_developer_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_developer_auth: str + :param sign_evm_transaction_with_end_user_account_request: + :type sign_evm_transaction_with_end_user_account_request: SignEvmTransactionWithEndUserAccountRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._sign_evm_transaction_with_end_user_account_serialize( + project_id=project_id, + user_id=user_id, + x_wallet_auth=x_wallet_auth, + x_idempotency_key=x_idempotency_key, + x_developer_auth=x_developer_auth, + sign_evm_transaction_with_end_user_account_request=sign_evm_transaction_with_end_user_account_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignEvmTransactionWithEndUserAccount200Response", + '400': "Error", + '401': "Error", + '402': "Error", + '403': "Error", + '404': "Error", + '409': "Error", + '422': "Error", + '500': "Error", + '502': "Error", + '503': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def sign_evm_transaction_with_end_user_account_without_preload_content( + self, + project_id: Annotated[str, Field(strict=True, description="The ID of the CDP Project.")], + user_id: Annotated[str, Field(strict=True, description="The ID of the end user.")], + x_wallet_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + x_idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=128)]], Field(description="An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. ")] = None, + x_developer_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + sign_evm_transaction_with_end_user_account_request: Optional[SignEvmTransactionWithEndUserAccountRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Sign a transaction with end user EVM account + + Signs a transaction with the given end user EVM account. The transaction should be serialized as a hex string using [RLP](https://ethereum.org/en/developers/docs/data-structures-and-encoding/rlp/). The transaction must be an [EIP-1559 dynamic fee transaction](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1559.md). The developer is responsible for ensuring that the unsigned transaction is valid, as the API will not validate the transaction. + + :param project_id: The ID of the CDP Project. (required) + :type project_id: str + :param user_id: The ID of the end user. (required) + :type user_id: str + :param x_wallet_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_wallet_auth: str + :param x_idempotency_key: An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. + :type x_idempotency_key: str + :param x_developer_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_developer_auth: str + :param sign_evm_transaction_with_end_user_account_request: + :type sign_evm_transaction_with_end_user_account_request: SignEvmTransactionWithEndUserAccountRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._sign_evm_transaction_with_end_user_account_serialize( + project_id=project_id, + user_id=user_id, + x_wallet_auth=x_wallet_auth, + x_idempotency_key=x_idempotency_key, + x_developer_auth=x_developer_auth, + sign_evm_transaction_with_end_user_account_request=sign_evm_transaction_with_end_user_account_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignEvmTransactionWithEndUserAccount200Response", + '400': "Error", + '401': "Error", + '402': "Error", + '403': "Error", + '404': "Error", + '409': "Error", + '422': "Error", + '500': "Error", + '502': "Error", + '503': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _sign_evm_transaction_with_end_user_account_serialize( + self, + project_id, + user_id, + x_wallet_auth, + x_idempotency_key, + x_developer_auth, + sign_evm_transaction_with_end_user_account_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params['projectId'] = project_id + if user_id is not None: + _path_params['userId'] = user_id + # process the query parameters + # process the header parameters + if x_wallet_auth is not None: + _header_params['X-Wallet-Auth'] = x_wallet_auth + if x_idempotency_key is not None: + _header_params['X-Idempotency-Key'] = x_idempotency_key + if x_developer_auth is not None: + _header_params['X-Developer-Auth'] = x_developer_auth + # process the form parameters + # process the body parameter + if sign_evm_transaction_with_end_user_account_request is not None: + _body_params = sign_evm_transaction_with_end_user_account_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'apiKeyAuth', + 'endUserAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/embedded-wallet-api/projects/{projectId}/end-users/{userId}/evm/sign/transaction', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def sign_evm_typed_data_with_end_user_account( + self, + project_id: Annotated[str, Field(strict=True, description="The ID of the CDP Project.")], + user_id: Annotated[str, Field(strict=True, description="The ID of the end user.")], + x_wallet_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + x_idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=128)]], Field(description="An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. ")] = None, + x_developer_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + sign_evm_typed_data_with_end_user_account_request: Optional[SignEvmTypedDataWithEndUserAccountRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SignEvmTypedDataWithEndUserAccount200Response: + """Sign EIP-712 typed data with end user EVM account + + Signs [EIP-712](https://eips.ethereum.org/EIPS/eip-712) typed data with the given end user EVM account. + + :param project_id: The ID of the CDP Project. (required) + :type project_id: str + :param user_id: The ID of the end user. (required) + :type user_id: str + :param x_wallet_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_wallet_auth: str + :param x_idempotency_key: An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. + :type x_idempotency_key: str + :param x_developer_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_developer_auth: str + :param sign_evm_typed_data_with_end_user_account_request: + :type sign_evm_typed_data_with_end_user_account_request: SignEvmTypedDataWithEndUserAccountRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._sign_evm_typed_data_with_end_user_account_serialize( + project_id=project_id, + user_id=user_id, + x_wallet_auth=x_wallet_auth, + x_idempotency_key=x_idempotency_key, + x_developer_auth=x_developer_auth, + sign_evm_typed_data_with_end_user_account_request=sign_evm_typed_data_with_end_user_account_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignEvmTypedDataWithEndUserAccount200Response", + '400': "Error", + '401': "Error", + '402': "Error", + '404': "Error", + '422': "Error", + '500': "Error", + '502': "Error", + '503': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def sign_evm_typed_data_with_end_user_account_with_http_info( + self, + project_id: Annotated[str, Field(strict=True, description="The ID of the CDP Project.")], + user_id: Annotated[str, Field(strict=True, description="The ID of the end user.")], + x_wallet_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + x_idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=128)]], Field(description="An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. ")] = None, + x_developer_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + sign_evm_typed_data_with_end_user_account_request: Optional[SignEvmTypedDataWithEndUserAccountRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SignEvmTypedDataWithEndUserAccount200Response]: + """Sign EIP-712 typed data with end user EVM account + + Signs [EIP-712](https://eips.ethereum.org/EIPS/eip-712) typed data with the given end user EVM account. + + :param project_id: The ID of the CDP Project. (required) + :type project_id: str + :param user_id: The ID of the end user. (required) + :type user_id: str + :param x_wallet_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_wallet_auth: str + :param x_idempotency_key: An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. + :type x_idempotency_key: str + :param x_developer_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_developer_auth: str + :param sign_evm_typed_data_with_end_user_account_request: + :type sign_evm_typed_data_with_end_user_account_request: SignEvmTypedDataWithEndUserAccountRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._sign_evm_typed_data_with_end_user_account_serialize( + project_id=project_id, + user_id=user_id, + x_wallet_auth=x_wallet_auth, + x_idempotency_key=x_idempotency_key, + x_developer_auth=x_developer_auth, + sign_evm_typed_data_with_end_user_account_request=sign_evm_typed_data_with_end_user_account_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignEvmTypedDataWithEndUserAccount200Response", + '400': "Error", + '401': "Error", + '402': "Error", + '404': "Error", + '422': "Error", + '500': "Error", + '502': "Error", + '503': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def sign_evm_typed_data_with_end_user_account_without_preload_content( + self, + project_id: Annotated[str, Field(strict=True, description="The ID of the CDP Project.")], + user_id: Annotated[str, Field(strict=True, description="The ID of the end user.")], + x_wallet_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + x_idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=128)]], Field(description="An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. ")] = None, + x_developer_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + sign_evm_typed_data_with_end_user_account_request: Optional[SignEvmTypedDataWithEndUserAccountRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Sign EIP-712 typed data with end user EVM account + + Signs [EIP-712](https://eips.ethereum.org/EIPS/eip-712) typed data with the given end user EVM account. + + :param project_id: The ID of the CDP Project. (required) + :type project_id: str + :param user_id: The ID of the end user. (required) + :type user_id: str + :param x_wallet_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_wallet_auth: str + :param x_idempotency_key: An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. + :type x_idempotency_key: str + :param x_developer_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_developer_auth: str + :param sign_evm_typed_data_with_end_user_account_request: + :type sign_evm_typed_data_with_end_user_account_request: SignEvmTypedDataWithEndUserAccountRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._sign_evm_typed_data_with_end_user_account_serialize( + project_id=project_id, + user_id=user_id, + x_wallet_auth=x_wallet_auth, + x_idempotency_key=x_idempotency_key, + x_developer_auth=x_developer_auth, + sign_evm_typed_data_with_end_user_account_request=sign_evm_typed_data_with_end_user_account_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignEvmTypedDataWithEndUserAccount200Response", + '400': "Error", + '401': "Error", + '402': "Error", + '404': "Error", + '422': "Error", + '500': "Error", + '502': "Error", + '503': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _sign_evm_typed_data_with_end_user_account_serialize( + self, + project_id, + user_id, + x_wallet_auth, + x_idempotency_key, + x_developer_auth, + sign_evm_typed_data_with_end_user_account_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params['projectId'] = project_id + if user_id is not None: + _path_params['userId'] = user_id + # process the query parameters + # process the header parameters + if x_wallet_auth is not None: + _header_params['X-Wallet-Auth'] = x_wallet_auth + if x_idempotency_key is not None: + _header_params['X-Idempotency-Key'] = x_idempotency_key + if x_developer_auth is not None: + _header_params['X-Developer-Auth'] = x_developer_auth + # process the form parameters + # process the body parameter + if sign_evm_typed_data_with_end_user_account_request is not None: + _body_params = sign_evm_typed_data_with_end_user_account_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'apiKeyAuth', + 'endUserAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/embedded-wallet-api/projects/{projectId}/end-users/{userId}/evm/sign/typed-data', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def sign_solana_hash_with_end_user_account( + self, + project_id: Annotated[str, Field(strict=True, description="The ID of the CDP Project.")], + user_id: Annotated[str, Field(strict=True, description="The ID of the end user.")], + x_wallet_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + x_idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=128)]], Field(description="An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. ")] = None, + x_developer_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + sign_solana_hash_with_end_user_account_request: Optional[SignSolanaHashWithEndUserAccountRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SignSolanaHashWithEndUserAccount200Response: + """Sign a hash with end user Solana account + + Signs an arbitrary 32 byte hash with the end user's given Solana account. + + :param project_id: The ID of the CDP Project. (required) + :type project_id: str + :param user_id: The ID of the end user. (required) + :type user_id: str + :param x_wallet_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_wallet_auth: str + :param x_idempotency_key: An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. + :type x_idempotency_key: str + :param x_developer_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_developer_auth: str + :param sign_solana_hash_with_end_user_account_request: + :type sign_solana_hash_with_end_user_account_request: SignSolanaHashWithEndUserAccountRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._sign_solana_hash_with_end_user_account_serialize( + project_id=project_id, + user_id=user_id, + x_wallet_auth=x_wallet_auth, + x_idempotency_key=x_idempotency_key, + x_developer_auth=x_developer_auth, + sign_solana_hash_with_end_user_account_request=sign_solana_hash_with_end_user_account_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignSolanaHashWithEndUserAccount200Response", + '400': "Error", + '401': "Error", + '402': "Error", + '404': "Error", + '409': "Error", + '422': "Error", + '500': "Error", + '502': "Error", + '503': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def sign_solana_hash_with_end_user_account_with_http_info( + self, + project_id: Annotated[str, Field(strict=True, description="The ID of the CDP Project.")], + user_id: Annotated[str, Field(strict=True, description="The ID of the end user.")], + x_wallet_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + x_idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=128)]], Field(description="An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. ")] = None, + x_developer_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + sign_solana_hash_with_end_user_account_request: Optional[SignSolanaHashWithEndUserAccountRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SignSolanaHashWithEndUserAccount200Response]: + """Sign a hash with end user Solana account + + Signs an arbitrary 32 byte hash with the end user's given Solana account. + + :param project_id: The ID of the CDP Project. (required) + :type project_id: str + :param user_id: The ID of the end user. (required) + :type user_id: str + :param x_wallet_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_wallet_auth: str + :param x_idempotency_key: An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. + :type x_idempotency_key: str + :param x_developer_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_developer_auth: str + :param sign_solana_hash_with_end_user_account_request: + :type sign_solana_hash_with_end_user_account_request: SignSolanaHashWithEndUserAccountRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._sign_solana_hash_with_end_user_account_serialize( + project_id=project_id, + user_id=user_id, + x_wallet_auth=x_wallet_auth, + x_idempotency_key=x_idempotency_key, + x_developer_auth=x_developer_auth, + sign_solana_hash_with_end_user_account_request=sign_solana_hash_with_end_user_account_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignSolanaHashWithEndUserAccount200Response", + '400': "Error", + '401': "Error", + '402': "Error", + '404': "Error", + '409': "Error", + '422': "Error", + '500': "Error", + '502': "Error", + '503': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def sign_solana_hash_with_end_user_account_without_preload_content( + self, + project_id: Annotated[str, Field(strict=True, description="The ID of the CDP Project.")], + user_id: Annotated[str, Field(strict=True, description="The ID of the end user.")], + x_wallet_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + x_idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=128)]], Field(description="An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. ")] = None, + x_developer_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + sign_solana_hash_with_end_user_account_request: Optional[SignSolanaHashWithEndUserAccountRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Sign a hash with end user Solana account + + Signs an arbitrary 32 byte hash with the end user's given Solana account. + + :param project_id: The ID of the CDP Project. (required) + :type project_id: str + :param user_id: The ID of the end user. (required) + :type user_id: str + :param x_wallet_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_wallet_auth: str + :param x_idempotency_key: An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. + :type x_idempotency_key: str + :param x_developer_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_developer_auth: str + :param sign_solana_hash_with_end_user_account_request: + :type sign_solana_hash_with_end_user_account_request: SignSolanaHashWithEndUserAccountRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._sign_solana_hash_with_end_user_account_serialize( + project_id=project_id, + user_id=user_id, + x_wallet_auth=x_wallet_auth, + x_idempotency_key=x_idempotency_key, + x_developer_auth=x_developer_auth, + sign_solana_hash_with_end_user_account_request=sign_solana_hash_with_end_user_account_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignSolanaHashWithEndUserAccount200Response", + '400': "Error", + '401': "Error", + '402': "Error", + '404': "Error", + '409': "Error", + '422': "Error", + '500': "Error", + '502': "Error", + '503': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _sign_solana_hash_with_end_user_account_serialize( + self, + project_id, + user_id, + x_wallet_auth, + x_idempotency_key, + x_developer_auth, + sign_solana_hash_with_end_user_account_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params['projectId'] = project_id + if user_id is not None: + _path_params['userId'] = user_id + # process the query parameters + # process the header parameters + if x_wallet_auth is not None: + _header_params['X-Wallet-Auth'] = x_wallet_auth + if x_idempotency_key is not None: + _header_params['X-Idempotency-Key'] = x_idempotency_key + if x_developer_auth is not None: + _header_params['X-Developer-Auth'] = x_developer_auth + # process the form parameters + # process the body parameter + if sign_solana_hash_with_end_user_account_request is not None: + _body_params = sign_solana_hash_with_end_user_account_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'apiKeyAuth', + 'endUserAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/embedded-wallet-api/projects/{projectId}/end-users/{userId}/solana/sign', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def sign_solana_message_with_end_user_account( + self, + project_id: Annotated[str, Field(strict=True, description="The ID of the CDP Project.")], + user_id: Annotated[str, Field(strict=True, description="The ID of the end user.")], + x_wallet_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + x_idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=128)]], Field(description="An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. ")] = None, + x_developer_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + sign_solana_message_with_end_user_account_request: Optional[SignSolanaMessageWithEndUserAccountRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SignSolanaMessageWithEndUserAccount200Response: + """Sign a Base64 encoded message + + Signs an arbitrary Base64 encoded message with the given Solana account. **WARNING:** Never sign a message that you didn't generate as it may put your funds at risk. + + :param project_id: The ID of the CDP Project. (required) + :type project_id: str + :param user_id: The ID of the end user. (required) + :type user_id: str + :param x_wallet_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_wallet_auth: str + :param x_idempotency_key: An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. + :type x_idempotency_key: str + :param x_developer_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_developer_auth: str + :param sign_solana_message_with_end_user_account_request: + :type sign_solana_message_with_end_user_account_request: SignSolanaMessageWithEndUserAccountRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._sign_solana_message_with_end_user_account_serialize( + project_id=project_id, + user_id=user_id, + x_wallet_auth=x_wallet_auth, + x_idempotency_key=x_idempotency_key, + x_developer_auth=x_developer_auth, + sign_solana_message_with_end_user_account_request=sign_solana_message_with_end_user_account_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignSolanaMessageWithEndUserAccount200Response", + '400': "Error", + '401': "Error", + '402': "Error", + '404': "Error", + '409': "Error", + '422': "Error", + '500': "Error", + '502': "Error", + '503': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def sign_solana_message_with_end_user_account_with_http_info( + self, + project_id: Annotated[str, Field(strict=True, description="The ID of the CDP Project.")], + user_id: Annotated[str, Field(strict=True, description="The ID of the end user.")], + x_wallet_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + x_idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=128)]], Field(description="An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. ")] = None, + x_developer_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + sign_solana_message_with_end_user_account_request: Optional[SignSolanaMessageWithEndUserAccountRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SignSolanaMessageWithEndUserAccount200Response]: + """Sign a Base64 encoded message + + Signs an arbitrary Base64 encoded message with the given Solana account. **WARNING:** Never sign a message that you didn't generate as it may put your funds at risk. + + :param project_id: The ID of the CDP Project. (required) + :type project_id: str + :param user_id: The ID of the end user. (required) + :type user_id: str + :param x_wallet_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_wallet_auth: str + :param x_idempotency_key: An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. + :type x_idempotency_key: str + :param x_developer_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_developer_auth: str + :param sign_solana_message_with_end_user_account_request: + :type sign_solana_message_with_end_user_account_request: SignSolanaMessageWithEndUserAccountRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._sign_solana_message_with_end_user_account_serialize( + project_id=project_id, + user_id=user_id, + x_wallet_auth=x_wallet_auth, + x_idempotency_key=x_idempotency_key, + x_developer_auth=x_developer_auth, + sign_solana_message_with_end_user_account_request=sign_solana_message_with_end_user_account_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignSolanaMessageWithEndUserAccount200Response", + '400': "Error", + '401': "Error", + '402': "Error", + '404': "Error", + '409': "Error", + '422': "Error", + '500': "Error", + '502': "Error", + '503': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def sign_solana_message_with_end_user_account_without_preload_content( + self, + project_id: Annotated[str, Field(strict=True, description="The ID of the CDP Project.")], + user_id: Annotated[str, Field(strict=True, description="The ID of the end user.")], + x_wallet_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + x_idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=128)]], Field(description="An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. ")] = None, + x_developer_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + sign_solana_message_with_end_user_account_request: Optional[SignSolanaMessageWithEndUserAccountRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Sign a Base64 encoded message + + Signs an arbitrary Base64 encoded message with the given Solana account. **WARNING:** Never sign a message that you didn't generate as it may put your funds at risk. + + :param project_id: The ID of the CDP Project. (required) + :type project_id: str + :param user_id: The ID of the end user. (required) + :type user_id: str + :param x_wallet_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_wallet_auth: str + :param x_idempotency_key: An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. + :type x_idempotency_key: str + :param x_developer_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_developer_auth: str + :param sign_solana_message_with_end_user_account_request: + :type sign_solana_message_with_end_user_account_request: SignSolanaMessageWithEndUserAccountRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._sign_solana_message_with_end_user_account_serialize( + project_id=project_id, + user_id=user_id, + x_wallet_auth=x_wallet_auth, + x_idempotency_key=x_idempotency_key, + x_developer_auth=x_developer_auth, + sign_solana_message_with_end_user_account_request=sign_solana_message_with_end_user_account_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignSolanaMessageWithEndUserAccount200Response", + '400': "Error", + '401': "Error", + '402': "Error", + '404': "Error", + '409': "Error", + '422': "Error", + '500': "Error", + '502': "Error", + '503': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _sign_solana_message_with_end_user_account_serialize( + self, + project_id, + user_id, + x_wallet_auth, + x_idempotency_key, + x_developer_auth, + sign_solana_message_with_end_user_account_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params['projectId'] = project_id + if user_id is not None: + _path_params['userId'] = user_id + # process the query parameters + # process the header parameters + if x_wallet_auth is not None: + _header_params['X-Wallet-Auth'] = x_wallet_auth + if x_idempotency_key is not None: + _header_params['X-Idempotency-Key'] = x_idempotency_key + if x_developer_auth is not None: + _header_params['X-Developer-Auth'] = x_developer_auth + # process the form parameters + # process the body parameter + if sign_solana_message_with_end_user_account_request is not None: + _body_params = sign_solana_message_with_end_user_account_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'apiKeyAuth', + 'endUserAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/embedded-wallet-api/projects/{projectId}/end-users/{userId}/solana/sign/message', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def sign_solana_transaction_with_end_user_account( + self, + project_id: Annotated[str, Field(strict=True, description="The ID of the CDP Project.")], + user_id: Annotated[str, Field(strict=True, description="The ID of the end user.")], + x_wallet_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + x_idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=128)]], Field(description="An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. ")] = None, + x_developer_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + sign_solana_transaction_with_end_user_account_request: Optional[SignSolanaTransactionWithEndUserAccountRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SignSolanaTransactionWithEndUserAccount200Response: + """Sign a transaction with end user Solana account + + Signs a transaction with the given end user Solana account. The unsigned transaction should be serialized into a byte array and then encoded as base64. **Transaction types** The following transaction types are supported: * [Legacy transactions](https://solana-labs.github.io/solana-web3.js/classes/Transaction.html) * [Versioned transactions](https://solana-labs.github.io/solana-web3.js/classes/VersionedTransaction.html) The developer is responsible for ensuring that the unsigned transaction is valid, as the API will not validate the transaction. + + :param project_id: The ID of the CDP Project. (required) + :type project_id: str + :param user_id: The ID of the end user. (required) + :type user_id: str + :param x_wallet_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_wallet_auth: str + :param x_idempotency_key: An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. + :type x_idempotency_key: str + :param x_developer_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_developer_auth: str + :param sign_solana_transaction_with_end_user_account_request: + :type sign_solana_transaction_with_end_user_account_request: SignSolanaTransactionWithEndUserAccountRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._sign_solana_transaction_with_end_user_account_serialize( + project_id=project_id, + user_id=user_id, + x_wallet_auth=x_wallet_auth, + x_idempotency_key=x_idempotency_key, + x_developer_auth=x_developer_auth, + sign_solana_transaction_with_end_user_account_request=sign_solana_transaction_with_end_user_account_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignSolanaTransactionWithEndUserAccount200Response", + '400': "Error", + '401': "Error", + '402': "Error", + '403': "Error", + '404': "Error", + '409': "Error", + '422': "Error", + '500': "Error", + '502': "Error", + '503': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def sign_solana_transaction_with_end_user_account_with_http_info( + self, + project_id: Annotated[str, Field(strict=True, description="The ID of the CDP Project.")], + user_id: Annotated[str, Field(strict=True, description="The ID of the end user.")], + x_wallet_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + x_idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=128)]], Field(description="An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. ")] = None, + x_developer_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + sign_solana_transaction_with_end_user_account_request: Optional[SignSolanaTransactionWithEndUserAccountRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SignSolanaTransactionWithEndUserAccount200Response]: + """Sign a transaction with end user Solana account + + Signs a transaction with the given end user Solana account. The unsigned transaction should be serialized into a byte array and then encoded as base64. **Transaction types** The following transaction types are supported: * [Legacy transactions](https://solana-labs.github.io/solana-web3.js/classes/Transaction.html) * [Versioned transactions](https://solana-labs.github.io/solana-web3.js/classes/VersionedTransaction.html) The developer is responsible for ensuring that the unsigned transaction is valid, as the API will not validate the transaction. + + :param project_id: The ID of the CDP Project. (required) + :type project_id: str + :param user_id: The ID of the end user. (required) + :type user_id: str + :param x_wallet_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_wallet_auth: str + :param x_idempotency_key: An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. + :type x_idempotency_key: str + :param x_developer_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_developer_auth: str + :param sign_solana_transaction_with_end_user_account_request: + :type sign_solana_transaction_with_end_user_account_request: SignSolanaTransactionWithEndUserAccountRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._sign_solana_transaction_with_end_user_account_serialize( + project_id=project_id, + user_id=user_id, + x_wallet_auth=x_wallet_auth, + x_idempotency_key=x_idempotency_key, + x_developer_auth=x_developer_auth, + sign_solana_transaction_with_end_user_account_request=sign_solana_transaction_with_end_user_account_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignSolanaTransactionWithEndUserAccount200Response", + '400': "Error", + '401': "Error", + '402': "Error", + '403': "Error", + '404': "Error", + '409': "Error", + '422': "Error", + '500': "Error", + '502': "Error", + '503': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def sign_solana_transaction_with_end_user_account_without_preload_content( + self, + project_id: Annotated[str, Field(strict=True, description="The ID of the CDP Project.")], + user_id: Annotated[str, Field(strict=True, description="The ID of the end user.")], + x_wallet_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + x_idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=128)]], Field(description="An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. ")] = None, + x_developer_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, + sign_solana_transaction_with_end_user_account_request: Optional[SignSolanaTransactionWithEndUserAccountRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Sign a transaction with end user Solana account + + Signs a transaction with the given end user Solana account. The unsigned transaction should be serialized into a byte array and then encoded as base64. **Transaction types** The following transaction types are supported: * [Legacy transactions](https://solana-labs.github.io/solana-web3.js/classes/Transaction.html) * [Versioned transactions](https://solana-labs.github.io/solana-web3.js/classes/VersionedTransaction.html) The developer is responsible for ensuring that the unsigned transaction is valid, as the API will not validate the transaction. + + :param project_id: The ID of the CDP Project. (required) + :type project_id: str + :param user_id: The ID of the end user. (required) + :type user_id: str + :param x_wallet_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_wallet_auth: str + :param x_idempotency_key: An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. + :type x_idempotency_key: str + :param x_developer_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. + :type x_developer_auth: str + :param sign_solana_transaction_with_end_user_account_request: + :type sign_solana_transaction_with_end_user_account_request: SignSolanaTransactionWithEndUserAccountRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._sign_solana_transaction_with_end_user_account_serialize( + project_id=project_id, + user_id=user_id, + x_wallet_auth=x_wallet_auth, + x_idempotency_key=x_idempotency_key, + x_developer_auth=x_developer_auth, + sign_solana_transaction_with_end_user_account_request=sign_solana_transaction_with_end_user_account_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignSolanaTransactionWithEndUserAccount200Response", + '400': "Error", + '401': "Error", + '402': "Error", + '403': "Error", + '404': "Error", + '409': "Error", + '422': "Error", + '500': "Error", + '502': "Error", + '503': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _sign_solana_transaction_with_end_user_account_serialize( + self, + project_id, + user_id, + x_wallet_auth, + x_idempotency_key, + x_developer_auth, + sign_solana_transaction_with_end_user_account_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params['projectId'] = project_id + if user_id is not None: + _path_params['userId'] = user_id + # process the query parameters + # process the header parameters + if x_wallet_auth is not None: + _header_params['X-Wallet-Auth'] = x_wallet_auth + if x_idempotency_key is not None: + _header_params['X-Idempotency-Key'] = x_idempotency_key + if x_developer_auth is not None: + _header_params['X-Developer-Auth'] = x_developer_auth + # process the form parameters + # process the body parameter + if sign_solana_transaction_with_end_user_account_request is not None: + _body_params = sign_solana_transaction_with_end_user_account_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'apiKeyAuth', + 'endUserAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/embedded-wallet-api/projects/{projectId}/end-users/{userId}/solana/sign/transaction', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/python/cdp/openapi_client/api/evm_accounts_api.py b/python/cdp/openapi_client/api/evm_accounts_api.py index 478463143..265378281 100644 --- a/python/cdp/openapi_client/api/evm_accounts_api.py +++ b/python/cdp/openapi_client/api/evm_accounts_api.py @@ -21,8 +21,8 @@ from typing import Optional from typing_extensions import Annotated from cdp.openapi_client.models.create_evm_account_request import CreateEvmAccountRequest -from cdp.openapi_client.models.create_evm_eip7702_delegation201_response import CreateEvmEip7702Delegation201Response from cdp.openapi_client.models.create_evm_eip7702_delegation_request import CreateEvmEip7702DelegationRequest +from cdp.openapi_client.models.create_evm_eip7702_delegation_with_end_user_account201_response import CreateEvmEip7702DelegationWithEndUserAccount201Response from cdp.openapi_client.models.eip712_message import EIP712Message from cdp.openapi_client.models.evm_account import EvmAccount from cdp.openapi_client.models.evm_eip7702_delegation_operation import EvmEip7702DelegationOperation @@ -30,15 +30,15 @@ from cdp.openapi_client.models.export_evm_account_request import ExportEvmAccountRequest from cdp.openapi_client.models.import_evm_account_request import ImportEvmAccountRequest from cdp.openapi_client.models.list_evm_accounts200_response import ListEvmAccounts200Response -from cdp.openapi_client.models.send_evm_transaction200_response import SendEvmTransaction200Response from cdp.openapi_client.models.send_evm_transaction_request import SendEvmTransactionRequest -from cdp.openapi_client.models.sign_evm_hash200_response import SignEvmHash200Response +from cdp.openapi_client.models.send_evm_transaction_with_end_user_account200_response import SendEvmTransactionWithEndUserAccount200Response from cdp.openapi_client.models.sign_evm_hash_request import SignEvmHashRequest -from cdp.openapi_client.models.sign_evm_message200_response import SignEvmMessage200Response +from cdp.openapi_client.models.sign_evm_hash_with_end_user_account200_response import SignEvmHashWithEndUserAccount200Response from cdp.openapi_client.models.sign_evm_message_request import SignEvmMessageRequest -from cdp.openapi_client.models.sign_evm_transaction200_response import SignEvmTransaction200Response +from cdp.openapi_client.models.sign_evm_message_with_end_user_account200_response import SignEvmMessageWithEndUserAccount200Response from cdp.openapi_client.models.sign_evm_transaction_request import SignEvmTransactionRequest -from cdp.openapi_client.models.sign_evm_typed_data200_response import SignEvmTypedData200Response +from cdp.openapi_client.models.sign_evm_transaction_with_end_user_account200_response import SignEvmTransactionWithEndUserAccount200Response +from cdp.openapi_client.models.sign_evm_typed_data_with_end_user_account200_response import SignEvmTypedDataWithEndUserAccount200Response from cdp.openapi_client.models.update_evm_account_request import UpdateEvmAccountRequest from cdp.openapi_client.api_client import ApiClient, RequestSerialized @@ -406,7 +406,7 @@ async def create_evm_eip7702_delegation( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> CreateEvmEip7702Delegation201Response: + ) -> CreateEvmEip7702DelegationWithEndUserAccount201Response: """Create EIP-7702 delegation Creates an EIP-7702 delegation for an EVM EOA account, upgrading it with smart account capabilities. This endpoint: - Retrieves delegation artifacts from onchain - Signs the EIP-7702 authorization for delegation - Assembles and submits a Type 4 transaction - Creates an associated smart account object The delegation allows the EVM EOA to be used as a smart account, which enables batched transactions and gas sponsorship via paymaster. @@ -453,7 +453,7 @@ async def create_evm_eip7702_delegation( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "CreateEvmEip7702Delegation201Response", + '201': "CreateEvmEip7702DelegationWithEndUserAccount201Response", '400': "Error", '401': "Error", '402': "Error", @@ -494,7 +494,7 @@ async def create_evm_eip7702_delegation_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[CreateEvmEip7702Delegation201Response]: + ) -> ApiResponse[CreateEvmEip7702DelegationWithEndUserAccount201Response]: """Create EIP-7702 delegation Creates an EIP-7702 delegation for an EVM EOA account, upgrading it with smart account capabilities. This endpoint: - Retrieves delegation artifacts from onchain - Signs the EIP-7702 authorization for delegation - Assembles and submits a Type 4 transaction - Creates an associated smart account object The delegation allows the EVM EOA to be used as a smart account, which enables batched transactions and gas sponsorship via paymaster. @@ -541,7 +541,7 @@ async def create_evm_eip7702_delegation_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "CreateEvmEip7702Delegation201Response", + '201': "CreateEvmEip7702DelegationWithEndUserAccount201Response", '400': "Error", '401': "Error", '402': "Error", @@ -629,7 +629,7 @@ async def create_evm_eip7702_delegation_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "CreateEvmEip7702Delegation201Response", + '201': "CreateEvmEip7702DelegationWithEndUserAccount201Response", '400': "Error", '401': "Error", '402': "Error", @@ -2883,7 +2883,7 @@ async def send_evm_transaction( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> SendEvmTransaction200Response: + ) -> SendEvmTransactionWithEndUserAccount200Response: """Send a transaction Signs a transaction with the given EVM account and sends it to the indicated supported network. This API handles nonce management and gas estimation, leaving the developer to provide only the minimal set of fields necessary to send the transaction. The transaction should be serialized as a hex string using [RLP](https://ethereum.org/en/developers/docs/data-structures-and-encoding/rlp/). The transaction must be an [EIP-1559 dynamic fee transaction](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1559.md). **Transaction fields and API behavior** - `to` *(Required)*: The address of the contract or account to send the transaction to. - `chainId` *(Ignored)*: The value of the `chainId` field in the transaction is ignored. The transaction will be sent to the network indicated by the `network` field in the request body. - `nonce` *(Optional)*: The nonce to use for the transaction. If not provided, the API will assign a nonce to the transaction based on the current state of the account. - `maxPriorityFeePerGas` *(Optional)*: The maximum priority fee per gas to use for the transaction. If not provided, the API will estimate a value based on current network conditions. - `maxFeePerGas` *(Optional)*: The maximum fee per gas to use for the transaction. If not provided, the API will estimate a value based on current network conditions. - `gasLimit` *(Optional)*: The gas limit to use for the transaction. If not provided, the API will estimate a value based on the `to` and `data` fields of the transaction. - `value` *(Optional)*: The amount of ETH, in wei, to send with the transaction. - `data` *(Optional)*: The data to send with the transaction; only used for contract calls. - `accessList` *(Optional)*: The access list to use for the transaction. @@ -2930,7 +2930,7 @@ async def send_evm_transaction( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "SendEvmTransaction200Response", + '200': "SendEvmTransactionWithEndUserAccount200Response", '400': "Error", '401': "Error", '402': "Error", @@ -2972,7 +2972,7 @@ async def send_evm_transaction_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[SendEvmTransaction200Response]: + ) -> ApiResponse[SendEvmTransactionWithEndUserAccount200Response]: """Send a transaction Signs a transaction with the given EVM account and sends it to the indicated supported network. This API handles nonce management and gas estimation, leaving the developer to provide only the minimal set of fields necessary to send the transaction. The transaction should be serialized as a hex string using [RLP](https://ethereum.org/en/developers/docs/data-structures-and-encoding/rlp/). The transaction must be an [EIP-1559 dynamic fee transaction](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1559.md). **Transaction fields and API behavior** - `to` *(Required)*: The address of the contract or account to send the transaction to. - `chainId` *(Ignored)*: The value of the `chainId` field in the transaction is ignored. The transaction will be sent to the network indicated by the `network` field in the request body. - `nonce` *(Optional)*: The nonce to use for the transaction. If not provided, the API will assign a nonce to the transaction based on the current state of the account. - `maxPriorityFeePerGas` *(Optional)*: The maximum priority fee per gas to use for the transaction. If not provided, the API will estimate a value based on current network conditions. - `maxFeePerGas` *(Optional)*: The maximum fee per gas to use for the transaction. If not provided, the API will estimate a value based on current network conditions. - `gasLimit` *(Optional)*: The gas limit to use for the transaction. If not provided, the API will estimate a value based on the `to` and `data` fields of the transaction. - `value` *(Optional)*: The amount of ETH, in wei, to send with the transaction. - `data` *(Optional)*: The data to send with the transaction; only used for contract calls. - `accessList` *(Optional)*: The access list to use for the transaction. @@ -3019,7 +3019,7 @@ async def send_evm_transaction_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "SendEvmTransaction200Response", + '200': "SendEvmTransactionWithEndUserAccount200Response", '400': "Error", '401': "Error", '402': "Error", @@ -3108,7 +3108,7 @@ async def send_evm_transaction_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "SendEvmTransaction200Response", + '200': "SendEvmTransactionWithEndUserAccount200Response", '400': "Error", '401': "Error", '402': "Error", @@ -3232,7 +3232,7 @@ async def sign_evm_hash( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> SignEvmHash200Response: + ) -> SignEvmHashWithEndUserAccount200Response: """Sign a hash Signs an arbitrary 32 byte hash with the given EVM account. @@ -3279,7 +3279,7 @@ async def sign_evm_hash( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "SignEvmHash200Response", + '200': "SignEvmHashWithEndUserAccount200Response", '400': "Error", '402': "Error", '404': "Error", @@ -3319,7 +3319,7 @@ async def sign_evm_hash_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[SignEvmHash200Response]: + ) -> ApiResponse[SignEvmHashWithEndUserAccount200Response]: """Sign a hash Signs an arbitrary 32 byte hash with the given EVM account. @@ -3366,7 +3366,7 @@ async def sign_evm_hash_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "SignEvmHash200Response", + '200': "SignEvmHashWithEndUserAccount200Response", '400': "Error", '402': "Error", '404': "Error", @@ -3453,7 +3453,7 @@ async def sign_evm_hash_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "SignEvmHash200Response", + '200': "SignEvmHashWithEndUserAccount200Response", '400': "Error", '402': "Error", '404': "Error", @@ -3575,7 +3575,7 @@ async def sign_evm_message( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> SignEvmMessage200Response: + ) -> SignEvmMessageWithEndUserAccount200Response: """Sign an EIP-191 message Signs an [EIP-191](https://eips.ethereum.org/EIPS/eip-191) message with the given EVM account. Per the specification, the message in the request body is prepended with `0x19 <0x45 (E)> ` before being signed. @@ -3622,7 +3622,7 @@ async def sign_evm_message( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "SignEvmMessage200Response", + '200': "SignEvmMessageWithEndUserAccount200Response", '401': "Error", '402': "Error", '404': "Error", @@ -3662,7 +3662,7 @@ async def sign_evm_message_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[SignEvmMessage200Response]: + ) -> ApiResponse[SignEvmMessageWithEndUserAccount200Response]: """Sign an EIP-191 message Signs an [EIP-191](https://eips.ethereum.org/EIPS/eip-191) message with the given EVM account. Per the specification, the message in the request body is prepended with `0x19 <0x45 (E)> ` before being signed. @@ -3709,7 +3709,7 @@ async def sign_evm_message_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "SignEvmMessage200Response", + '200': "SignEvmMessageWithEndUserAccount200Response", '401': "Error", '402': "Error", '404': "Error", @@ -3796,7 +3796,7 @@ async def sign_evm_message_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "SignEvmMessage200Response", + '200': "SignEvmMessageWithEndUserAccount200Response", '401': "Error", '402': "Error", '404': "Error", @@ -3918,7 +3918,7 @@ async def sign_evm_transaction( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> SignEvmTransaction200Response: + ) -> SignEvmTransactionWithEndUserAccount200Response: """Sign a transaction Signs a transaction with the given EVM account. The transaction should be serialized as a hex string using [RLP](https://ethereum.org/en/developers/docs/data-structures-and-encoding/rlp/). The transaction must be an [EIP-1559 dynamic fee transaction](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1559.md). The developer is responsible for ensuring that the unsigned transaction is valid, as the API will not validate the transaction. @@ -3965,7 +3965,7 @@ async def sign_evm_transaction( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "SignEvmTransaction200Response", + '200': "SignEvmTransactionWithEndUserAccount200Response", '400': "Error", '401': "Error", '402': "Error", @@ -4007,7 +4007,7 @@ async def sign_evm_transaction_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[SignEvmTransaction200Response]: + ) -> ApiResponse[SignEvmTransactionWithEndUserAccount200Response]: """Sign a transaction Signs a transaction with the given EVM account. The transaction should be serialized as a hex string using [RLP](https://ethereum.org/en/developers/docs/data-structures-and-encoding/rlp/). The transaction must be an [EIP-1559 dynamic fee transaction](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1559.md). The developer is responsible for ensuring that the unsigned transaction is valid, as the API will not validate the transaction. @@ -4054,7 +4054,7 @@ async def sign_evm_transaction_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "SignEvmTransaction200Response", + '200': "SignEvmTransactionWithEndUserAccount200Response", '400': "Error", '401': "Error", '402': "Error", @@ -4143,7 +4143,7 @@ async def sign_evm_transaction_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "SignEvmTransaction200Response", + '200': "SignEvmTransactionWithEndUserAccount200Response", '400': "Error", '401': "Error", '402': "Error", @@ -4267,7 +4267,7 @@ async def sign_evm_typed_data( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> SignEvmTypedData200Response: + ) -> SignEvmTypedDataWithEndUserAccount200Response: """Sign EIP-712 typed data Signs [EIP-712](https://eips.ethereum.org/EIPS/eip-712) typed data with the given EVM account. @@ -4314,7 +4314,7 @@ async def sign_evm_typed_data( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "SignEvmTypedData200Response", + '200': "SignEvmTypedDataWithEndUserAccount200Response", '400': "Error", '401': "Error", '402': "Error", @@ -4354,7 +4354,7 @@ async def sign_evm_typed_data_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[SignEvmTypedData200Response]: + ) -> ApiResponse[SignEvmTypedDataWithEndUserAccount200Response]: """Sign EIP-712 typed data Signs [EIP-712](https://eips.ethereum.org/EIPS/eip-712) typed data with the given EVM account. @@ -4401,7 +4401,7 @@ async def sign_evm_typed_data_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "SignEvmTypedData200Response", + '200': "SignEvmTypedDataWithEndUserAccount200Response", '400': "Error", '401': "Error", '402': "Error", @@ -4488,7 +4488,7 @@ async def sign_evm_typed_data_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "SignEvmTypedData200Response", + '200': "SignEvmTypedDataWithEndUserAccount200Response", '400': "Error", '401': "Error", '402': "Error", diff --git a/python/cdp/openapi_client/api/evm_smart_accounts_api.py b/python/cdp/openapi_client/api/evm_smart_accounts_api.py index 87bd7c7b1..671d10fbf 100644 --- a/python/cdp/openapi_client/api/evm_smart_accounts_api.py +++ b/python/cdp/openapi_client/api/evm_smart_accounts_api.py @@ -23,12 +23,12 @@ from cdp.openapi_client.models.create_evm_smart_account_request import CreateEvmSmartAccountRequest from cdp.openapi_client.models.create_spend_permission_request import CreateSpendPermissionRequest from cdp.openapi_client.models.evm_smart_account import EvmSmartAccount +from cdp.openapi_client.models.evm_spend_permissions_revoke_spend_permission_request import EvmSpendPermissionsRevokeSpendPermissionRequest from cdp.openapi_client.models.evm_user_operation import EvmUserOperation from cdp.openapi_client.models.list_evm_smart_accounts200_response import ListEvmSmartAccounts200Response from cdp.openapi_client.models.list_spend_permissions200_response import ListSpendPermissions200Response from cdp.openapi_client.models.prepare_and_send_user_operation_request import PrepareAndSendUserOperationRequest from cdp.openapi_client.models.prepare_user_operation_request import PrepareUserOperationRequest -from cdp.openapi_client.models.revoke_spend_permission_request import RevokeSpendPermissionRequest from cdp.openapi_client.models.send_user_operation_request import SendUserOperationRequest from cdp.openapi_client.models.update_evm_smart_account_request import UpdateEvmSmartAccountRequest @@ -2790,7 +2790,7 @@ def _prepare_user_operation_serialize( async def revoke_spend_permission( self, address: Annotated[str, Field(strict=True, description="The address of the Smart account this spend permission is valid for.")], - revoke_spend_permission_request: RevokeSpendPermissionRequest, + evm_spend_permissions_revoke_spend_permission_request: EvmSpendPermissionsRevokeSpendPermissionRequest, x_wallet_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, x_idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=128)]], Field(description="An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. ")] = None, _request_timeout: Union[ @@ -2812,8 +2812,8 @@ async def revoke_spend_permission( :param address: The address of the Smart account this spend permission is valid for. (required) :type address: str - :param revoke_spend_permission_request: (required) - :type revoke_spend_permission_request: RevokeSpendPermissionRequest + :param evm_spend_permissions_revoke_spend_permission_request: (required) + :type evm_spend_permissions_revoke_spend_permission_request: EvmSpendPermissionsRevokeSpendPermissionRequest :param x_wallet_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. :type x_wallet_auth: str :param x_idempotency_key: An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. @@ -2842,7 +2842,7 @@ async def revoke_spend_permission( _param = self._revoke_spend_permission_serialize( address=address, - revoke_spend_permission_request=revoke_spend_permission_request, + evm_spend_permissions_revoke_spend_permission_request=evm_spend_permissions_revoke_spend_permission_request, x_wallet_auth=x_wallet_auth, x_idempotency_key=x_idempotency_key, _request_auth=_request_auth, @@ -2874,7 +2874,7 @@ async def revoke_spend_permission( async def revoke_spend_permission_with_http_info( self, address: Annotated[str, Field(strict=True, description="The address of the Smart account this spend permission is valid for.")], - revoke_spend_permission_request: RevokeSpendPermissionRequest, + evm_spend_permissions_revoke_spend_permission_request: EvmSpendPermissionsRevokeSpendPermissionRequest, x_wallet_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, x_idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=128)]], Field(description="An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. ")] = None, _request_timeout: Union[ @@ -2896,8 +2896,8 @@ async def revoke_spend_permission_with_http_info( :param address: The address of the Smart account this spend permission is valid for. (required) :type address: str - :param revoke_spend_permission_request: (required) - :type revoke_spend_permission_request: RevokeSpendPermissionRequest + :param evm_spend_permissions_revoke_spend_permission_request: (required) + :type evm_spend_permissions_revoke_spend_permission_request: EvmSpendPermissionsRevokeSpendPermissionRequest :param x_wallet_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. :type x_wallet_auth: str :param x_idempotency_key: An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. @@ -2926,7 +2926,7 @@ async def revoke_spend_permission_with_http_info( _param = self._revoke_spend_permission_serialize( address=address, - revoke_spend_permission_request=revoke_spend_permission_request, + evm_spend_permissions_revoke_spend_permission_request=evm_spend_permissions_revoke_spend_permission_request, x_wallet_auth=x_wallet_auth, x_idempotency_key=x_idempotency_key, _request_auth=_request_auth, @@ -2958,7 +2958,7 @@ async def revoke_spend_permission_with_http_info( async def revoke_spend_permission_without_preload_content( self, address: Annotated[str, Field(strict=True, description="The address of the Smart account this spend permission is valid for.")], - revoke_spend_permission_request: RevokeSpendPermissionRequest, + evm_spend_permissions_revoke_spend_permission_request: EvmSpendPermissionsRevokeSpendPermissionRequest, x_wallet_auth: Annotated[Optional[StrictStr], Field(description="A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. ")] = None, x_idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=128)]], Field(description="An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. ")] = None, _request_timeout: Union[ @@ -2980,8 +2980,8 @@ async def revoke_spend_permission_without_preload_content( :param address: The address of the Smart account this spend permission is valid for. (required) :type address: str - :param revoke_spend_permission_request: (required) - :type revoke_spend_permission_request: RevokeSpendPermissionRequest + :param evm_spend_permissions_revoke_spend_permission_request: (required) + :type evm_spend_permissions_revoke_spend_permission_request: EvmSpendPermissionsRevokeSpendPermissionRequest :param x_wallet_auth: A JWT signed using your Wallet Secret, encoded in base64. Refer to the [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) section of our Authentication docs for more details on how to generate your Wallet Token. :type x_wallet_auth: str :param x_idempotency_key: An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys. @@ -3010,7 +3010,7 @@ async def revoke_spend_permission_without_preload_content( _param = self._revoke_spend_permission_serialize( address=address, - revoke_spend_permission_request=revoke_spend_permission_request, + evm_spend_permissions_revoke_spend_permission_request=evm_spend_permissions_revoke_spend_permission_request, x_wallet_auth=x_wallet_auth, x_idempotency_key=x_idempotency_key, _request_auth=_request_auth, @@ -3037,7 +3037,7 @@ async def revoke_spend_permission_without_preload_content( def _revoke_spend_permission_serialize( self, address, - revoke_spend_permission_request, + evm_spend_permissions_revoke_spend_permission_request, x_wallet_auth, x_idempotency_key, _request_auth, @@ -3071,8 +3071,8 @@ def _revoke_spend_permission_serialize( _header_params['X-Idempotency-Key'] = x_idempotency_key # process the form parameters # process the body parameter - if revoke_spend_permission_request is not None: - _body_params = revoke_spend_permission_request + if evm_spend_permissions_revoke_spend_permission_request is not None: + _body_params = evm_spend_permissions_revoke_spend_permission_request # set the HTTP header `Accept` diff --git a/python/cdp/openapi_client/api/faucets_api.py b/python/cdp/openapi_client/api/faucets_api.py index ce998b2ea..7240dac31 100644 --- a/python/cdp/openapi_client/api/faucets_api.py +++ b/python/cdp/openapi_client/api/faucets_api.py @@ -352,7 +352,7 @@ async def request_solana_faucet( ) -> RequestSolanaFaucet200Response: """Request funds on Solana devnet - Request funds from the CDP Faucet on Solana devnet. Faucets are available for SOL. To prevent abuse, we enforce rate limits within a rolling 24-hour window to control the amount of funds that can be requested. These limits are applied at both the CDP Project level and the blockchain address level. A single blockchain address cannot exceed the specified limits, even if multiple users submit requests to the same address. | Token | Amount per Faucet Request |Rolling 24-hour window Rate Limits| |:-----:|:-------------------------:|:--------------------------------:| | SOL | 0.00125 SOL | 0.0125 SOL | | USDC | 1 USDC | 10 USDC | + Request funds from the CDP Faucet on Solana devnet. Faucets are available for SOL, USDC, and CBTUSD. To prevent abuse, we enforce rate limits within a rolling 24-hour window to control the amount of funds that can be requested. These limits are applied at both the CDP Project level and the blockchain address level. A single blockchain address cannot exceed the specified limits, even if multiple users submit requests to the same address. | Token | Amount per Faucet Request |Rolling 24-hour window Rate Limits| |:-----: |:-------------------------:|:--------------------------------:| | SOL | 0.00125 SOL | 0.0125 SOL | | USDC | 1 USDC | 10 USDC | | CBTUSD | 1 CBTUSD | 10 CBTUSD | :param request_solana_faucet_request: :type request_solana_faucet_request: RequestSolanaFaucetRequest @@ -425,7 +425,7 @@ async def request_solana_faucet_with_http_info( ) -> ApiResponse[RequestSolanaFaucet200Response]: """Request funds on Solana devnet - Request funds from the CDP Faucet on Solana devnet. Faucets are available for SOL. To prevent abuse, we enforce rate limits within a rolling 24-hour window to control the amount of funds that can be requested. These limits are applied at both the CDP Project level and the blockchain address level. A single blockchain address cannot exceed the specified limits, even if multiple users submit requests to the same address. | Token | Amount per Faucet Request |Rolling 24-hour window Rate Limits| |:-----:|:-------------------------:|:--------------------------------:| | SOL | 0.00125 SOL | 0.0125 SOL | | USDC | 1 USDC | 10 USDC | + Request funds from the CDP Faucet on Solana devnet. Faucets are available for SOL, USDC, and CBTUSD. To prevent abuse, we enforce rate limits within a rolling 24-hour window to control the amount of funds that can be requested. These limits are applied at both the CDP Project level and the blockchain address level. A single blockchain address cannot exceed the specified limits, even if multiple users submit requests to the same address. | Token | Amount per Faucet Request |Rolling 24-hour window Rate Limits| |:-----: |:-------------------------:|:--------------------------------:| | SOL | 0.00125 SOL | 0.0125 SOL | | USDC | 1 USDC | 10 USDC | | CBTUSD | 1 CBTUSD | 10 CBTUSD | :param request_solana_faucet_request: :type request_solana_faucet_request: RequestSolanaFaucetRequest @@ -498,7 +498,7 @@ async def request_solana_faucet_without_preload_content( ) -> RESTResponseType: """Request funds on Solana devnet - Request funds from the CDP Faucet on Solana devnet. Faucets are available for SOL. To prevent abuse, we enforce rate limits within a rolling 24-hour window to control the amount of funds that can be requested. These limits are applied at both the CDP Project level and the blockchain address level. A single blockchain address cannot exceed the specified limits, even if multiple users submit requests to the same address. | Token | Amount per Faucet Request |Rolling 24-hour window Rate Limits| |:-----:|:-------------------------:|:--------------------------------:| | SOL | 0.00125 SOL | 0.0125 SOL | | USDC | 1 USDC | 10 USDC | + Request funds from the CDP Faucet on Solana devnet. Faucets are available for SOL, USDC, and CBTUSD. To prevent abuse, we enforce rate limits within a rolling 24-hour window to control the amount of funds that can be requested. These limits are applied at both the CDP Project level and the blockchain address level. A single blockchain address cannot exceed the specified limits, even if multiple users submit requests to the same address. | Token | Amount per Faucet Request |Rolling 24-hour window Rate Limits| |:-----: |:-------------------------:|:--------------------------------:| | SOL | 0.00125 SOL | 0.0125 SOL | | USDC | 1 USDC | 10 USDC | | CBTUSD | 1 CBTUSD | 10 CBTUSD | :param request_solana_faucet_request: :type request_solana_faucet_request: RequestSolanaFaucetRequest diff --git a/python/cdp/openapi_client/api/solana_accounts_api.py b/python/cdp/openapi_client/api/solana_accounts_api.py index 58041522b..2d67a5fec 100644 --- a/python/cdp/openapi_client/api/solana_accounts_api.py +++ b/python/cdp/openapi_client/api/solana_accounts_api.py @@ -25,12 +25,12 @@ from cdp.openapi_client.models.export_solana_account200_response import ExportSolanaAccount200Response from cdp.openapi_client.models.import_solana_account_request import ImportSolanaAccountRequest from cdp.openapi_client.models.list_solana_accounts200_response import ListSolanaAccounts200Response -from cdp.openapi_client.models.send_solana_transaction200_response import SendSolanaTransaction200Response from cdp.openapi_client.models.send_solana_transaction_request import SendSolanaTransactionRequest -from cdp.openapi_client.models.sign_solana_message200_response import SignSolanaMessage200Response +from cdp.openapi_client.models.send_solana_transaction_with_end_user_account200_response import SendSolanaTransactionWithEndUserAccount200Response from cdp.openapi_client.models.sign_solana_message_request import SignSolanaMessageRequest -from cdp.openapi_client.models.sign_solana_transaction200_response import SignSolanaTransaction200Response +from cdp.openapi_client.models.sign_solana_message_with_end_user_account200_response import SignSolanaMessageWithEndUserAccount200Response from cdp.openapi_client.models.sign_solana_transaction_request import SignSolanaTransactionRequest +from cdp.openapi_client.models.sign_solana_transaction_with_end_user_account200_response import SignSolanaTransactionWithEndUserAccount200Response from cdp.openapi_client.models.solana_account import SolanaAccount from cdp.openapi_client.models.update_solana_account_request import UpdateSolanaAccountRequest @@ -2253,7 +2253,7 @@ async def send_solana_transaction( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> SendSolanaTransaction200Response: + ) -> SendSolanaTransactionWithEndUserAccount200Response: """Send a Solana transaction Signs and sends a single Solana transaction using multiple Solana accounts. The transaction may contain contain several instructions, each of which may require signatures from different account keys. The transaction should be serialized into a byte array and base64 encoded. The API handles recent blockhash management and fee estimation, leaving the developer to provide only the minimal set of fields necessary to send the transaction. **Transaction types** The following transaction types are supported: * [Legacy transactions](https://solana.com/developers/guides/advanced/versions#current-transaction-versions) * [Versioned transactions](https://solana.com/developers/guides/advanced/versions) **Instruction Batching** To batch multiple operations, include multiple instructions within a single transaction. All instructions within a transaction are executed atomically - if any instruction fails, the entire transaction fails and is rolled back. **Network Support** The following Solana networks are supported: * `solana` - Solana Mainnet * `solana-devnet` - Solana Devnet The developer is responsible for ensuring that the unsigned transaction is valid, as the API will not validate the transaction. @@ -2297,7 +2297,7 @@ async def send_solana_transaction( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "SendSolanaTransaction200Response", + '200': "SendSolanaTransactionWithEndUserAccount200Response", '400': "Error", '401': "Error", '402': "Error", @@ -2337,7 +2337,7 @@ async def send_solana_transaction_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[SendSolanaTransaction200Response]: + ) -> ApiResponse[SendSolanaTransactionWithEndUserAccount200Response]: """Send a Solana transaction Signs and sends a single Solana transaction using multiple Solana accounts. The transaction may contain contain several instructions, each of which may require signatures from different account keys. The transaction should be serialized into a byte array and base64 encoded. The API handles recent blockhash management and fee estimation, leaving the developer to provide only the minimal set of fields necessary to send the transaction. **Transaction types** The following transaction types are supported: * [Legacy transactions](https://solana.com/developers/guides/advanced/versions#current-transaction-versions) * [Versioned transactions](https://solana.com/developers/guides/advanced/versions) **Instruction Batching** To batch multiple operations, include multiple instructions within a single transaction. All instructions within a transaction are executed atomically - if any instruction fails, the entire transaction fails and is rolled back. **Network Support** The following Solana networks are supported: * `solana` - Solana Mainnet * `solana-devnet` - Solana Devnet The developer is responsible for ensuring that the unsigned transaction is valid, as the API will not validate the transaction. @@ -2381,7 +2381,7 @@ async def send_solana_transaction_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "SendSolanaTransaction200Response", + '200': "SendSolanaTransactionWithEndUserAccount200Response", '400': "Error", '401': "Error", '402': "Error", @@ -2465,7 +2465,7 @@ async def send_solana_transaction_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "SendSolanaTransaction200Response", + '200': "SendSolanaTransactionWithEndUserAccount200Response", '400': "Error", '401': "Error", '402': "Error", @@ -2585,7 +2585,7 @@ async def sign_solana_message( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> SignSolanaMessage200Response: + ) -> SignSolanaMessageWithEndUserAccount200Response: """Sign a message Signs an arbitrary message with the given Solana account. **WARNING:** Never sign a message that you didn't generate, as it can be an arbitrary transaction. For example, it might send all of your funds to an attacker. @@ -2632,7 +2632,7 @@ async def sign_solana_message( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "SignSolanaMessage200Response", + '200': "SignSolanaMessageWithEndUserAccount200Response", '400': "Error", '401': "Error", '402': "Error", @@ -2673,7 +2673,7 @@ async def sign_solana_message_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[SignSolanaMessage200Response]: + ) -> ApiResponse[SignSolanaMessageWithEndUserAccount200Response]: """Sign a message Signs an arbitrary message with the given Solana account. **WARNING:** Never sign a message that you didn't generate, as it can be an arbitrary transaction. For example, it might send all of your funds to an attacker. @@ -2720,7 +2720,7 @@ async def sign_solana_message_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "SignSolanaMessage200Response", + '200': "SignSolanaMessageWithEndUserAccount200Response", '400': "Error", '401': "Error", '402': "Error", @@ -2808,7 +2808,7 @@ async def sign_solana_message_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "SignSolanaMessage200Response", + '200': "SignSolanaMessageWithEndUserAccount200Response", '400': "Error", '401': "Error", '402': "Error", @@ -2931,7 +2931,7 @@ async def sign_solana_transaction( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> SignSolanaTransaction200Response: + ) -> SignSolanaTransactionWithEndUserAccount200Response: """Sign a transaction Signs a transaction with the given Solana account. The unsigned transaction should be serialized into a byte array and then encoded as base64. **Transaction types** The following transaction types are supported: * [Legacy transactions](https://solana-labs.github.io/solana-web3.js/classes/Transaction.html) * [Versioned transactions](https://solana-labs.github.io/solana-web3.js/classes/VersionedTransaction.html) The developer is responsible for ensuring that the unsigned transaction is valid, as the API will not validate the transaction. @@ -2978,7 +2978,7 @@ async def sign_solana_transaction( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "SignSolanaTransaction200Response", + '200': "SignSolanaTransactionWithEndUserAccount200Response", '400': "Error", '401': "Error", '402': "Error", @@ -3020,7 +3020,7 @@ async def sign_solana_transaction_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[SignSolanaTransaction200Response]: + ) -> ApiResponse[SignSolanaTransactionWithEndUserAccount200Response]: """Sign a transaction Signs a transaction with the given Solana account. The unsigned transaction should be serialized into a byte array and then encoded as base64. **Transaction types** The following transaction types are supported: * [Legacy transactions](https://solana-labs.github.io/solana-web3.js/classes/Transaction.html) * [Versioned transactions](https://solana-labs.github.io/solana-web3.js/classes/VersionedTransaction.html) The developer is responsible for ensuring that the unsigned transaction is valid, as the API will not validate the transaction. @@ -3067,7 +3067,7 @@ async def sign_solana_transaction_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "SignSolanaTransaction200Response", + '200': "SignSolanaTransactionWithEndUserAccount200Response", '400': "Error", '401': "Error", '402': "Error", @@ -3156,7 +3156,7 @@ async def sign_solana_transaction_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "SignSolanaTransaction200Response", + '200': "SignSolanaTransactionWithEndUserAccount200Response", '400': "Error", '401': "Error", '402': "Error", diff --git a/python/cdp/openapi_client/api/sqlapi_alpha_api.py b/python/cdp/openapi_client/api/sqlapi_api.py similarity index 76% rename from python/cdp/openapi_client/api/sqlapi_alpha_api.py rename to python/cdp/openapi_client/api/sqlapi_api.py index 3b71b0a07..90c0f3ccb 100644 --- a/python/cdp/openapi_client/api/sqlapi_alpha_api.py +++ b/python/cdp/openapi_client/api/sqlapi_api.py @@ -26,7 +26,7 @@ from cdp.openapi_client.rest import RESTResponseType -class SQLAPIAlphaApi: +class SQLAPIApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech @@ -57,7 +57,7 @@ async def get_sql_grammar( ) -> str: """Get SQL grammar - Retrieve the SQL grammar for the SQL API. The SQL queries that are supported by the SQL API are defined via an ANTLR4 grammar which is evaluated by server before executing the query. This ensures the safety and soundness of the SQL API. This endpoint returns the ANTLR4 grammar that is used to evaluate the SQL queries so that developers can understand the SQL API and build SQL queries with high confidence and correctness. LLMs interact well with ANTLR4 grammar as well. + Retrieve the SQL grammar for the SQL API. The SQL queries that are supported by the SQL API are defined in ANTLR4 grammar which is evaluated by server before executing the query. This ensures the safety and soundness of the SQL query before execution. This endpoint returns the ANTLR4 grammar that is used to evaluate the SQL queries so that developers can understand the SQL API and build SQL queries with high confidence and correctness. LLMs interact well with ANTLR4 grammar. You can feed the grammar directly into the LLMs to help generate SQL queries. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -124,7 +124,7 @@ async def get_sql_grammar_with_http_info( ) -> ApiResponse[str]: """Get SQL grammar - Retrieve the SQL grammar for the SQL API. The SQL queries that are supported by the SQL API are defined via an ANTLR4 grammar which is evaluated by server before executing the query. This ensures the safety and soundness of the SQL API. This endpoint returns the ANTLR4 grammar that is used to evaluate the SQL queries so that developers can understand the SQL API and build SQL queries with high confidence and correctness. LLMs interact well with ANTLR4 grammar as well. + Retrieve the SQL grammar for the SQL API. The SQL queries that are supported by the SQL API are defined in ANTLR4 grammar which is evaluated by server before executing the query. This ensures the safety and soundness of the SQL query before execution. This endpoint returns the ANTLR4 grammar that is used to evaluate the SQL queries so that developers can understand the SQL API and build SQL queries with high confidence and correctness. LLMs interact well with ANTLR4 grammar. You can feed the grammar directly into the LLMs to help generate SQL queries. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -191,7 +191,7 @@ async def get_sql_grammar_without_preload_content( ) -> RESTResponseType: """Get SQL grammar - Retrieve the SQL grammar for the SQL API. The SQL queries that are supported by the SQL API are defined via an ANTLR4 grammar which is evaluated by server before executing the query. This ensures the safety and soundness of the SQL API. This endpoint returns the ANTLR4 grammar that is used to evaluate the SQL queries so that developers can understand the SQL API and build SQL queries with high confidence and correctness. LLMs interact well with ANTLR4 grammar as well. + Retrieve the SQL grammar for the SQL API. The SQL queries that are supported by the SQL API are defined in ANTLR4 grammar which is evaluated by server before executing the query. This ensures the safety and soundness of the SQL query before execution. This endpoint returns the ANTLR4 grammar that is used to evaluate the SQL queries so that developers can understand the SQL API and build SQL queries with high confidence and correctness. LLMs interact well with ANTLR4 grammar. You can feed the grammar directly into the LLMs to help generate SQL queries. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -316,7 +316,7 @@ async def run_sql_query( ) -> OnchainDataResult: """Run SQL Query - Run a read-only SQL query against indexed blockchain data including transactions, events, and decoded logs. This endpoint provides direct SQL access to comprehensive blockchain data across supported networks. Queries are executed against optimized data structures for high-performance analytics. ### Allowed Queries - Standard SQL syntax (ClickHouse dialect) - Read-only queries (SELECT statements) - No DDL or DML operations - No cartesian products ### Supported Tables - `base.events` - Base mainnet decoded event logs with parameters, event signature, topics, and more. - `base.transactions` - Base mainnet transaction data including hash, block number, gas usage. - `base.blocks` - Base mainnet block information. - `base.encoded_logs` - Encoded log data of event logs that aren't able to be decoded by our event decoder (ex: log0 opcode). - `base.transfers` - All event logs with event signature `Transfer(address,address,uint256)`. ERC-20, ERC-721, and ERC-1155 transfers are all included. ### Query Limits - Maximum result set: 100,000 rows - Query timeout: 30 seconds + Run a read-only SQL query against indexed blockchain data including transactions, events, and decoded logs. This endpoint provides direct SQL access to comprehensive blockchain data across supported networks. Queries are executed against optimized data structures for high-performance analytics. ### Allowed Queries - Standard SQL syntax (CoinbaSeQL dialect, based on ClickHouse dialect) - Read-only queries (SELECT statements) - No DDL or DML operations - Query that follow limits (defined below) ### Supported Tables - `.events` - Base mainnet decoded event logs with parameters, event signature, topics, and more. - `.transactions` - Base mainnet transaction data including hash, block number, gas usage. - `.blocks` - Base mainnet block information. - `.encoded_logs` - Encoded log data of event logs that aren't able to be decoded by our event decoder (ex: log0 opcode). - `.decoded_user_operations` - Decoded user operations data including hash, block number, gas usage, builder codes, entrypoint version, and more. - `.transaction_attributions` - Information about the attributions of a transaction to a builder and associated builder codes. ### Supported Networks - Base Mainnet: `base` - Base Sepolia: `base_sepolia` So for example, valid tables are: `base.events`, `base_sepolia.events`, `base.transactions`, etc. ### Query Limits - Maximum result set: 50,000 rows - Maximum query length: 10,000 characters - Maximum on-disk data to read: 100GB - Maximum memory usage: 15GB - Query timeout: 30 seconds - Maximum JOINs: 12 ### Query Caching By default, each query result is returned from cache so long as the result is from an identical query and less than 750ms old. This freshness tolerance can be modified upwards, to a maximum of 900000ms (i.e. 900s, 15m). This can be helpful for users who wish to reduce expensive calls to the SQL API by reusing cached results. :param onchain_data_query: (required) :type onchain_data_query: OnchainDataQuery @@ -354,6 +354,7 @@ async def run_sql_query( '200': "OnchainDataResult", '400': "Error", '401': "Error", + '402': "Error", '408': "Error", '429': "Error", '499': "Error", @@ -390,7 +391,7 @@ async def run_sql_query_with_http_info( ) -> ApiResponse[OnchainDataResult]: """Run SQL Query - Run a read-only SQL query against indexed blockchain data including transactions, events, and decoded logs. This endpoint provides direct SQL access to comprehensive blockchain data across supported networks. Queries are executed against optimized data structures for high-performance analytics. ### Allowed Queries - Standard SQL syntax (ClickHouse dialect) - Read-only queries (SELECT statements) - No DDL or DML operations - No cartesian products ### Supported Tables - `base.events` - Base mainnet decoded event logs with parameters, event signature, topics, and more. - `base.transactions` - Base mainnet transaction data including hash, block number, gas usage. - `base.blocks` - Base mainnet block information. - `base.encoded_logs` - Encoded log data of event logs that aren't able to be decoded by our event decoder (ex: log0 opcode). - `base.transfers` - All event logs with event signature `Transfer(address,address,uint256)`. ERC-20, ERC-721, and ERC-1155 transfers are all included. ### Query Limits - Maximum result set: 100,000 rows - Query timeout: 30 seconds + Run a read-only SQL query against indexed blockchain data including transactions, events, and decoded logs. This endpoint provides direct SQL access to comprehensive blockchain data across supported networks. Queries are executed against optimized data structures for high-performance analytics. ### Allowed Queries - Standard SQL syntax (CoinbaSeQL dialect, based on ClickHouse dialect) - Read-only queries (SELECT statements) - No DDL or DML operations - Query that follow limits (defined below) ### Supported Tables - `.events` - Base mainnet decoded event logs with parameters, event signature, topics, and more. - `.transactions` - Base mainnet transaction data including hash, block number, gas usage. - `.blocks` - Base mainnet block information. - `.encoded_logs` - Encoded log data of event logs that aren't able to be decoded by our event decoder (ex: log0 opcode). - `.decoded_user_operations` - Decoded user operations data including hash, block number, gas usage, builder codes, entrypoint version, and more. - `.transaction_attributions` - Information about the attributions of a transaction to a builder and associated builder codes. ### Supported Networks - Base Mainnet: `base` - Base Sepolia: `base_sepolia` So for example, valid tables are: `base.events`, `base_sepolia.events`, `base.transactions`, etc. ### Query Limits - Maximum result set: 50,000 rows - Maximum query length: 10,000 characters - Maximum on-disk data to read: 100GB - Maximum memory usage: 15GB - Query timeout: 30 seconds - Maximum JOINs: 12 ### Query Caching By default, each query result is returned from cache so long as the result is from an identical query and less than 750ms old. This freshness tolerance can be modified upwards, to a maximum of 900000ms (i.e. 900s, 15m). This can be helpful for users who wish to reduce expensive calls to the SQL API by reusing cached results. :param onchain_data_query: (required) :type onchain_data_query: OnchainDataQuery @@ -428,6 +429,7 @@ async def run_sql_query_with_http_info( '200': "OnchainDataResult", '400': "Error", '401': "Error", + '402': "Error", '408': "Error", '429': "Error", '499': "Error", @@ -464,7 +466,7 @@ async def run_sql_query_without_preload_content( ) -> RESTResponseType: """Run SQL Query - Run a read-only SQL query against indexed blockchain data including transactions, events, and decoded logs. This endpoint provides direct SQL access to comprehensive blockchain data across supported networks. Queries are executed against optimized data structures for high-performance analytics. ### Allowed Queries - Standard SQL syntax (ClickHouse dialect) - Read-only queries (SELECT statements) - No DDL or DML operations - No cartesian products ### Supported Tables - `base.events` - Base mainnet decoded event logs with parameters, event signature, topics, and more. - `base.transactions` - Base mainnet transaction data including hash, block number, gas usage. - `base.blocks` - Base mainnet block information. - `base.encoded_logs` - Encoded log data of event logs that aren't able to be decoded by our event decoder (ex: log0 opcode). - `base.transfers` - All event logs with event signature `Transfer(address,address,uint256)`. ERC-20, ERC-721, and ERC-1155 transfers are all included. ### Query Limits - Maximum result set: 100,000 rows - Query timeout: 30 seconds + Run a read-only SQL query against indexed blockchain data including transactions, events, and decoded logs. This endpoint provides direct SQL access to comprehensive blockchain data across supported networks. Queries are executed against optimized data structures for high-performance analytics. ### Allowed Queries - Standard SQL syntax (CoinbaSeQL dialect, based on ClickHouse dialect) - Read-only queries (SELECT statements) - No DDL or DML operations - Query that follow limits (defined below) ### Supported Tables - `.events` - Base mainnet decoded event logs with parameters, event signature, topics, and more. - `.transactions` - Base mainnet transaction data including hash, block number, gas usage. - `.blocks` - Base mainnet block information. - `.encoded_logs` - Encoded log data of event logs that aren't able to be decoded by our event decoder (ex: log0 opcode). - `.decoded_user_operations` - Decoded user operations data including hash, block number, gas usage, builder codes, entrypoint version, and more. - `.transaction_attributions` - Information about the attributions of a transaction to a builder and associated builder codes. ### Supported Networks - Base Mainnet: `base` - Base Sepolia: `base_sepolia` So for example, valid tables are: `base.events`, `base_sepolia.events`, `base.transactions`, etc. ### Query Limits - Maximum result set: 50,000 rows - Maximum query length: 10,000 characters - Maximum on-disk data to read: 100GB - Maximum memory usage: 15GB - Query timeout: 30 seconds - Maximum JOINs: 12 ### Query Caching By default, each query result is returned from cache so long as the result is from an identical query and less than 750ms old. This freshness tolerance can be modified upwards, to a maximum of 900000ms (i.e. 900s, 15m). This can be helpful for users who wish to reduce expensive calls to the SQL API by reusing cached results. :param onchain_data_query: (required) :type onchain_data_query: OnchainDataQuery @@ -502,6 +504,7 @@ async def run_sql_query_without_preload_content( '200': "OnchainDataResult", '400': "Error", '401': "Error", + '402': "Error", '408': "Error", '429': "Error", '499': "Error", diff --git a/python/cdp/openapi_client/configuration.py b/python/cdp/openapi_client/configuration.py index 12217bc45..4dc35779a 100644 --- a/python/cdp/openapi_client/configuration.py +++ b/python/cdp/openapi_client/configuration.py @@ -114,6 +114,7 @@ "AuthSettings", { "apiKeyAuth": BearerFormatAuthSetting, + "endUserAuth": BearerFormatAuthSetting, }, total=False, ) @@ -490,6 +491,14 @@ def auth_settings(self)-> AuthSettings: 'key': 'Authorization', 'value': 'Bearer ' + self.access_token } + if self.access_token is not None: + auth['endUserAuth'] = { + 'type': 'bearer', + 'in': 'header', + 'format': 'JWT', + 'key': 'Authorization', + 'value': 'Bearer ' + self.access_token + } return auth def to_debug_report(self) -> str: @@ -513,6 +522,10 @@ def get_host_settings(self) -> List[HostSetting]: { 'url': "https://api.cdp.coinbase.com/platform", 'description': "The production server of the CDP APIs.", + }, + { + 'url': "https://api.cdp.coinbase.com/platform/delegated", + 'description': "The production server of the CDP Embedded Wallet APIs for delegated signing operations.", } ] diff --git a/python/cdp/openapi_client/models/__init__.py b/python/cdp/openapi_client/models/__init__.py index 9fa7f21f4..4dcc6d4f7 100644 --- a/python/cdp/openapi_client/models/__init__.py +++ b/python/cdp/openapi_client/models/__init__.py @@ -35,8 +35,9 @@ from cdp.openapi_client.models.create_end_user_request_evm_account import CreateEndUserRequestEvmAccount from cdp.openapi_client.models.create_end_user_request_solana_account import CreateEndUserRequestSolanaAccount from cdp.openapi_client.models.create_evm_account_request import CreateEvmAccountRequest -from cdp.openapi_client.models.create_evm_eip7702_delegation201_response import CreateEvmEip7702Delegation201Response from cdp.openapi_client.models.create_evm_eip7702_delegation_request import CreateEvmEip7702DelegationRequest +from cdp.openapi_client.models.create_evm_eip7702_delegation_with_end_user_account201_response import CreateEvmEip7702DelegationWithEndUserAccount201Response +from cdp.openapi_client.models.create_evm_eip7702_delegation_with_end_user_account_request import CreateEvmEip7702DelegationWithEndUserAccountRequest from cdp.openapi_client.models.create_evm_smart_account_request import CreateEvmSmartAccountRequest from cdp.openapi_client.models.create_evm_swap_quote_request import CreateEvmSwapQuoteRequest from cdp.openapi_client.models.create_onramp_order201_response import CreateOnrampOrder201Response @@ -75,6 +76,7 @@ from cdp.openapi_client.models.evm_message_criterion import EvmMessageCriterion from cdp.openapi_client.models.evm_network_criterion import EvmNetworkCriterion from cdp.openapi_client.models.evm_smart_account import EvmSmartAccount +from cdp.openapi_client.models.evm_spend_permissions_revoke_spend_permission_request import EvmSpendPermissionsRevokeSpendPermissionRequest from cdp.openapi_client.models.evm_swaps_network import EvmSwapsNetwork from cdp.openapi_client.models.evm_typed_address_condition import EvmTypedAddressCondition from cdp.openapi_client.models.evm_typed_numerical_condition import EvmTypedNumericalCondition @@ -147,37 +149,46 @@ from cdp.openapi_client.models.request_evm_faucet_request import RequestEvmFaucetRequest from cdp.openapi_client.models.request_solana_faucet200_response import RequestSolanaFaucet200Response from cdp.openapi_client.models.request_solana_faucet_request import RequestSolanaFaucetRequest +from cdp.openapi_client.models.revoke_delegation_for_end_user_request import RevokeDelegationForEndUserRequest from cdp.openapi_client.models.revoke_spend_permission_request import RevokeSpendPermissionRequest from cdp.openapi_client.models.rule import Rule from cdp.openapi_client.models.send_end_user_evm_transaction_rule import SendEndUserEvmTransactionRule from cdp.openapi_client.models.send_end_user_sol_transaction_rule import SendEndUserSolTransactionRule -from cdp.openapi_client.models.send_evm_transaction200_response import SendEvmTransaction200Response +from cdp.openapi_client.models.send_evm_asset_with_end_user_account200_response import SendEvmAssetWithEndUserAccount200Response +from cdp.openapi_client.models.send_evm_asset_with_end_user_account_request import SendEvmAssetWithEndUserAccountRequest from cdp.openapi_client.models.send_evm_transaction_criteria_inner import SendEvmTransactionCriteriaInner from cdp.openapi_client.models.send_evm_transaction_request import SendEvmTransactionRequest from cdp.openapi_client.models.send_evm_transaction_rule import SendEvmTransactionRule +from cdp.openapi_client.models.send_evm_transaction_with_end_user_account200_response import SendEvmTransactionWithEndUserAccount200Response +from cdp.openapi_client.models.send_evm_transaction_with_end_user_account_request import SendEvmTransactionWithEndUserAccountRequest from cdp.openapi_client.models.send_sol_transaction_criteria_inner import SendSolTransactionCriteriaInner from cdp.openapi_client.models.send_sol_transaction_rule import SendSolTransactionRule -from cdp.openapi_client.models.send_solana_transaction200_response import SendSolanaTransaction200Response +from cdp.openapi_client.models.send_solana_asset_with_end_user_account_request import SendSolanaAssetWithEndUserAccountRequest from cdp.openapi_client.models.send_solana_transaction_request import SendSolanaTransactionRequest +from cdp.openapi_client.models.send_solana_transaction_with_end_user_account200_response import SendSolanaTransactionWithEndUserAccount200Response +from cdp.openapi_client.models.send_solana_transaction_with_end_user_account_request import SendSolanaTransactionWithEndUserAccountRequest from cdp.openapi_client.models.send_user_operation_request import SendUserOperationRequest from cdp.openapi_client.models.send_user_operation_rule import SendUserOperationRule +from cdp.openapi_client.models.send_user_operation_with_end_user_account_request import SendUserOperationWithEndUserAccountRequest from cdp.openapi_client.models.sign_end_user_evm_message_rule import SignEndUserEvmMessageRule from cdp.openapi_client.models.sign_end_user_evm_transaction_rule import SignEndUserEvmTransactionRule from cdp.openapi_client.models.sign_end_user_evm_typed_data_rule import SignEndUserEvmTypedDataRule from cdp.openapi_client.models.sign_end_user_sol_message_rule import SignEndUserSolMessageRule from cdp.openapi_client.models.sign_end_user_sol_transaction_rule import SignEndUserSolTransactionRule -from cdp.openapi_client.models.sign_evm_hash200_response import SignEvmHash200Response from cdp.openapi_client.models.sign_evm_hash_request import SignEvmHashRequest from cdp.openapi_client.models.sign_evm_hash_rule import SignEvmHashRule -from cdp.openapi_client.models.sign_evm_message200_response import SignEvmMessage200Response +from cdp.openapi_client.models.sign_evm_hash_with_end_user_account200_response import SignEvmHashWithEndUserAccount200Response +from cdp.openapi_client.models.sign_evm_hash_with_end_user_account_request import SignEvmHashWithEndUserAccountRequest from cdp.openapi_client.models.sign_evm_message_criteria_inner import SignEvmMessageCriteriaInner from cdp.openapi_client.models.sign_evm_message_request import SignEvmMessageRequest from cdp.openapi_client.models.sign_evm_message_rule import SignEvmMessageRule -from cdp.openapi_client.models.sign_evm_transaction200_response import SignEvmTransaction200Response +from cdp.openapi_client.models.sign_evm_message_with_end_user_account200_response import SignEvmMessageWithEndUserAccount200Response +from cdp.openapi_client.models.sign_evm_message_with_end_user_account_request import SignEvmMessageWithEndUserAccountRequest from cdp.openapi_client.models.sign_evm_transaction_criteria_inner import SignEvmTransactionCriteriaInner from cdp.openapi_client.models.sign_evm_transaction_request import SignEvmTransactionRequest from cdp.openapi_client.models.sign_evm_transaction_rule import SignEvmTransactionRule -from cdp.openapi_client.models.sign_evm_typed_data200_response import SignEvmTypedData200Response +from cdp.openapi_client.models.sign_evm_transaction_with_end_user_account200_response import SignEvmTransactionWithEndUserAccount200Response +from cdp.openapi_client.models.sign_evm_transaction_with_end_user_account_request import SignEvmTransactionWithEndUserAccountRequest from cdp.openapi_client.models.sign_evm_typed_data_criteria_inner import SignEvmTypedDataCriteriaInner from cdp.openapi_client.models.sign_evm_typed_data_field_criterion import SignEvmTypedDataFieldCriterion from cdp.openapi_client.models.sign_evm_typed_data_field_criterion_conditions_inner import SignEvmTypedDataFieldCriterionConditionsInner @@ -185,14 +196,20 @@ from cdp.openapi_client.models.sign_evm_typed_data_field_criterion_types_types_value_inner import SignEvmTypedDataFieldCriterionTypesTypesValueInner from cdp.openapi_client.models.sign_evm_typed_data_rule import SignEvmTypedDataRule from cdp.openapi_client.models.sign_evm_typed_data_verifying_contract_criterion import SignEvmTypedDataVerifyingContractCriterion +from cdp.openapi_client.models.sign_evm_typed_data_with_end_user_account200_response import SignEvmTypedDataWithEndUserAccount200Response +from cdp.openapi_client.models.sign_evm_typed_data_with_end_user_account_request import SignEvmTypedDataWithEndUserAccountRequest from cdp.openapi_client.models.sign_sol_message_criteria_inner import SignSolMessageCriteriaInner from cdp.openapi_client.models.sign_sol_message_rule import SignSolMessageRule from cdp.openapi_client.models.sign_sol_transaction_criteria_inner import SignSolTransactionCriteriaInner from cdp.openapi_client.models.sign_sol_transaction_rule import SignSolTransactionRule -from cdp.openapi_client.models.sign_solana_message200_response import SignSolanaMessage200Response +from cdp.openapi_client.models.sign_solana_hash_with_end_user_account200_response import SignSolanaHashWithEndUserAccount200Response +from cdp.openapi_client.models.sign_solana_hash_with_end_user_account_request import SignSolanaHashWithEndUserAccountRequest from cdp.openapi_client.models.sign_solana_message_request import SignSolanaMessageRequest -from cdp.openapi_client.models.sign_solana_transaction200_response import SignSolanaTransaction200Response +from cdp.openapi_client.models.sign_solana_message_with_end_user_account200_response import SignSolanaMessageWithEndUserAccount200Response +from cdp.openapi_client.models.sign_solana_message_with_end_user_account_request import SignSolanaMessageWithEndUserAccountRequest from cdp.openapi_client.models.sign_solana_transaction_request import SignSolanaTransactionRequest +from cdp.openapi_client.models.sign_solana_transaction_with_end_user_account200_response import SignSolanaTransactionWithEndUserAccount200Response +from cdp.openapi_client.models.sign_solana_transaction_with_end_user_account_request import SignSolanaTransactionWithEndUserAccountRequest from cdp.openapi_client.models.sms_authentication import SmsAuthentication from cdp.openapi_client.models.sol_address_criterion import SolAddressCriterion from cdp.openapi_client.models.sol_data_condition import SolDataCondition @@ -247,9 +264,9 @@ from cdp.openapi_client.models.x402_settle_payment_rejection import X402SettlePaymentRejection from cdp.openapi_client.models.x402_supported_payment_kind import X402SupportedPaymentKind from cdp.openapi_client.models.x402_v1_payment_payload import X402V1PaymentPayload -from cdp.openapi_client.models.x402_v1_payment_payload_payload import X402V1PaymentPayloadPayload from cdp.openapi_client.models.x402_v1_payment_requirements import X402V1PaymentRequirements from cdp.openapi_client.models.x402_v2_payment_payload import X402V2PaymentPayload +from cdp.openapi_client.models.x402_v2_payment_payload_payload import X402V2PaymentPayloadPayload from cdp.openapi_client.models.x402_v2_payment_requirements import X402V2PaymentRequirements from cdp.openapi_client.models.x402_verify_invalid_reason import X402VerifyInvalidReason from cdp.openapi_client.models.x402_verify_payment_rejection import X402VerifyPaymentRejection diff --git a/python/cdp/openapi_client/models/create_evm_eip7702_delegation201_response.py b/python/cdp/openapi_client/models/create_evm_eip7702_delegation_with_end_user_account201_response.py similarity index 87% rename from python/cdp/openapi_client/models/create_evm_eip7702_delegation201_response.py rename to python/cdp/openapi_client/models/create_evm_eip7702_delegation_with_end_user_account201_response.py index e8b9af9da..88c490424 100644 --- a/python/cdp/openapi_client/models/create_evm_eip7702_delegation201_response.py +++ b/python/cdp/openapi_client/models/create_evm_eip7702_delegation_with_end_user_account201_response.py @@ -23,9 +23,9 @@ from typing import Optional, Set from typing_extensions import Self -class CreateEvmEip7702Delegation201Response(BaseModel): +class CreateEvmEip7702DelegationWithEndUserAccount201Response(BaseModel): """ - CreateEvmEip7702Delegation201Response + CreateEvmEip7702DelegationWithEndUserAccount201Response """ # noqa: E501 delegation_operation_id: StrictStr = Field(description="The unique identifier for the delegation operation. Use this to poll the operation status.", alias="delegationOperationId") __properties: ClassVar[List[str]] = ["delegationOperationId"] @@ -48,7 +48,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of CreateEvmEip7702Delegation201Response from a JSON string""" + """Create an instance of CreateEvmEip7702DelegationWithEndUserAccount201Response from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -73,7 +73,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of CreateEvmEip7702Delegation201Response from a dict""" + """Create an instance of CreateEvmEip7702DelegationWithEndUserAccount201Response from a dict""" if obj is None: return None diff --git a/python/cdp/openapi_client/models/create_evm_eip7702_delegation_with_end_user_account_request.py b/python/cdp/openapi_client/models/create_evm_eip7702_delegation_with_end_user_account_request.py new file mode 100644 index 000000000..ae22f36ef --- /dev/null +++ b/python/cdp/openapi_client/models/create_evm_eip7702_delegation_with_end_user_account_request.py @@ -0,0 +1,113 @@ +# coding: utf-8 + +""" + Coinbase Developer Platform APIs + + The Coinbase Developer Platform APIs - leading the world's transition onchain. + + The version of the OpenAPI document: 2.0.0 + Contact: cdp@coinbase.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from cdp.openapi_client.models.evm_eip7702_delegation_network import EvmEip7702DelegationNetwork +from typing import Optional, Set +from typing_extensions import Self + +class CreateEvmEip7702DelegationWithEndUserAccountRequest(BaseModel): + """ + CreateEvmEip7702DelegationWithEndUserAccountRequest + """ # noqa: E501 + address: Annotated[str, Field(strict=True)] = Field(description="The 0x-prefixed address of the EVM account to delegate.") + network: EvmEip7702DelegationNetwork + enable_spend_permissions: Optional[StrictBool] = Field(default=False, description="Whether to configure spend permissions for the upgraded, delegated account. When enabled, the account can grant permissions for third parties to spend on its behalf.", alias="enableSpendPermissions") + wallet_secret_id: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header.", alias="walletSecretId") + __properties: ClassVar[List[str]] = ["address", "network", "enableSpendPermissions", "walletSecretId"] + + @field_validator('address') + def address_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^0x[0-9a-fA-F]{40}$", value): + raise ValueError(r"must validate the regular expression /^0x[0-9a-fA-F]{40}$/") + return value + + @field_validator('wallet_secret_id') + def wallet_secret_id_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match(r"^[a-zA-Z0-9-]{1,100}$", value): + raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9-]{1,100}$/") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreateEvmEip7702DelegationWithEndUserAccountRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateEvmEip7702DelegationWithEndUserAccountRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "address": obj.get("address"), + "network": obj.get("network"), + "enableSpendPermissions": obj.get("enableSpendPermissions") if obj.get("enableSpendPermissions") is not None else False, + "walletSecretId": obj.get("walletSecretId") + }) + return _obj + + diff --git a/python/cdp/openapi_client/models/error_type.py b/python/cdp/openapi_client/models/error_type.py index a83d1c314..3f6c9d42a 100644 --- a/python/cdp/openapi_client/models/error_type.py +++ b/python/cdp/openapi_client/models/error_type.py @@ -85,6 +85,9 @@ class ErrorType(str, Enum): ORDER_ALREADY_FILLED = 'order_already_filled' ORDER_ALREADY_CANCELED = 'order_already_canceled' ACCOUNT_NOT_READY = 'account_not_ready' + INSUFFICIENT_LIQUIDITY = 'insufficient_liquidity' + INSUFFICIENT_ALLOWANCE = 'insufficient_allowance' + TRANSACTION_SIMULATION_FAILED = 'transaction_simulation_failed' @classmethod def from_json(cls, json_str: str) -> Self: diff --git a/python/cdp/openapi_client/models/evm_spend_permissions_revoke_spend_permission_request.py b/python/cdp/openapi_client/models/evm_spend_permissions_revoke_spend_permission_request.py new file mode 100644 index 000000000..7e7c2bb79 --- /dev/null +++ b/python/cdp/openapi_client/models/evm_spend_permissions_revoke_spend_permission_request.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Coinbase Developer Platform APIs + + The Coinbase Developer Platform APIs - leading the world's transition onchain. + + The version of the OpenAPI document: 2.0.0 + Contact: cdp@coinbase.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from cdp.openapi_client.models.spend_permission_network import SpendPermissionNetwork +from typing import Optional, Set +from typing_extensions import Self + +class EvmSpendPermissionsRevokeSpendPermissionRequest(BaseModel): + """ + Request parameters for revoking a Spend Permission. + """ # noqa: E501 + network: SpendPermissionNetwork + permission_hash: StrictStr = Field(description="The hash of the spend permission to revoke.", alias="permissionHash") + paymaster_url: Optional[Annotated[str, Field(min_length=11, strict=True, max_length=2048)]] = Field(default=None, description="The paymaster URL of the spend permission.", alias="paymasterUrl") + __properties: ClassVar[List[str]] = ["network", "permissionHash", "paymasterUrl"] + + @field_validator('paymaster_url') + def paymaster_url_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match(r"^https?:\/\/.*$", value): + raise ValueError(r"must validate the regular expression /^https?:\/\/.*$/") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of EvmSpendPermissionsRevokeSpendPermissionRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EvmSpendPermissionsRevokeSpendPermissionRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "network": obj.get("network"), + "permissionHash": obj.get("permissionHash"), + "paymasterUrl": obj.get("paymasterUrl") + }) + return _obj + + diff --git a/python/cdp/openapi_client/models/o_auth2_provider_type.py b/python/cdp/openapi_client/models/o_auth2_provider_type.py index eb6a6dcf5..f7b6c120a 100644 --- a/python/cdp/openapi_client/models/o_auth2_provider_type.py +++ b/python/cdp/openapi_client/models/o_auth2_provider_type.py @@ -31,6 +31,7 @@ class OAuth2ProviderType(str, Enum): APPLE = 'apple' X = 'x' TELEGRAM = 'telegram' + GITHUB = 'github' @classmethod def from_json(cls, json_str: str) -> Self: diff --git a/python/cdp/openapi_client/models/request_solana_faucet_request.py b/python/cdp/openapi_client/models/request_solana_faucet_request.py index 21a349ddf..1dc2b0e3d 100644 --- a/python/cdp/openapi_client/models/request_solana_faucet_request.py +++ b/python/cdp/openapi_client/models/request_solana_faucet_request.py @@ -42,8 +42,8 @@ def address_validate_regular_expression(cls, value): @field_validator('token') def token_validate_enum(cls, value): """Validates the enum""" - if value not in set(['sol', 'usdc']): - raise ValueError("must be one of enum values ('sol', 'usdc')") + if value not in set(['sol', 'usdc', 'cbtusd']): + raise ValueError("must be one of enum values ('sol', 'usdc', 'cbtusd')") return value model_config = ConfigDict( diff --git a/python/cdp/openapi_client/models/revoke_delegation_for_end_user_request.py b/python/cdp/openapi_client/models/revoke_delegation_for_end_user_request.py new file mode 100644 index 000000000..cb9ff6479 --- /dev/null +++ b/python/cdp/openapi_client/models/revoke_delegation_for_end_user_request.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + Coinbase Developer Platform APIs + + The Coinbase Developer Platform APIs - leading the world's transition onchain. + + The version of the OpenAPI document: 2.0.0 + Contact: cdp@coinbase.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class RevokeDelegationForEndUserRequest(BaseModel): + """ + RevokeDelegationForEndUserRequest + """ # noqa: E501 + wallet_secret_id: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="When revoking with a wallet authentication scheme, the ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header.", alias="walletSecretId") + __properties: ClassVar[List[str]] = ["walletSecretId"] + + @field_validator('wallet_secret_id') + def wallet_secret_id_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match(r"^[a-zA-Z0-9-]{1,100}$", value): + raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9-]{1,100}$/") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RevokeDelegationForEndUserRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RevokeDelegationForEndUserRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "walletSecretId": obj.get("walletSecretId") + }) + return _obj + + diff --git a/python/cdp/openapi_client/models/revoke_spend_permission_request.py b/python/cdp/openapi_client/models/revoke_spend_permission_request.py index 50d8554a8..6d8ad7e27 100644 --- a/python/cdp/openapi_client/models/revoke_spend_permission_request.py +++ b/python/cdp/openapi_client/models/revoke_spend_permission_request.py @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated from cdp.openapi_client.models.spend_permission_network import SpendPermissionNetwork @@ -29,10 +29,19 @@ class RevokeSpendPermissionRequest(BaseModel): """ Request parameters for revoking a Spend Permission. """ # noqa: E501 + wallet_secret_id: Annotated[str, Field(strict=True)] = Field(description="The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header.", alias="walletSecretId") network: SpendPermissionNetwork permission_hash: StrictStr = Field(description="The hash of the spend permission to revoke.", alias="permissionHash") + use_cdp_paymaster: StrictBool = Field(description="Whether to use the CDP Paymaster for the user operation.", alias="useCdpPaymaster") paymaster_url: Optional[Annotated[str, Field(min_length=11, strict=True, max_length=2048)]] = Field(default=None, description="The paymaster URL of the spend permission.", alias="paymasterUrl") - __properties: ClassVar[List[str]] = ["network", "permissionHash", "paymasterUrl"] + __properties: ClassVar[List[str]] = ["walletSecretId", "network", "permissionHash", "useCdpPaymaster", "paymasterUrl"] + + @field_validator('wallet_secret_id') + def wallet_secret_id_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^[a-zA-Z0-9-]{1,100}$", value): + raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9-]{1,100}$/") + return value @field_validator('paymaster_url') def paymaster_url_validate_regular_expression(cls, value): @@ -95,8 +104,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ + "walletSecretId": obj.get("walletSecretId"), "network": obj.get("network"), "permissionHash": obj.get("permissionHash"), + "useCdpPaymaster": obj.get("useCdpPaymaster"), "paymasterUrl": obj.get("paymasterUrl") }) return _obj diff --git a/python/cdp/openapi_client/models/send_evm_asset_with_end_user_account200_response.py b/python/cdp/openapi_client/models/send_evm_asset_with_end_user_account200_response.py new file mode 100644 index 000000000..c57bb55ab --- /dev/null +++ b/python/cdp/openapi_client/models/send_evm_asset_with_end_user_account200_response.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Coinbase Developer Platform APIs + + The Coinbase Developer Platform APIs - leading the world's transition onchain. + + The version of the OpenAPI document: 2.0.0 + Contact: cdp@coinbase.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class SendEvmAssetWithEndUserAccount200Response(BaseModel): + """ + SendEvmAssetWithEndUserAccount200Response + """ # noqa: E501 + transaction_hash: Optional[StrictStr] = Field(default=None, description="The hash of the transaction, as a 0x-prefixed hex string. Populated for EOA accounts. Null for Smart Accounts (use userOpHash instead).", alias="transactionHash") + user_op_hash: Optional[StrictStr] = Field(default=None, description="The hash of the user operation, as a 0x-prefixed hex string. Populated for Smart Accounts. Null for EOA accounts (use transactionHash instead).", alias="userOpHash") + __properties: ClassVar[List[str]] = ["transactionHash", "userOpHash"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SendEvmAssetWithEndUserAccount200Response from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SendEvmAssetWithEndUserAccount200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "transactionHash": obj.get("transactionHash"), + "userOpHash": obj.get("userOpHash") + }) + return _obj + + diff --git a/python/cdp/openapi_client/models/send_evm_asset_with_end_user_account_request.py b/python/cdp/openapi_client/models/send_evm_asset_with_end_user_account_request.py new file mode 100644 index 000000000..6184faae2 --- /dev/null +++ b/python/cdp/openapi_client/models/send_evm_asset_with_end_user_account_request.py @@ -0,0 +1,126 @@ +# coding: utf-8 + +""" + Coinbase Developer Platform APIs + + The Coinbase Developer Platform APIs - leading the world's transition onchain. + + The version of the OpenAPI document: 2.0.0 + Contact: cdp@coinbase.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class SendEvmAssetWithEndUserAccountRequest(BaseModel): + """ + SendEvmAssetWithEndUserAccountRequest + """ # noqa: E501 + to: Annotated[str, Field(min_length=1, strict=True, max_length=128)] = Field(description="The 0x-prefixed address of the recipient.") + amount: Annotated[str, Field(min_length=1, strict=True, max_length=32)] = Field(description="The amount of USDC to send as a decimal string (e.g., \"1.5\" or \"25.50\").") + network: StrictStr = Field(description="The EVM network to send USDC on.") + use_cdp_paymaster: Optional[StrictBool] = Field(default=None, description="Whether to use CDP Paymaster to sponsor gas fees. Only applicable for EVM Smart Accounts. When true, the transaction gas will be paid by the Paymaster, allowing users to send USDC without holding native gas tokens. Ignored for EOA accounts. Cannot be used together with `paymasterUrl`.", alias="useCdpPaymaster") + paymaster_url: Optional[Annotated[str, Field(min_length=11, strict=True, max_length=2048)]] = Field(default=None, description="Optional custom Paymaster URL to use for gas sponsorship. Only applicable for EVM Smart Accounts. This allows you to use your own Paymaster service instead of CDP's Paymaster. Cannot be used together with `useCdpPaymaster`.", alias="paymasterUrl") + wallet_secret_id: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header.", alias="walletSecretId") + __properties: ClassVar[List[str]] = ["to", "amount", "network", "useCdpPaymaster", "paymasterUrl", "walletSecretId"] + + @field_validator('network') + def network_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['base', 'base-sepolia', 'ethereum', 'ethereum-sepolia', 'avalanche', 'polygon', 'optimism', 'arbitrum']): + raise ValueError("must be one of enum values ('base', 'base-sepolia', 'ethereum', 'ethereum-sepolia', 'avalanche', 'polygon', 'optimism', 'arbitrum')") + return value + + @field_validator('paymaster_url') + def paymaster_url_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match(r"^https?:\/\/.*$", value): + raise ValueError(r"must validate the regular expression /^https?:\/\/.*$/") + return value + + @field_validator('wallet_secret_id') + def wallet_secret_id_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match(r"^[a-zA-Z0-9-]{1,100}$", value): + raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9-]{1,100}$/") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SendEvmAssetWithEndUserAccountRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SendEvmAssetWithEndUserAccountRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "to": obj.get("to"), + "amount": obj.get("amount"), + "network": obj.get("network"), + "useCdpPaymaster": obj.get("useCdpPaymaster"), + "paymasterUrl": obj.get("paymasterUrl"), + "walletSecretId": obj.get("walletSecretId") + }) + return _obj + + diff --git a/python/cdp/openapi_client/models/send_evm_transaction200_response.py b/python/cdp/openapi_client/models/send_evm_transaction_with_end_user_account200_response.py similarity index 88% rename from python/cdp/openapi_client/models/send_evm_transaction200_response.py rename to python/cdp/openapi_client/models/send_evm_transaction_with_end_user_account200_response.py index 9aa5c18e7..95028b6db 100644 --- a/python/cdp/openapi_client/models/send_evm_transaction200_response.py +++ b/python/cdp/openapi_client/models/send_evm_transaction_with_end_user_account200_response.py @@ -23,9 +23,9 @@ from typing import Optional, Set from typing_extensions import Self -class SendEvmTransaction200Response(BaseModel): +class SendEvmTransactionWithEndUserAccount200Response(BaseModel): """ - SendEvmTransaction200Response + SendEvmTransactionWithEndUserAccount200Response """ # noqa: E501 transaction_hash: StrictStr = Field(description="The hash of the transaction, as a 0x-prefixed hex string.", alias="transactionHash") __properties: ClassVar[List[str]] = ["transactionHash"] @@ -48,7 +48,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SendEvmTransaction200Response from a JSON string""" + """Create an instance of SendEvmTransactionWithEndUserAccount200Response from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -73,7 +73,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SendEvmTransaction200Response from a dict""" + """Create an instance of SendEvmTransactionWithEndUserAccount200Response from a dict""" if obj is None: return None diff --git a/python/cdp/openapi_client/models/send_evm_transaction_with_end_user_account_request.py b/python/cdp/openapi_client/models/send_evm_transaction_with_end_user_account_request.py new file mode 100644 index 000000000..8403eecfc --- /dev/null +++ b/python/cdp/openapi_client/models/send_evm_transaction_with_end_user_account_request.py @@ -0,0 +1,119 @@ +# coding: utf-8 + +""" + Coinbase Developer Platform APIs + + The Coinbase Developer Platform APIs - leading the world's transition onchain. + + The version of the OpenAPI document: 2.0.0 + Contact: cdp@coinbase.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class SendEvmTransactionWithEndUserAccountRequest(BaseModel): + """ + SendEvmTransactionWithEndUserAccountRequest + """ # noqa: E501 + address: Annotated[str, Field(strict=True)] = Field(description="The 0x-prefixed address of the EVM account belonging to the end user.") + network: StrictStr = Field(description="The network to send the transaction to.") + wallet_secret_id: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header.", alias="walletSecretId") + transaction: StrictStr = Field(description="The RLP-encoded transaction to sign and send, as a 0x-prefixed hex string.") + __properties: ClassVar[List[str]] = ["address", "network", "walletSecretId", "transaction"] + + @field_validator('address') + def address_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^0x[0-9a-fA-F]{40}$", value): + raise ValueError(r"must validate the regular expression /^0x[0-9a-fA-F]{40}$/") + return value + + @field_validator('network') + def network_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['base', 'base-sepolia', 'ethereum', 'ethereum-sepolia', 'avalanche', 'polygon', 'optimism', 'arbitrum']): + raise ValueError("must be one of enum values ('base', 'base-sepolia', 'ethereum', 'ethereum-sepolia', 'avalanche', 'polygon', 'optimism', 'arbitrum')") + return value + + @field_validator('wallet_secret_id') + def wallet_secret_id_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match(r"^[a-zA-Z0-9-]{1,100}$", value): + raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9-]{1,100}$/") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SendEvmTransactionWithEndUserAccountRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SendEvmTransactionWithEndUserAccountRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "address": obj.get("address"), + "network": obj.get("network"), + "walletSecretId": obj.get("walletSecretId"), + "transaction": obj.get("transaction") + }) + return _obj + + diff --git a/python/cdp/openapi_client/models/send_solana_asset_with_end_user_account_request.py b/python/cdp/openapi_client/models/send_solana_asset_with_end_user_account_request.py new file mode 100644 index 000000000..109987065 --- /dev/null +++ b/python/cdp/openapi_client/models/send_solana_asset_with_end_user_account_request.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + Coinbase Developer Platform APIs + + The Coinbase Developer Platform APIs - leading the world's transition onchain. + + The version of the OpenAPI document: 2.0.0 + Contact: cdp@coinbase.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class SendSolanaAssetWithEndUserAccountRequest(BaseModel): + """ + SendSolanaAssetWithEndUserAccountRequest + """ # noqa: E501 + to: Annotated[str, Field(min_length=1, strict=True, max_length=128)] = Field(description="The base58 encoded address of the recipient.") + amount: Annotated[str, Field(min_length=1, strict=True, max_length=32)] = Field(description="The amount of USDC to send as a decimal string (e.g., \"1.5\" or \"25.50\").") + network: StrictStr = Field(description="The Solana network to send USDC on.") + create_recipient_ata: Optional[StrictBool] = Field(default=None, description="Whether to automatically create an Associated Token Account (ATA) for the recipient if it doesn't exist. When true, the sender pays the rent-exempt minimum to create the recipient's USDC ATA. When false, the transaction will fail if the recipient doesn't have a USDC ATA.", alias="createRecipientAta") + wallet_secret_id: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header.", alias="walletSecretId") + use_cdp_sponsor: Optional[StrictBool] = Field(default=None, description="Whether transaction fees should be sponsored by CDP. When true, CDP sponsors the transaction fees on behalf of the end user. When false, the end user is responsible for paying the transaction fees.", alias="useCdpSponsor") + __properties: ClassVar[List[str]] = ["to", "amount", "network", "createRecipientAta", "walletSecretId", "useCdpSponsor"] + + @field_validator('network') + def network_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['solana', 'solana-devnet']): + raise ValueError("must be one of enum values ('solana', 'solana-devnet')") + return value + + @field_validator('wallet_secret_id') + def wallet_secret_id_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match(r"^[a-zA-Z0-9-]{1,100}$", value): + raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9-]{1,100}$/") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SendSolanaAssetWithEndUserAccountRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SendSolanaAssetWithEndUserAccountRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "to": obj.get("to"), + "amount": obj.get("amount"), + "network": obj.get("network"), + "createRecipientAta": obj.get("createRecipientAta"), + "walletSecretId": obj.get("walletSecretId"), + "useCdpSponsor": obj.get("useCdpSponsor") + }) + return _obj + + diff --git a/python/cdp/openapi_client/models/send_solana_transaction200_response.py b/python/cdp/openapi_client/models/send_solana_transaction_with_end_user_account200_response.py similarity index 88% rename from python/cdp/openapi_client/models/send_solana_transaction200_response.py rename to python/cdp/openapi_client/models/send_solana_transaction_with_end_user_account200_response.py index 6ccc7e1e1..69d53ad4c 100644 --- a/python/cdp/openapi_client/models/send_solana_transaction200_response.py +++ b/python/cdp/openapi_client/models/send_solana_transaction_with_end_user_account200_response.py @@ -23,9 +23,9 @@ from typing import Optional, Set from typing_extensions import Self -class SendSolanaTransaction200Response(BaseModel): +class SendSolanaTransactionWithEndUserAccount200Response(BaseModel): """ - SendSolanaTransaction200Response + SendSolanaTransactionWithEndUserAccount200Response """ # noqa: E501 transaction_signature: StrictStr = Field(description="The base58 encoded transaction signature.", alias="transactionSignature") __properties: ClassVar[List[str]] = ["transactionSignature"] @@ -48,7 +48,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SendSolanaTransaction200Response from a JSON string""" + """Create an instance of SendSolanaTransactionWithEndUserAccount200Response from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -73,7 +73,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SendSolanaTransaction200Response from a dict""" + """Create an instance of SendSolanaTransactionWithEndUserAccount200Response from a dict""" if obj is None: return None diff --git a/python/cdp/openapi_client/models/send_solana_transaction_with_end_user_account_request.py b/python/cdp/openapi_client/models/send_solana_transaction_with_end_user_account_request.py new file mode 100644 index 000000000..2e0ecdc3c --- /dev/null +++ b/python/cdp/openapi_client/models/send_solana_transaction_with_end_user_account_request.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Coinbase Developer Platform APIs + + The Coinbase Developer Platform APIs - leading the world's transition onchain. + + The version of the OpenAPI document: 2.0.0 + Contact: cdp@coinbase.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class SendSolanaTransactionWithEndUserAccountRequest(BaseModel): + """ + SendSolanaTransactionWithEndUserAccountRequest + """ # noqa: E501 + address: Annotated[str, Field(strict=True)] = Field(description="The base58 encoded address of the Solana account belonging to the end user.") + network: StrictStr = Field(description="The Solana network to send the transaction to.") + wallet_secret_id: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header.", alias="walletSecretId") + transaction: StrictStr = Field(description="The base64 encoded transaction to sign and send. This transaction can contain multiple instructions for native Solana batching.") + use_cdp_sponsor: Optional[StrictBool] = Field(default=None, description="Whether transaction fees should be sponsored by CDP. When true, CDP sponsors the transaction fees on behalf of the end user. When false, the end user is responsible for paying the transaction fees.", alias="useCdpSponsor") + __properties: ClassVar[List[str]] = ["address", "network", "walletSecretId", "transaction", "useCdpSponsor"] + + @field_validator('address') + def address_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^[1-9A-HJ-NP-Za-km-z]{32,44}$", value): + raise ValueError(r"must validate the regular expression /^[1-9A-HJ-NP-Za-km-z]{32,44}$/") + return value + + @field_validator('network') + def network_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['solana', 'solana-devnet']): + raise ValueError("must be one of enum values ('solana', 'solana-devnet')") + return value + + @field_validator('wallet_secret_id') + def wallet_secret_id_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match(r"^[a-zA-Z0-9-]{1,100}$", value): + raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9-]{1,100}$/") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SendSolanaTransactionWithEndUserAccountRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SendSolanaTransactionWithEndUserAccountRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "address": obj.get("address"), + "network": obj.get("network"), + "walletSecretId": obj.get("walletSecretId"), + "transaction": obj.get("transaction"), + "useCdpSponsor": obj.get("useCdpSponsor") + }) + return _obj + + diff --git a/python/cdp/openapi_client/models/send_user_operation_with_end_user_account_request.py b/python/cdp/openapi_client/models/send_user_operation_with_end_user_account_request.py new file mode 100644 index 000000000..d2ac38cac --- /dev/null +++ b/python/cdp/openapi_client/models/send_user_operation_with_end_user_account_request.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Coinbase Developer Platform APIs + + The Coinbase Developer Platform APIs - leading the world's transition onchain. + + The version of the OpenAPI document: 2.0.0 + Contact: cdp@coinbase.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from cdp.openapi_client.models.evm_call import EvmCall +from cdp.openapi_client.models.evm_user_operation_network import EvmUserOperationNetwork +from typing import Optional, Set +from typing_extensions import Self + +class SendUserOperationWithEndUserAccountRequest(BaseModel): + """ + SendUserOperationWithEndUserAccountRequest + """ # noqa: E501 + network: EvmUserOperationNetwork + calls: List[EvmCall] = Field(description="The list of calls to make from the Smart Account.") + use_cdp_paymaster: StrictBool = Field(description="Whether to use the CDP Paymaster for the user operation.", alias="useCdpPaymaster") + paymaster_url: Optional[Annotated[str, Field(min_length=11, strict=True, max_length=2048)]] = Field(default=None, description="The URL of the paymaster to use for the user operation. If using the CDP Paymaster, use the `useCdpPaymaster` option.", alias="paymasterUrl") + wallet_secret_id: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header.", alias="walletSecretId") + data_suffix: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="The EIP-8021 data suffix (hex-encoded) that enables transaction attribution for the user operation.", alias="dataSuffix") + __properties: ClassVar[List[str]] = ["network", "calls", "useCdpPaymaster", "paymasterUrl", "walletSecretId", "dataSuffix"] + + @field_validator('paymaster_url') + def paymaster_url_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match(r"^https?:\/\/.*$", value): + raise ValueError(r"must validate the regular expression /^https?:\/\/.*$/") + return value + + @field_validator('wallet_secret_id') + def wallet_secret_id_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match(r"^[a-zA-Z0-9-]{1,100}$", value): + raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9-]{1,100}$/") + return value + + @field_validator('data_suffix') + def data_suffix_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match(r"^0x[0-9a-fA-F]+$", value): + raise ValueError(r"must validate the regular expression /^0x[0-9a-fA-F]+$/") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SendUserOperationWithEndUserAccountRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in calls (list) + _items = [] + if self.calls: + for _item_calls in self.calls: + if _item_calls: + _items.append(_item_calls.to_dict()) + _dict['calls'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SendUserOperationWithEndUserAccountRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "network": obj.get("network"), + "calls": [EvmCall.from_dict(_item) for _item in obj["calls"]] if obj.get("calls") is not None else None, + "useCdpPaymaster": obj.get("useCdpPaymaster"), + "paymasterUrl": obj.get("paymasterUrl"), + "walletSecretId": obj.get("walletSecretId"), + "dataSuffix": obj.get("dataSuffix") + }) + return _obj + + diff --git a/python/cdp/openapi_client/models/sign_evm_hash200_response.py b/python/cdp/openapi_client/models/sign_evm_hash_with_end_user_account200_response.py similarity index 89% rename from python/cdp/openapi_client/models/sign_evm_hash200_response.py rename to python/cdp/openapi_client/models/sign_evm_hash_with_end_user_account200_response.py index 5a5b51d99..74049ea6b 100644 --- a/python/cdp/openapi_client/models/sign_evm_hash200_response.py +++ b/python/cdp/openapi_client/models/sign_evm_hash_with_end_user_account200_response.py @@ -23,9 +23,9 @@ from typing import Optional, Set from typing_extensions import Self -class SignEvmHash200Response(BaseModel): +class SignEvmHashWithEndUserAccount200Response(BaseModel): """ - SignEvmHash200Response + SignEvmHashWithEndUserAccount200Response """ # noqa: E501 signature: StrictStr = Field(description="The signature of the hash, as a 0x-prefixed hex string.") __properties: ClassVar[List[str]] = ["signature"] @@ -48,7 +48,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SignEvmHash200Response from a JSON string""" + """Create an instance of SignEvmHashWithEndUserAccount200Response from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -73,7 +73,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SignEvmHash200Response from a dict""" + """Create an instance of SignEvmHashWithEndUserAccount200Response from a dict""" if obj is None: return None diff --git a/python/cdp/openapi_client/models/sign_evm_hash_with_end_user_account_request.py b/python/cdp/openapi_client/models/sign_evm_hash_with_end_user_account_request.py new file mode 100644 index 000000000..af7cc4177 --- /dev/null +++ b/python/cdp/openapi_client/models/sign_evm_hash_with_end_user_account_request.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + Coinbase Developer Platform APIs + + The Coinbase Developer Platform APIs - leading the world's transition onchain. + + The version of the OpenAPI document: 2.0.0 + Contact: cdp@coinbase.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class SignEvmHashWithEndUserAccountRequest(BaseModel): + """ + SignEvmHashWithEndUserAccountRequest + """ # noqa: E501 + hash: StrictStr = Field(description="The arbitrary 32 byte hash to sign.") + address: Annotated[str, Field(strict=True)] = Field(description="The 0x-prefixed address of the EVM account belonging to the end user.") + wallet_secret_id: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header.", alias="walletSecretId") + __properties: ClassVar[List[str]] = ["hash", "address", "walletSecretId"] + + @field_validator('address') + def address_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^0x[0-9a-fA-F]{40}$", value): + raise ValueError(r"must validate the regular expression /^0x[0-9a-fA-F]{40}$/") + return value + + @field_validator('wallet_secret_id') + def wallet_secret_id_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match(r"^[a-zA-Z0-9-]{1,100}$", value): + raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9-]{1,100}$/") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SignEvmHashWithEndUserAccountRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SignEvmHashWithEndUserAccountRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "hash": obj.get("hash"), + "address": obj.get("address"), + "walletSecretId": obj.get("walletSecretId") + }) + return _obj + + diff --git a/python/cdp/openapi_client/models/sign_evm_message200_response.py b/python/cdp/openapi_client/models/sign_evm_message_with_end_user_account200_response.py similarity index 88% rename from python/cdp/openapi_client/models/sign_evm_message200_response.py rename to python/cdp/openapi_client/models/sign_evm_message_with_end_user_account200_response.py index 55f965b8c..368006b76 100644 --- a/python/cdp/openapi_client/models/sign_evm_message200_response.py +++ b/python/cdp/openapi_client/models/sign_evm_message_with_end_user_account200_response.py @@ -23,9 +23,9 @@ from typing import Optional, Set from typing_extensions import Self -class SignEvmMessage200Response(BaseModel): +class SignEvmMessageWithEndUserAccount200Response(BaseModel): """ - SignEvmMessage200Response + SignEvmMessageWithEndUserAccount200Response """ # noqa: E501 signature: StrictStr = Field(description="The signature of the message, as a 0x-prefixed hex string.") __properties: ClassVar[List[str]] = ["signature"] @@ -48,7 +48,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SignEvmMessage200Response from a JSON string""" + """Create an instance of SignEvmMessageWithEndUserAccount200Response from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -73,7 +73,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SignEvmMessage200Response from a dict""" + """Create an instance of SignEvmMessageWithEndUserAccount200Response from a dict""" if obj is None: return None diff --git a/python/cdp/openapi_client/models/sign_evm_message_with_end_user_account_request.py b/python/cdp/openapi_client/models/sign_evm_message_with_end_user_account_request.py new file mode 100644 index 000000000..39f37997c --- /dev/null +++ b/python/cdp/openapi_client/models/sign_evm_message_with_end_user_account_request.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + Coinbase Developer Platform APIs + + The Coinbase Developer Platform APIs - leading the world's transition onchain. + + The version of the OpenAPI document: 2.0.0 + Contact: cdp@coinbase.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class SignEvmMessageWithEndUserAccountRequest(BaseModel): + """ + SignEvmMessageWithEndUserAccountRequest + """ # noqa: E501 + address: Annotated[str, Field(strict=True)] = Field(description="The 0x-prefixed address of the EVM account belonging to the end user.") + message: StrictStr = Field(description="The message to sign.") + wallet_secret_id: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header.", alias="walletSecretId") + __properties: ClassVar[List[str]] = ["address", "message", "walletSecretId"] + + @field_validator('address') + def address_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^0x[0-9a-fA-F]{40}$", value): + raise ValueError(r"must validate the regular expression /^0x[0-9a-fA-F]{40}$/") + return value + + @field_validator('wallet_secret_id') + def wallet_secret_id_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match(r"^[a-zA-Z0-9-]{1,100}$", value): + raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9-]{1,100}$/") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SignEvmMessageWithEndUserAccountRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SignEvmMessageWithEndUserAccountRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "address": obj.get("address"), + "message": obj.get("message"), + "walletSecretId": obj.get("walletSecretId") + }) + return _obj + + diff --git a/python/cdp/openapi_client/models/sign_evm_transaction200_response.py b/python/cdp/openapi_client/models/sign_evm_transaction_with_end_user_account200_response.py similarity index 88% rename from python/cdp/openapi_client/models/sign_evm_transaction200_response.py rename to python/cdp/openapi_client/models/sign_evm_transaction_with_end_user_account200_response.py index 6a57162ce..496b217cc 100644 --- a/python/cdp/openapi_client/models/sign_evm_transaction200_response.py +++ b/python/cdp/openapi_client/models/sign_evm_transaction_with_end_user_account200_response.py @@ -23,9 +23,9 @@ from typing import Optional, Set from typing_extensions import Self -class SignEvmTransaction200Response(BaseModel): +class SignEvmTransactionWithEndUserAccount200Response(BaseModel): """ - SignEvmTransaction200Response + SignEvmTransactionWithEndUserAccount200Response """ # noqa: E501 signed_transaction: StrictStr = Field(description="The RLP-encoded signed transaction, as a 0x-prefixed hex string.", alias="signedTransaction") __properties: ClassVar[List[str]] = ["signedTransaction"] @@ -48,7 +48,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SignEvmTransaction200Response from a JSON string""" + """Create an instance of SignEvmTransactionWithEndUserAccount200Response from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -73,7 +73,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SignEvmTransaction200Response from a dict""" + """Create an instance of SignEvmTransactionWithEndUserAccount200Response from a dict""" if obj is None: return None diff --git a/python/cdp/openapi_client/models/sign_evm_transaction_with_end_user_account_request.py b/python/cdp/openapi_client/models/sign_evm_transaction_with_end_user_account_request.py new file mode 100644 index 000000000..4ff551810 --- /dev/null +++ b/python/cdp/openapi_client/models/sign_evm_transaction_with_end_user_account_request.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + Coinbase Developer Platform APIs + + The Coinbase Developer Platform APIs - leading the world's transition onchain. + + The version of the OpenAPI document: 2.0.0 + Contact: cdp@coinbase.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class SignEvmTransactionWithEndUserAccountRequest(BaseModel): + """ + SignEvmTransactionWithEndUserAccountRequest + """ # noqa: E501 + address: Annotated[str, Field(strict=True)] = Field(description="The 0x-prefixed address of the EVM account belonging to the end user.") + transaction: StrictStr = Field(description="The RLP-encoded transaction to sign, as a 0x-prefixed hex string.") + wallet_secret_id: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header.", alias="walletSecretId") + __properties: ClassVar[List[str]] = ["address", "transaction", "walletSecretId"] + + @field_validator('address') + def address_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^0x[0-9a-fA-F]{40}$", value): + raise ValueError(r"must validate the regular expression /^0x[0-9a-fA-F]{40}$/") + return value + + @field_validator('wallet_secret_id') + def wallet_secret_id_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match(r"^[a-zA-Z0-9-]{1,100}$", value): + raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9-]{1,100}$/") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SignEvmTransactionWithEndUserAccountRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SignEvmTransactionWithEndUserAccountRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "address": obj.get("address"), + "transaction": obj.get("transaction"), + "walletSecretId": obj.get("walletSecretId") + }) + return _obj + + diff --git a/python/cdp/openapi_client/models/sign_evm_typed_data200_response.py b/python/cdp/openapi_client/models/sign_evm_typed_data_with_end_user_account200_response.py similarity index 88% rename from python/cdp/openapi_client/models/sign_evm_typed_data200_response.py rename to python/cdp/openapi_client/models/sign_evm_typed_data_with_end_user_account200_response.py index cc49f88f6..f59efde51 100644 --- a/python/cdp/openapi_client/models/sign_evm_typed_data200_response.py +++ b/python/cdp/openapi_client/models/sign_evm_typed_data_with_end_user_account200_response.py @@ -23,9 +23,9 @@ from typing import Optional, Set from typing_extensions import Self -class SignEvmTypedData200Response(BaseModel): +class SignEvmTypedDataWithEndUserAccount200Response(BaseModel): """ - SignEvmTypedData200Response + SignEvmTypedDataWithEndUserAccount200Response """ # noqa: E501 signature: StrictStr = Field(description="The signature of the typed data, as a 0x-prefixed hex string.") __properties: ClassVar[List[str]] = ["signature"] @@ -48,7 +48,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SignEvmTypedData200Response from a JSON string""" + """Create an instance of SignEvmTypedDataWithEndUserAccount200Response from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -73,7 +73,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SignEvmTypedData200Response from a dict""" + """Create an instance of SignEvmTypedDataWithEndUserAccount200Response from a dict""" if obj is None: return None diff --git a/python/cdp/openapi_client/models/sign_evm_typed_data_with_end_user_account_request.py b/python/cdp/openapi_client/models/sign_evm_typed_data_with_end_user_account_request.py new file mode 100644 index 000000000..413f9ab18 --- /dev/null +++ b/python/cdp/openapi_client/models/sign_evm_typed_data_with_end_user_account_request.py @@ -0,0 +1,114 @@ +# coding: utf-8 + +""" + Coinbase Developer Platform APIs + + The Coinbase Developer Platform APIs - leading the world's transition onchain. + + The version of the OpenAPI document: 2.0.0 + Contact: cdp@coinbase.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from cdp.openapi_client.models.eip712_message import EIP712Message +from typing import Optional, Set +from typing_extensions import Self + +class SignEvmTypedDataWithEndUserAccountRequest(BaseModel): + """ + SignEvmTypedDataWithEndUserAccountRequest + """ # noqa: E501 + address: Annotated[str, Field(strict=True)] = Field(description="The 0x-prefixed address of the EVM account belonging to the end user.") + typed_data: EIP712Message = Field(alias="typedData") + wallet_secret_id: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header.", alias="walletSecretId") + __properties: ClassVar[List[str]] = ["address", "typedData", "walletSecretId"] + + @field_validator('address') + def address_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^0x[0-9a-fA-F]{40}$", value): + raise ValueError(r"must validate the regular expression /^0x[0-9a-fA-F]{40}$/") + return value + + @field_validator('wallet_secret_id') + def wallet_secret_id_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match(r"^[a-zA-Z0-9-]{1,100}$", value): + raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9-]{1,100}$/") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SignEvmTypedDataWithEndUserAccountRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of typed_data + if self.typed_data: + _dict['typedData'] = self.typed_data.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SignEvmTypedDataWithEndUserAccountRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "address": obj.get("address"), + "typedData": EIP712Message.from_dict(obj["typedData"]) if obj.get("typedData") is not None else None, + "walletSecretId": obj.get("walletSecretId") + }) + return _obj + + diff --git a/python/cdp/openapi_client/models/sign_solana_hash_with_end_user_account200_response.py b/python/cdp/openapi_client/models/sign_solana_hash_with_end_user_account200_response.py new file mode 100644 index 000000000..893008cd2 --- /dev/null +++ b/python/cdp/openapi_client/models/sign_solana_hash_with_end_user_account200_response.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Coinbase Developer Platform APIs + + The Coinbase Developer Platform APIs - leading the world's transition onchain. + + The version of the OpenAPI document: 2.0.0 + Contact: cdp@coinbase.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class SignSolanaHashWithEndUserAccount200Response(BaseModel): + """ + SignSolanaHashWithEndUserAccount200Response + """ # noqa: E501 + signature: StrictStr = Field(description="The signature of the hash, as a base58 encoded string.") + __properties: ClassVar[List[str]] = ["signature"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SignSolanaHashWithEndUserAccount200Response from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SignSolanaHashWithEndUserAccount200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "signature": obj.get("signature") + }) + return _obj + + diff --git a/python/cdp/openapi_client/models/sign_solana_hash_with_end_user_account_request.py b/python/cdp/openapi_client/models/sign_solana_hash_with_end_user_account_request.py new file mode 100644 index 000000000..742097ef9 --- /dev/null +++ b/python/cdp/openapi_client/models/sign_solana_hash_with_end_user_account_request.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + Coinbase Developer Platform APIs + + The Coinbase Developer Platform APIs - leading the world's transition onchain. + + The version of the OpenAPI document: 2.0.0 + Contact: cdp@coinbase.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class SignSolanaHashWithEndUserAccountRequest(BaseModel): + """ + SignSolanaHashWithEndUserAccountRequest + """ # noqa: E501 + hash: StrictStr = Field(description="The arbitrary 32 byte hash to sign as base58 encoded string.") + address: Annotated[str, Field(strict=True)] = Field(description="The base58 encoded address of the Solana account belonging to the end user.") + wallet_secret_id: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header.", alias="walletSecretId") + __properties: ClassVar[List[str]] = ["hash", "address", "walletSecretId"] + + @field_validator('address') + def address_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^[1-9A-HJ-NP-Za-km-z]{32,44}$", value): + raise ValueError(r"must validate the regular expression /^[1-9A-HJ-NP-Za-km-z]{32,44}$/") + return value + + @field_validator('wallet_secret_id') + def wallet_secret_id_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match(r"^[a-zA-Z0-9-]{1,100}$", value): + raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9-]{1,100}$/") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SignSolanaHashWithEndUserAccountRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SignSolanaHashWithEndUserAccountRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "hash": obj.get("hash"), + "address": obj.get("address"), + "walletSecretId": obj.get("walletSecretId") + }) + return _obj + + diff --git a/python/cdp/openapi_client/models/sign_solana_message200_response.py b/python/cdp/openapi_client/models/sign_solana_message_with_end_user_account200_response.py similarity index 88% rename from python/cdp/openapi_client/models/sign_solana_message200_response.py rename to python/cdp/openapi_client/models/sign_solana_message_with_end_user_account200_response.py index 49c0d2249..4265102ab 100644 --- a/python/cdp/openapi_client/models/sign_solana_message200_response.py +++ b/python/cdp/openapi_client/models/sign_solana_message_with_end_user_account200_response.py @@ -23,9 +23,9 @@ from typing import Optional, Set from typing_extensions import Self -class SignSolanaMessage200Response(BaseModel): +class SignSolanaMessageWithEndUserAccount200Response(BaseModel): """ - SignSolanaMessage200Response + SignSolanaMessageWithEndUserAccount200Response """ # noqa: E501 signature: StrictStr = Field(description="The signature of the message, as a base58 encoded string.") __properties: ClassVar[List[str]] = ["signature"] @@ -48,7 +48,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SignSolanaMessage200Response from a JSON string""" + """Create an instance of SignSolanaMessageWithEndUserAccount200Response from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -73,7 +73,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SignSolanaMessage200Response from a dict""" + """Create an instance of SignSolanaMessageWithEndUserAccount200Response from a dict""" if obj is None: return None diff --git a/python/cdp/openapi_client/models/sign_solana_message_with_end_user_account_request.py b/python/cdp/openapi_client/models/sign_solana_message_with_end_user_account_request.py new file mode 100644 index 000000000..dced412ce --- /dev/null +++ b/python/cdp/openapi_client/models/sign_solana_message_with_end_user_account_request.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + Coinbase Developer Platform APIs + + The Coinbase Developer Platform APIs - leading the world's transition onchain. + + The version of the OpenAPI document: 2.0.0 + Contact: cdp@coinbase.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class SignSolanaMessageWithEndUserAccountRequest(BaseModel): + """ + SignSolanaMessageWithEndUserAccountRequest + """ # noqa: E501 + address: Annotated[str, Field(strict=True)] = Field(description="The base58 encoded address of the Solana account belonging to the end user.") + message: StrictStr = Field(description="The base64 encoded arbitrary message to sign.") + wallet_secret_id: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header.", alias="walletSecretId") + __properties: ClassVar[List[str]] = ["address", "message", "walletSecretId"] + + @field_validator('address') + def address_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^[1-9A-HJ-NP-Za-km-z]{32,44}$", value): + raise ValueError(r"must validate the regular expression /^[1-9A-HJ-NP-Za-km-z]{32,44}$/") + return value + + @field_validator('wallet_secret_id') + def wallet_secret_id_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match(r"^[a-zA-Z0-9-]{1,100}$", value): + raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9-]{1,100}$/") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SignSolanaMessageWithEndUserAccountRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SignSolanaMessageWithEndUserAccountRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "address": obj.get("address"), + "message": obj.get("message"), + "walletSecretId": obj.get("walletSecretId") + }) + return _obj + + diff --git a/python/cdp/openapi_client/models/sign_solana_transaction200_response.py b/python/cdp/openapi_client/models/sign_solana_transaction_with_end_user_account200_response.py similarity index 88% rename from python/cdp/openapi_client/models/sign_solana_transaction200_response.py rename to python/cdp/openapi_client/models/sign_solana_transaction_with_end_user_account200_response.py index cec73f17f..fe36df8ff 100644 --- a/python/cdp/openapi_client/models/sign_solana_transaction200_response.py +++ b/python/cdp/openapi_client/models/sign_solana_transaction_with_end_user_account200_response.py @@ -23,9 +23,9 @@ from typing import Optional, Set from typing_extensions import Self -class SignSolanaTransaction200Response(BaseModel): +class SignSolanaTransactionWithEndUserAccount200Response(BaseModel): """ - SignSolanaTransaction200Response + SignSolanaTransactionWithEndUserAccount200Response """ # noqa: E501 signed_transaction: StrictStr = Field(description="The base64 encoded signed transaction.", alias="signedTransaction") __properties: ClassVar[List[str]] = ["signedTransaction"] @@ -48,7 +48,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SignSolanaTransaction200Response from a JSON string""" + """Create an instance of SignSolanaTransactionWithEndUserAccount200Response from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -73,7 +73,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SignSolanaTransaction200Response from a dict""" + """Create an instance of SignSolanaTransactionWithEndUserAccount200Response from a dict""" if obj is None: return None diff --git a/python/cdp/openapi_client/models/sign_solana_transaction_with_end_user_account_request.py b/python/cdp/openapi_client/models/sign_solana_transaction_with_end_user_account_request.py new file mode 100644 index 000000000..8f6cae1e8 --- /dev/null +++ b/python/cdp/openapi_client/models/sign_solana_transaction_with_end_user_account_request.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + Coinbase Developer Platform APIs + + The Coinbase Developer Platform APIs - leading the world's transition onchain. + + The version of the OpenAPI document: 2.0.0 + Contact: cdp@coinbase.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class SignSolanaTransactionWithEndUserAccountRequest(BaseModel): + """ + SignSolanaTransactionWithEndUserAccountRequest + """ # noqa: E501 + address: Annotated[str, Field(strict=True)] = Field(description="The base58 encoded address of the Solana account belonging to the end user.") + transaction: StrictStr = Field(description="The base64 encoded transaction to sign.") + wallet_secret_id: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header.", alias="walletSecretId") + __properties: ClassVar[List[str]] = ["address", "transaction", "walletSecretId"] + + @field_validator('address') + def address_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^[1-9A-HJ-NP-Za-km-z]{32,44}$", value): + raise ValueError(r"must validate the regular expression /^[1-9A-HJ-NP-Za-km-z]{32,44}$/") + return value + + @field_validator('wallet_secret_id') + def wallet_secret_id_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match(r"^[a-zA-Z0-9-]{1,100}$", value): + raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9-]{1,100}$/") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SignSolanaTransactionWithEndUserAccountRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SignSolanaTransactionWithEndUserAccountRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "address": obj.get("address"), + "transaction": obj.get("transaction"), + "walletSecretId": obj.get("walletSecretId") + }) + return _obj + + diff --git a/python/cdp/openapi_client/models/webhook_subscription_response.py b/python/cdp/openapi_client/models/webhook_subscription_response.py index 5819b7598..e895aff4f 100644 --- a/python/cdp/openapi_client/models/webhook_subscription_response.py +++ b/python/cdp/openapi_client/models/webhook_subscription_response.py @@ -32,6 +32,7 @@ class WebhookSubscriptionResponse(BaseModel): Response containing webhook subscription details. """ # noqa: E501 created_at: datetime = Field(description="When the subscription was created.", alias="createdAt") + updated_at: Optional[datetime] = Field(default=None, description="When the subscription was last updated.", alias="updatedAt") description: Optional[Annotated[str, Field(min_length=0, strict=True, max_length=500)]] = Field(default=None, description="Description of the webhook subscription.") event_types: List[StrictStr] = Field(description="Types of events to subscribe to. Event types follow a three-part dot-separated format: service.resource.verb (e.g., \"onchain.activity.detected\", \"wallet.activity.detected\", \"onramp.transaction.created\"). ", alias="eventTypes") is_enabled: StrictBool = Field(description="Whether the subscription is enabled.", alias="isEnabled") @@ -40,7 +41,7 @@ class WebhookSubscriptionResponse(BaseModel): subscription_id: StrictStr = Field(description="Unique identifier for the subscription.", alias="subscriptionId") target: WebhookTarget labels: Optional[Dict[str, StrictStr]] = Field(default=None, description="Multi-label filters using total overlap logic. Total overlap means the subscription only triggers when events contain ALL these key-value pairs. Present when subscription uses multi-label format. ") - __properties: ClassVar[List[str]] = ["createdAt", "description", "eventTypes", "isEnabled", "metadata", "secret", "subscriptionId", "target", "labels"] + __properties: ClassVar[List[str]] = ["createdAt", "updatedAt", "description", "eventTypes", "isEnabled", "metadata", "secret", "subscriptionId", "target", "labels"] model_config = ConfigDict( populate_by_name=True, @@ -100,6 +101,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "createdAt": obj.get("createdAt"), + "updatedAt": obj.get("updatedAt"), "description": obj.get("description"), "eventTypes": obj.get("eventTypes"), "isEnabled": obj.get("isEnabled"), diff --git a/python/cdp/openapi_client/models/x402_payment_payload.py b/python/cdp/openapi_client/models/x402_payment_payload.py index 41748b9a5..15467fc10 100644 --- a/python/cdp/openapi_client/models/x402_payment_payload.py +++ b/python/cdp/openapi_client/models/x402_payment_payload.py @@ -30,10 +30,10 @@ class X402PaymentPayload(BaseModel): """ The x402 protocol payment payload that the client attaches to x402-paid API requests to the resource server in the X-PAYMENT header. For EVM networks, smart account signatures can be longer than 65 bytes. """ - # data type: X402V1PaymentPayload - oneof_schema_1_validator: Optional[X402V1PaymentPayload] = None # data type: X402V2PaymentPayload - oneof_schema_2_validator: Optional[X402V2PaymentPayload] = None + oneof_schema_1_validator: Optional[X402V2PaymentPayload] = None + # data type: X402V1PaymentPayload + oneof_schema_2_validator: Optional[X402V1PaymentPayload] = None actual_instance: Optional[Union[X402V1PaymentPayload, X402V2PaymentPayload]] = None one_of_schemas: Set[str] = { "X402V1PaymentPayload", "X402V2PaymentPayload" } @@ -58,16 +58,16 @@ def actual_instance_must_validate_oneof(cls, v): instance = X402PaymentPayload.model_construct() error_messages = [] match = 0 - # validate data type: X402V1PaymentPayload - if not isinstance(v, X402V1PaymentPayload): - error_messages.append(f"Error! Input type `{type(v)}` is not `X402V1PaymentPayload`") - else: - match += 1 # validate data type: X402V2PaymentPayload if not isinstance(v, X402V2PaymentPayload): error_messages.append(f"Error! Input type `{type(v)}` is not `X402V2PaymentPayload`") else: match += 1 + # validate data type: X402V1PaymentPayload + if not isinstance(v, X402V1PaymentPayload): + error_messages.append(f"Error! Input type `{type(v)}` is not `X402V1PaymentPayload`") + else: + match += 1 if match > 1: # more than 1 match raise ValueError("Multiple matches found when setting `actual_instance` in X402PaymentPayload with oneOf schemas: X402V1PaymentPayload, X402V2PaymentPayload. Details: " + ", ".join(error_messages)) @@ -88,15 +88,15 @@ def from_json(cls, json_str: str) -> Self: error_messages = [] match = 0 - # deserialize data into X402V1PaymentPayload + # deserialize data into X402V2PaymentPayload try: - instance.actual_instance = X402V1PaymentPayload.from_json(json_str) + instance.actual_instance = X402V2PaymentPayload.from_json(json_str) match += 1 except (ValidationError, ValueError) as e: error_messages.append(str(e)) - # deserialize data into X402V2PaymentPayload + # deserialize data into X402V1PaymentPayload try: - instance.actual_instance = X402V2PaymentPayload.from_json(json_str) + instance.actual_instance = X402V1PaymentPayload.from_json(json_str) match += 1 except (ValidationError, ValueError) as e: error_messages.append(str(e)) diff --git a/python/cdp/openapi_client/models/x402_payment_requirements.py b/python/cdp/openapi_client/models/x402_payment_requirements.py index 5b30fa9a8..ab3aa83aa 100644 --- a/python/cdp/openapi_client/models/x402_payment_requirements.py +++ b/python/cdp/openapi_client/models/x402_payment_requirements.py @@ -30,10 +30,10 @@ class X402PaymentRequirements(BaseModel): """ The x402 protocol payment requirements that the resource server expects the client's payment payload to meet. """ - # data type: X402V1PaymentRequirements - oneof_schema_1_validator: Optional[X402V1PaymentRequirements] = None # data type: X402V2PaymentRequirements - oneof_schema_2_validator: Optional[X402V2PaymentRequirements] = None + oneof_schema_1_validator: Optional[X402V2PaymentRequirements] = None + # data type: X402V1PaymentRequirements + oneof_schema_2_validator: Optional[X402V1PaymentRequirements] = None actual_instance: Optional[Union[X402V1PaymentRequirements, X402V2PaymentRequirements]] = None one_of_schemas: Set[str] = { "X402V1PaymentRequirements", "X402V2PaymentRequirements" } @@ -58,16 +58,16 @@ def actual_instance_must_validate_oneof(cls, v): instance = X402PaymentRequirements.model_construct() error_messages = [] match = 0 - # validate data type: X402V1PaymentRequirements - if not isinstance(v, X402V1PaymentRequirements): - error_messages.append(f"Error! Input type `{type(v)}` is not `X402V1PaymentRequirements`") - else: - match += 1 # validate data type: X402V2PaymentRequirements if not isinstance(v, X402V2PaymentRequirements): error_messages.append(f"Error! Input type `{type(v)}` is not `X402V2PaymentRequirements`") else: match += 1 + # validate data type: X402V1PaymentRequirements + if not isinstance(v, X402V1PaymentRequirements): + error_messages.append(f"Error! Input type `{type(v)}` is not `X402V1PaymentRequirements`") + else: + match += 1 if match > 1: # more than 1 match raise ValueError("Multiple matches found when setting `actual_instance` in X402PaymentRequirements with oneOf schemas: X402V1PaymentRequirements, X402V2PaymentRequirements. Details: " + ", ".join(error_messages)) @@ -88,15 +88,15 @@ def from_json(cls, json_str: str) -> Self: error_messages = [] match = 0 - # deserialize data into X402V1PaymentRequirements + # deserialize data into X402V2PaymentRequirements try: - instance.actual_instance = X402V1PaymentRequirements.from_json(json_str) + instance.actual_instance = X402V2PaymentRequirements.from_json(json_str) match += 1 except (ValidationError, ValueError) as e: error_messages.append(str(e)) - # deserialize data into X402V2PaymentRequirements + # deserialize data into X402V1PaymentRequirements try: - instance.actual_instance = X402V2PaymentRequirements.from_json(json_str) + instance.actual_instance = X402V1PaymentRequirements.from_json(json_str) match += 1 except (ValidationError, ValueError) as e: error_messages.append(str(e)) diff --git a/python/cdp/openapi_client/models/x402_v1_payment_payload.py b/python/cdp/openapi_client/models/x402_v1_payment_payload.py index 2d624d279..74f7b0db4 100644 --- a/python/cdp/openapi_client/models/x402_v1_payment_payload.py +++ b/python/cdp/openapi_client/models/x402_v1_payment_payload.py @@ -20,7 +20,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator from typing import Any, ClassVar, Dict, List -from cdp.openapi_client.models.x402_v1_payment_payload_payload import X402V1PaymentPayloadPayload +from cdp.openapi_client.models.x402_v2_payment_payload_payload import X402V2PaymentPayloadPayload from cdp.openapi_client.models.x402_version import X402Version from typing import Optional, Set from typing_extensions import Self @@ -32,7 +32,7 @@ class X402V1PaymentPayload(BaseModel): x402_version: X402Version = Field(alias="x402Version") scheme: StrictStr = Field(description="The scheme of the payment protocol to use. Currently, the only supported scheme is `exact`.") network: StrictStr = Field(description="The network of the blockchain to send payment on.") - payload: X402V1PaymentPayloadPayload + payload: X402V2PaymentPayloadPayload __properties: ClassVar[List[str]] = ["x402Version", "scheme", "network", "payload"] @field_validator('scheme') @@ -106,7 +106,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "x402Version": obj.get("x402Version"), "scheme": obj.get("scheme"), "network": obj.get("network"), - "payload": X402V1PaymentPayloadPayload.from_dict(obj["payload"]) if obj.get("payload") is not None else None + "payload": X402V2PaymentPayloadPayload.from_dict(obj["payload"]) if obj.get("payload") is not None else None }) return _obj diff --git a/python/cdp/openapi_client/models/x402_v2_payment_payload.py b/python/cdp/openapi_client/models/x402_v2_payment_payload.py index 1e90b2bdf..a1cda7ca0 100644 --- a/python/cdp/openapi_client/models/x402_v2_payment_payload.py +++ b/python/cdp/openapi_client/models/x402_v2_payment_payload.py @@ -21,7 +21,7 @@ from pydantic import BaseModel, ConfigDict, Field from typing import Any, ClassVar, Dict, List, Optional from cdp.openapi_client.models.x402_resource_info import X402ResourceInfo -from cdp.openapi_client.models.x402_v1_payment_payload_payload import X402V1PaymentPayloadPayload +from cdp.openapi_client.models.x402_v2_payment_payload_payload import X402V2PaymentPayloadPayload from cdp.openapi_client.models.x402_v2_payment_requirements import X402V2PaymentRequirements from cdp.openapi_client.models.x402_version import X402Version from typing import Optional, Set @@ -32,7 +32,7 @@ class X402V2PaymentPayload(BaseModel): The x402 protocol payment payload that the client attaches to x402-paid API requests to the resource server in the X-PAYMENT header. """ # noqa: E501 x402_version: X402Version = Field(alias="x402Version") - payload: X402V1PaymentPayloadPayload + payload: X402V2PaymentPayloadPayload accepted: X402V2PaymentRequirements resource: Optional[X402ResourceInfo] = None extensions: Optional[Dict[str, Any]] = Field(default=None, description="Optional protocol extensions.") @@ -99,7 +99,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "x402Version": obj.get("x402Version"), - "payload": X402V1PaymentPayloadPayload.from_dict(obj["payload"]) if obj.get("payload") is not None else None, + "payload": X402V2PaymentPayloadPayload.from_dict(obj["payload"]) if obj.get("payload") is not None else None, "accepted": X402V2PaymentRequirements.from_dict(obj["accepted"]) if obj.get("accepted") is not None else None, "resource": X402ResourceInfo.from_dict(obj["resource"]) if obj.get("resource") is not None else None, "extensions": obj.get("extensions") diff --git a/python/cdp/openapi_client/models/x402_v1_payment_payload_payload.py b/python/cdp/openapi_client/models/x402_v2_payment_payload_payload.py similarity index 93% rename from python/cdp/openapi_client/models/x402_v1_payment_payload_payload.py rename to python/cdp/openapi_client/models/x402_v2_payment_payload_payload.py index c853dde3e..4a0760bd5 100644 --- a/python/cdp/openapi_client/models/x402_v1_payment_payload_payload.py +++ b/python/cdp/openapi_client/models/x402_v2_payment_payload_payload.py @@ -25,9 +25,9 @@ from typing import Union, List, Set, Optional, Dict from typing_extensions import Literal, Self -X402V1PAYMENTPAYLOADPAYLOAD_ONE_OF_SCHEMAS = ["X402ExactEvmPayload", "X402ExactEvmPermit2Payload", "X402ExactSolanaPayload"] +X402V2PAYMENTPAYLOADPAYLOAD_ONE_OF_SCHEMAS = ["X402ExactEvmPayload", "X402ExactEvmPermit2Payload", "X402ExactSolanaPayload"] -class X402V1PaymentPayloadPayload(BaseModel): +class X402V2PaymentPayloadPayload(BaseModel): """ The payload of the payment depending on the x402Version, scheme, and network. """ @@ -58,7 +58,7 @@ def __init__(self, *args, **kwargs) -> None: @field_validator('actual_instance') def actual_instance_must_validate_oneof(cls, v): - instance = X402V1PaymentPayloadPayload.model_construct() + instance = X402V2PaymentPayloadPayload.model_construct() error_messages = [] match = 0 # validate data type: X402ExactEvmPayload @@ -78,10 +78,10 @@ def actual_instance_must_validate_oneof(cls, v): match += 1 if match > 1: # more than 1 match - raise ValueError("Multiple matches found when setting `actual_instance` in X402V1PaymentPayloadPayload with oneOf schemas: X402ExactEvmPayload, X402ExactEvmPermit2Payload, X402ExactSolanaPayload. Details: " + ", ".join(error_messages)) + raise ValueError("Multiple matches found when setting `actual_instance` in X402V2PaymentPayloadPayload with oneOf schemas: X402ExactEvmPayload, X402ExactEvmPermit2Payload, X402ExactSolanaPayload. Details: " + ", ".join(error_messages)) elif match == 0: # no match - raise ValueError("No match found when setting `actual_instance` in X402V1PaymentPayloadPayload with oneOf schemas: X402ExactEvmPayload, X402ExactEvmPermit2Payload, X402ExactSolanaPayload. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when setting `actual_instance` in X402V2PaymentPayloadPayload with oneOf schemas: X402ExactEvmPayload, X402ExactEvmPermit2Payload, X402ExactSolanaPayload. Details: " + ", ".join(error_messages)) else: return v @@ -117,10 +117,10 @@ def from_json(cls, json_str: str) -> Self: if match > 1: # more than 1 match - raise ValueError("Multiple matches found when deserializing the JSON string into X402V1PaymentPayloadPayload with oneOf schemas: X402ExactEvmPayload, X402ExactEvmPermit2Payload, X402ExactSolanaPayload. Details: " + ", ".join(error_messages)) + raise ValueError("Multiple matches found when deserializing the JSON string into X402V2PaymentPayloadPayload with oneOf schemas: X402ExactEvmPayload, X402ExactEvmPermit2Payload, X402ExactSolanaPayload. Details: " + ", ".join(error_messages)) elif match == 0: # no match - raise ValueError("No match found when deserializing the JSON string into X402V1PaymentPayloadPayload with oneOf schemas: X402ExactEvmPayload, X402ExactEvmPermit2Payload, X402ExactSolanaPayload. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when deserializing the JSON string into X402V2PaymentPayloadPayload with oneOf schemas: X402ExactEvmPayload, X402ExactEvmPermit2Payload, X402ExactSolanaPayload. Details: " + ", ".join(error_messages)) else: return instance diff --git a/python/cdp/openapi_client/test/test_create_evm_eip7702_delegation201_response.py b/python/cdp/openapi_client/test/test_create_evm_eip7702_delegation_with_end_user_account201_response.py similarity index 57% rename from python/cdp/openapi_client/test/test_create_evm_eip7702_delegation201_response.py rename to python/cdp/openapi_client/test/test_create_evm_eip7702_delegation_with_end_user_account201_response.py index 387faab4f..76127f981 100644 --- a/python/cdp/openapi_client/test/test_create_evm_eip7702_delegation201_response.py +++ b/python/cdp/openapi_client/test/test_create_evm_eip7702_delegation_with_end_user_account201_response.py @@ -15,10 +15,10 @@ import unittest -from cdp.openapi_client.models.create_evm_eip7702_delegation201_response import CreateEvmEip7702Delegation201Response +from cdp.openapi_client.models.create_evm_eip7702_delegation_with_end_user_account201_response import CreateEvmEip7702DelegationWithEndUserAccount201Response -class TestCreateEvmEip7702Delegation201Response(unittest.TestCase): - """CreateEvmEip7702Delegation201Response unit test stubs""" +class TestCreateEvmEip7702DelegationWithEndUserAccount201Response(unittest.TestCase): + """CreateEvmEip7702DelegationWithEndUserAccount201Response unit test stubs""" def setUp(self): pass @@ -26,26 +26,26 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional) -> CreateEvmEip7702Delegation201Response: - """Test CreateEvmEip7702Delegation201Response + def make_instance(self, include_optional) -> CreateEvmEip7702DelegationWithEndUserAccount201Response: + """Test CreateEvmEip7702DelegationWithEndUserAccount201Response include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `CreateEvmEip7702Delegation201Response` + # uncomment below to create an instance of `CreateEvmEip7702DelegationWithEndUserAccount201Response` """ - model = CreateEvmEip7702Delegation201Response() + model = CreateEvmEip7702DelegationWithEndUserAccount201Response() if include_optional: - return CreateEvmEip7702Delegation201Response( + return CreateEvmEip7702DelegationWithEndUserAccount201Response( delegation_operation_id = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890' ) else: - return CreateEvmEip7702Delegation201Response( + return CreateEvmEip7702DelegationWithEndUserAccount201Response( delegation_operation_id = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890', ) """ - def testCreateEvmEip7702Delegation201Response(self): - """Test CreateEvmEip7702Delegation201Response""" + def testCreateEvmEip7702DelegationWithEndUserAccount201Response(self): + """Test CreateEvmEip7702DelegationWithEndUserAccount201Response""" # inst_req_only = self.make_instance(include_optional=False) # inst_req_and_optional = self.make_instance(include_optional=True) diff --git a/python/cdp/openapi_client/test/test_create_evm_eip7702_delegation_with_end_user_account_request.py b/python/cdp/openapi_client/test/test_create_evm_eip7702_delegation_with_end_user_account_request.py new file mode 100644 index 000000000..97a7f7f25 --- /dev/null +++ b/python/cdp/openapi_client/test/test_create_evm_eip7702_delegation_with_end_user_account_request.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + Coinbase Developer Platform APIs + + The Coinbase Developer Platform APIs - leading the world's transition onchain. + + The version of the OpenAPI document: 2.0.0 + Contact: cdp@coinbase.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from cdp.openapi_client.models.create_evm_eip7702_delegation_with_end_user_account_request import CreateEvmEip7702DelegationWithEndUserAccountRequest + +class TestCreateEvmEip7702DelegationWithEndUserAccountRequest(unittest.TestCase): + """CreateEvmEip7702DelegationWithEndUserAccountRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CreateEvmEip7702DelegationWithEndUserAccountRequest: + """Test CreateEvmEip7702DelegationWithEndUserAccountRequest + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CreateEvmEip7702DelegationWithEndUserAccountRequest` + """ + model = CreateEvmEip7702DelegationWithEndUserAccountRequest() + if include_optional: + return CreateEvmEip7702DelegationWithEndUserAccountRequest( + address = '0x742d35Cc6634C0532925a3b844Bc454e4438f44e', + network = 'base', + enable_spend_permissions = True, + wallet_secret_id = 'e051beeb-7163-4527-a5b6-35e301529ff2' + ) + else: + return CreateEvmEip7702DelegationWithEndUserAccountRequest( + address = '0x742d35Cc6634C0532925a3b844Bc454e4438f44e', + network = 'base', + ) + """ + + def testCreateEvmEip7702DelegationWithEndUserAccountRequest(self): + """Test CreateEvmEip7702DelegationWithEndUserAccountRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/python/cdp/openapi_client/test/test_embedded_wallets_core_functionality_api.py b/python/cdp/openapi_client/test/test_embedded_wallets_core_functionality_api.py new file mode 100644 index 000000000..f2ee874d1 --- /dev/null +++ b/python/cdp/openapi_client/test/test_embedded_wallets_core_functionality_api.py @@ -0,0 +1,137 @@ +# coding: utf-8 + +""" + Coinbase Developer Platform APIs + + The Coinbase Developer Platform APIs - leading the world's transition onchain. + + The version of the OpenAPI document: 2.0.0 + Contact: cdp@coinbase.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from cdp.openapi_client.api.embedded_wallets_core_functionality_api import EmbeddedWalletsCoreFunctionalityApi + + +class TestEmbeddedWalletsCoreFunctionalityApi(unittest.IsolatedAsyncioTestCase): + """EmbeddedWalletsCoreFunctionalityApi unit test stubs""" + + async def asyncSetUp(self) -> None: + self.api = EmbeddedWalletsCoreFunctionalityApi() + + async def asyncTearDown(self) -> None: + await self.api.api_client.close() + + async def test_create_evm_eip7702_delegation_with_end_user_account(self) -> None: + """Test case for create_evm_eip7702_delegation_with_end_user_account + + Create EIP-7702 delegation for end user EVM account + """ + pass + + async def test_revoke_delegation_for_end_user(self) -> None: + """Test case for revoke_delegation_for_end_user + + Revoke delegation for end user + """ + pass + + async def test_revoke_spend_permission_with_end_user_account(self) -> None: + """Test case for revoke_spend_permission_with_end_user_account + + Revoke a spend permission + """ + pass + + async def test_send_evm_asset_with_end_user_account(self) -> None: + """Test case for send_evm_asset_with_end_user_account + + Send USDC on EVM + """ + pass + + async def test_send_evm_transaction_with_end_user_account(self) -> None: + """Test case for send_evm_transaction_with_end_user_account + + Send a transaction with end user EVM account + """ + pass + + async def test_send_solana_asset_with_end_user_account(self) -> None: + """Test case for send_solana_asset_with_end_user_account + + Send USDC on Solana + """ + pass + + async def test_send_solana_transaction_with_end_user_account(self) -> None: + """Test case for send_solana_transaction_with_end_user_account + + Send a transaction with end user Solana account + """ + pass + + async def test_send_user_operation_with_end_user_account(self) -> None: + """Test case for send_user_operation_with_end_user_account + + Send a user operation for end user Smart Account + """ + pass + + async def test_sign_evm_hash_with_end_user_account(self) -> None: + """Test case for sign_evm_hash_with_end_user_account + + Sign a hash with end user EVM account + """ + pass + + async def test_sign_evm_message_with_end_user_account(self) -> None: + """Test case for sign_evm_message_with_end_user_account + + Sign an EIP-191 message with end user EVM account + """ + pass + + async def test_sign_evm_transaction_with_end_user_account(self) -> None: + """Test case for sign_evm_transaction_with_end_user_account + + Sign a transaction with end user EVM account + """ + pass + + async def test_sign_evm_typed_data_with_end_user_account(self) -> None: + """Test case for sign_evm_typed_data_with_end_user_account + + Sign EIP-712 typed data with end user EVM account + """ + pass + + async def test_sign_solana_hash_with_end_user_account(self) -> None: + """Test case for sign_solana_hash_with_end_user_account + + Sign a hash with end user Solana account + """ + pass + + async def test_sign_solana_message_with_end_user_account(self) -> None: + """Test case for sign_solana_message_with_end_user_account + + Sign a Base64 encoded message + """ + pass + + async def test_sign_solana_transaction_with_end_user_account(self) -> None: + """Test case for sign_solana_transaction_with_end_user_account + + Sign a transaction with end user Solana account + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/python/cdp/openapi_client/test/test_evm_spend_permissions_revoke_spend_permission_request.py b/python/cdp/openapi_client/test/test_evm_spend_permissions_revoke_spend_permission_request.py new file mode 100644 index 000000000..78972569f --- /dev/null +++ b/python/cdp/openapi_client/test/test_evm_spend_permissions_revoke_spend_permission_request.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Coinbase Developer Platform APIs + + The Coinbase Developer Platform APIs - leading the world's transition onchain. + + The version of the OpenAPI document: 2.0.0 + Contact: cdp@coinbase.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from cdp.openapi_client.models.evm_spend_permissions_revoke_spend_permission_request import EvmSpendPermissionsRevokeSpendPermissionRequest + +class TestEvmSpendPermissionsRevokeSpendPermissionRequest(unittest.TestCase): + """EvmSpendPermissionsRevokeSpendPermissionRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EvmSpendPermissionsRevokeSpendPermissionRequest: + """Test EvmSpendPermissionsRevokeSpendPermissionRequest + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EvmSpendPermissionsRevokeSpendPermissionRequest` + """ + model = EvmSpendPermissionsRevokeSpendPermissionRequest() + if include_optional: + return EvmSpendPermissionsRevokeSpendPermissionRequest( + network = 'base', + permission_hash = '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef', + paymaster_url = 'https://example.com' + ) + else: + return EvmSpendPermissionsRevokeSpendPermissionRequest( + network = 'base', + permission_hash = '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef', + ) + """ + + def testEvmSpendPermissionsRevokeSpendPermissionRequest(self): + """Test EvmSpendPermissionsRevokeSpendPermissionRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/python/cdp/openapi_client/test/test_revoke_delegation_for_end_user_request.py b/python/cdp/openapi_client/test/test_revoke_delegation_for_end_user_request.py new file mode 100644 index 000000000..fd86abd6d --- /dev/null +++ b/python/cdp/openapi_client/test/test_revoke_delegation_for_end_user_request.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Coinbase Developer Platform APIs + + The Coinbase Developer Platform APIs - leading the world's transition onchain. + + The version of the OpenAPI document: 2.0.0 + Contact: cdp@coinbase.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from cdp.openapi_client.models.revoke_delegation_for_end_user_request import RevokeDelegationForEndUserRequest + +class TestRevokeDelegationForEndUserRequest(unittest.TestCase): + """RevokeDelegationForEndUserRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RevokeDelegationForEndUserRequest: + """Test RevokeDelegationForEndUserRequest + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `RevokeDelegationForEndUserRequest` + """ + model = RevokeDelegationForEndUserRequest() + if include_optional: + return RevokeDelegationForEndUserRequest( + wallet_secret_id = 'e051beeb-7163-4527-a5b6-35e301529ff2' + ) + else: + return RevokeDelegationForEndUserRequest( + ) + """ + + def testRevokeDelegationForEndUserRequest(self): + """Test RevokeDelegationForEndUserRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/python/cdp/openapi_client/test/test_revoke_spend_permission_request.py b/python/cdp/openapi_client/test/test_revoke_spend_permission_request.py index b5230e4b6..b43c59871 100644 --- a/python/cdp/openapi_client/test/test_revoke_spend_permission_request.py +++ b/python/cdp/openapi_client/test/test_revoke_spend_permission_request.py @@ -36,14 +36,18 @@ def make_instance(self, include_optional) -> RevokeSpendPermissionRequest: model = RevokeSpendPermissionRequest() if include_optional: return RevokeSpendPermissionRequest( + wallet_secret_id = 'e051beeb-7163-4527-a5b6-35e301529ff2', network = 'base', permission_hash = '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef', + use_cdp_paymaster = True, paymaster_url = 'https://example.com' ) else: return RevokeSpendPermissionRequest( + wallet_secret_id = 'e051beeb-7163-4527-a5b6-35e301529ff2', network = 'base', permission_hash = '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef', + use_cdp_paymaster = True, ) """ diff --git a/python/cdp/openapi_client/test/test_send_evm_asset_with_end_user_account200_response.py b/python/cdp/openapi_client/test/test_send_evm_asset_with_end_user_account200_response.py new file mode 100644 index 000000000..91c925d97 --- /dev/null +++ b/python/cdp/openapi_client/test/test_send_evm_asset_with_end_user_account200_response.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Coinbase Developer Platform APIs + + The Coinbase Developer Platform APIs - leading the world's transition onchain. + + The version of the OpenAPI document: 2.0.0 + Contact: cdp@coinbase.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from cdp.openapi_client.models.send_evm_asset_with_end_user_account200_response import SendEvmAssetWithEndUserAccount200Response + +class TestSendEvmAssetWithEndUserAccount200Response(unittest.TestCase): + """SendEvmAssetWithEndUserAccount200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SendEvmAssetWithEndUserAccount200Response: + """Test SendEvmAssetWithEndUserAccount200Response + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SendEvmAssetWithEndUserAccount200Response` + """ + model = SendEvmAssetWithEndUserAccount200Response() + if include_optional: + return SendEvmAssetWithEndUserAccount200Response( + transaction_hash = '0xf8f98fb6726fc936f24b2007df5cb20e2b8444ff3dfaa2a929335f432a9be2e7', + user_op_hash = '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef' + ) + else: + return SendEvmAssetWithEndUserAccount200Response( + ) + """ + + def testSendEvmAssetWithEndUserAccount200Response(self): + """Test SendEvmAssetWithEndUserAccount200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/python/cdp/openapi_client/test/test_send_evm_asset_with_end_user_account_request.py b/python/cdp/openapi_client/test/test_send_evm_asset_with_end_user_account_request.py new file mode 100644 index 000000000..a4b4d7dfe --- /dev/null +++ b/python/cdp/openapi_client/test/test_send_evm_asset_with_end_user_account_request.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Coinbase Developer Platform APIs + + The Coinbase Developer Platform APIs - leading the world's transition onchain. + + The version of the OpenAPI document: 2.0.0 + Contact: cdp@coinbase.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from cdp.openapi_client.models.send_evm_asset_with_end_user_account_request import SendEvmAssetWithEndUserAccountRequest + +class TestSendEvmAssetWithEndUserAccountRequest(unittest.TestCase): + """SendEvmAssetWithEndUserAccountRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SendEvmAssetWithEndUserAccountRequest: + """Test SendEvmAssetWithEndUserAccountRequest + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SendEvmAssetWithEndUserAccountRequest` + """ + model = SendEvmAssetWithEndUserAccountRequest() + if include_optional: + return SendEvmAssetWithEndUserAccountRequest( + to = '0x742d35Cc6634C0532925a3b844Bc454e4438f44e', + amount = '1.50', + network = 'base-sepolia', + use_cdp_paymaster = True, + paymaster_url = 'https://example.com', + wallet_secret_id = 'e051beeb-7163-4527-a5b6-35e301529ff2' + ) + else: + return SendEvmAssetWithEndUserAccountRequest( + to = '0x742d35Cc6634C0532925a3b844Bc454e4438f44e', + amount = '1.50', + network = 'base-sepolia', + ) + """ + + def testSendEvmAssetWithEndUserAccountRequest(self): + """Test SendEvmAssetWithEndUserAccountRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/python/cdp/openapi_client/test/test_send_evm_transaction200_response.py b/python/cdp/openapi_client/test/test_send_evm_transaction_with_end_user_account200_response.py similarity index 61% rename from python/cdp/openapi_client/test/test_send_evm_transaction200_response.py rename to python/cdp/openapi_client/test/test_send_evm_transaction_with_end_user_account200_response.py index f662cc2eb..3fd838b0a 100644 --- a/python/cdp/openapi_client/test/test_send_evm_transaction200_response.py +++ b/python/cdp/openapi_client/test/test_send_evm_transaction_with_end_user_account200_response.py @@ -15,10 +15,10 @@ import unittest -from cdp.openapi_client.models.send_evm_transaction200_response import SendEvmTransaction200Response +from cdp.openapi_client.models.send_evm_transaction_with_end_user_account200_response import SendEvmTransactionWithEndUserAccount200Response -class TestSendEvmTransaction200Response(unittest.TestCase): - """SendEvmTransaction200Response unit test stubs""" +class TestSendEvmTransactionWithEndUserAccount200Response(unittest.TestCase): + """SendEvmTransactionWithEndUserAccount200Response unit test stubs""" def setUp(self): pass @@ -26,26 +26,26 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional) -> SendEvmTransaction200Response: - """Test SendEvmTransaction200Response + def make_instance(self, include_optional) -> SendEvmTransactionWithEndUserAccount200Response: + """Test SendEvmTransactionWithEndUserAccount200Response include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `SendEvmTransaction200Response` + # uncomment below to create an instance of `SendEvmTransactionWithEndUserAccount200Response` """ - model = SendEvmTransaction200Response() + model = SendEvmTransactionWithEndUserAccount200Response() if include_optional: - return SendEvmTransaction200Response( + return SendEvmTransactionWithEndUserAccount200Response( transaction_hash = '0xf8f98fb6726fc936f24b2007df5cb20e2b8444ff3dfaa2a929335f432a9be2e7' ) else: - return SendEvmTransaction200Response( + return SendEvmTransactionWithEndUserAccount200Response( transaction_hash = '0xf8f98fb6726fc936f24b2007df5cb20e2b8444ff3dfaa2a929335f432a9be2e7', ) """ - def testSendEvmTransaction200Response(self): - """Test SendEvmTransaction200Response""" + def testSendEvmTransactionWithEndUserAccount200Response(self): + """Test SendEvmTransactionWithEndUserAccount200Response""" # inst_req_only = self.make_instance(include_optional=False) # inst_req_and_optional = self.make_instance(include_optional=True) diff --git a/python/cdp/openapi_client/test/test_send_evm_transaction_with_end_user_account_request.py b/python/cdp/openapi_client/test/test_send_evm_transaction_with_end_user_account_request.py new file mode 100644 index 000000000..5c183019c --- /dev/null +++ b/python/cdp/openapi_client/test/test_send_evm_transaction_with_end_user_account_request.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + Coinbase Developer Platform APIs + + The Coinbase Developer Platform APIs - leading the world's transition onchain. + + The version of the OpenAPI document: 2.0.0 + Contact: cdp@coinbase.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from cdp.openapi_client.models.send_evm_transaction_with_end_user_account_request import SendEvmTransactionWithEndUserAccountRequest + +class TestSendEvmTransactionWithEndUserAccountRequest(unittest.TestCase): + """SendEvmTransactionWithEndUserAccountRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SendEvmTransactionWithEndUserAccountRequest: + """Test SendEvmTransactionWithEndUserAccountRequest + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SendEvmTransactionWithEndUserAccountRequest` + """ + model = SendEvmTransactionWithEndUserAccountRequest() + if include_optional: + return SendEvmTransactionWithEndUserAccountRequest( + address = '0x742d35Cc6634C0532925a3b844Bc454e4438f44e', + network = 'base-sepolia', + wallet_secret_id = 'e051beeb-7163-4527-a5b6-35e301529ff2', + transaction = '0xf86b098505d21dba00830334509431415daf58e2c6b7323b4c58712fd92952145da79018080' + ) + else: + return SendEvmTransactionWithEndUserAccountRequest( + address = '0x742d35Cc6634C0532925a3b844Bc454e4438f44e', + network = 'base-sepolia', + transaction = '0xf86b098505d21dba00830334509431415daf58e2c6b7323b4c58712fd92952145da79018080', + ) + """ + + def testSendEvmTransactionWithEndUserAccountRequest(self): + """Test SendEvmTransactionWithEndUserAccountRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/python/cdp/openapi_client/test/test_send_solana_asset_with_end_user_account_request.py b/python/cdp/openapi_client/test/test_send_solana_asset_with_end_user_account_request.py new file mode 100644 index 000000000..75611a755 --- /dev/null +++ b/python/cdp/openapi_client/test/test_send_solana_asset_with_end_user_account_request.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Coinbase Developer Platform APIs + + The Coinbase Developer Platform APIs - leading the world's transition onchain. + + The version of the OpenAPI document: 2.0.0 + Contact: cdp@coinbase.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from cdp.openapi_client.models.send_solana_asset_with_end_user_account_request import SendSolanaAssetWithEndUserAccountRequest + +class TestSendSolanaAssetWithEndUserAccountRequest(unittest.TestCase): + """SendSolanaAssetWithEndUserAccountRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SendSolanaAssetWithEndUserAccountRequest: + """Test SendSolanaAssetWithEndUserAccountRequest + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SendSolanaAssetWithEndUserAccountRequest` + """ + model = SendSolanaAssetWithEndUserAccountRequest() + if include_optional: + return SendSolanaAssetWithEndUserAccountRequest( + to = '0x742d35Cc6634C0532925a3b844Bc454e4438f44e', + amount = '1.50', + network = 'solana-devnet', + create_recipient_ata = True, + wallet_secret_id = 'e051beeb-7163-4527-a5b6-35e301529ff2', + use_cdp_sponsor = True + ) + else: + return SendSolanaAssetWithEndUserAccountRequest( + to = '0x742d35Cc6634C0532925a3b844Bc454e4438f44e', + amount = '1.50', + network = 'solana-devnet', + ) + """ + + def testSendSolanaAssetWithEndUserAccountRequest(self): + """Test SendSolanaAssetWithEndUserAccountRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/python/cdp/openapi_client/test/test_send_solana_transaction200_response.py b/python/cdp/openapi_client/test/test_send_solana_transaction_with_end_user_account200_response.py similarity index 61% rename from python/cdp/openapi_client/test/test_send_solana_transaction200_response.py rename to python/cdp/openapi_client/test/test_send_solana_transaction_with_end_user_account200_response.py index a2cc99957..a3beda8a5 100644 --- a/python/cdp/openapi_client/test/test_send_solana_transaction200_response.py +++ b/python/cdp/openapi_client/test/test_send_solana_transaction_with_end_user_account200_response.py @@ -15,10 +15,10 @@ import unittest -from cdp.openapi_client.models.send_solana_transaction200_response import SendSolanaTransaction200Response +from cdp.openapi_client.models.send_solana_transaction_with_end_user_account200_response import SendSolanaTransactionWithEndUserAccount200Response -class TestSendSolanaTransaction200Response(unittest.TestCase): - """SendSolanaTransaction200Response unit test stubs""" +class TestSendSolanaTransactionWithEndUserAccount200Response(unittest.TestCase): + """SendSolanaTransactionWithEndUserAccount200Response unit test stubs""" def setUp(self): pass @@ -26,26 +26,26 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional) -> SendSolanaTransaction200Response: - """Test SendSolanaTransaction200Response + def make_instance(self, include_optional) -> SendSolanaTransactionWithEndUserAccount200Response: + """Test SendSolanaTransactionWithEndUserAccount200Response include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `SendSolanaTransaction200Response` + # uncomment below to create an instance of `SendSolanaTransactionWithEndUserAccount200Response` """ - model = SendSolanaTransaction200Response() + model = SendSolanaTransactionWithEndUserAccount200Response() if include_optional: - return SendSolanaTransaction200Response( + return SendSolanaTransactionWithEndUserAccount200Response( transaction_signature = '5VERv8NMvzbJMEkV8xnrLkEaWRtSz9CosKDYjCJjBRnbJLgp8uirBgmQpjKhoR4tjF3ZpRzrFmBV6UjKdiSZkQUW' ) else: - return SendSolanaTransaction200Response( + return SendSolanaTransactionWithEndUserAccount200Response( transaction_signature = '5VERv8NMvzbJMEkV8xnrLkEaWRtSz9CosKDYjCJjBRnbJLgp8uirBgmQpjKhoR4tjF3ZpRzrFmBV6UjKdiSZkQUW', ) """ - def testSendSolanaTransaction200Response(self): - """Test SendSolanaTransaction200Response""" + def testSendSolanaTransactionWithEndUserAccount200Response(self): + """Test SendSolanaTransactionWithEndUserAccount200Response""" # inst_req_only = self.make_instance(include_optional=False) # inst_req_and_optional = self.make_instance(include_optional=True) diff --git a/python/cdp/openapi_client/test/test_send_solana_transaction_with_end_user_account_request.py b/python/cdp/openapi_client/test/test_send_solana_transaction_with_end_user_account_request.py new file mode 100644 index 000000000..f722f4d5b --- /dev/null +++ b/python/cdp/openapi_client/test/test_send_solana_transaction_with_end_user_account_request.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + Coinbase Developer Platform APIs + + The Coinbase Developer Platform APIs - leading the world's transition onchain. + + The version of the OpenAPI document: 2.0.0 + Contact: cdp@coinbase.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from cdp.openapi_client.models.send_solana_transaction_with_end_user_account_request import SendSolanaTransactionWithEndUserAccountRequest + +class TestSendSolanaTransactionWithEndUserAccountRequest(unittest.TestCase): + """SendSolanaTransactionWithEndUserAccountRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SendSolanaTransactionWithEndUserAccountRequest: + """Test SendSolanaTransactionWithEndUserAccountRequest + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SendSolanaTransactionWithEndUserAccountRequest` + """ + model = SendSolanaTransactionWithEndUserAccountRequest() + if include_optional: + return SendSolanaTransactionWithEndUserAccountRequest( + address = 'HpabPRRCFbBKSuJr5PdkVvQc85FyxyTWkFM2obBRSvHT', + network = 'solana-devnet', + wallet_secret_id = 'e051beeb-7163-4527-a5b6-35e301529ff2', + transaction = 'AQABAgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAQECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8CBgMBAQAAAAIBAwQAAAAABgIAAAAAAAYDBQEBAAAGBAgAAAAABgUAAAAA6AMAAAAAAAAGBgUBAQEBBgcEAQAAAAYICgMBAQIDBgkCBgAAAAYKAwABAQEGCwMGAQEBBgwDAAABAQAAAAA=', + use_cdp_sponsor = True + ) + else: + return SendSolanaTransactionWithEndUserAccountRequest( + address = 'HpabPRRCFbBKSuJr5PdkVvQc85FyxyTWkFM2obBRSvHT', + network = 'solana-devnet', + transaction = 'AQABAgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAQECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8CBgMBAQAAAAIBAwQAAAAABgIAAAAAAAYDBQEBAAAGBAgAAAAABgUAAAAA6AMAAAAAAAAGBgUBAQEBBgcEAQAAAAYICgMBAQIDBgkCBgAAAAYKAwABAQEGCwMGAQEBBgwDAAABAQAAAAA=', + ) + """ + + def testSendSolanaTransactionWithEndUserAccountRequest(self): + """Test SendSolanaTransactionWithEndUserAccountRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/python/cdp/openapi_client/test/test_send_user_operation_with_end_user_account_request.py b/python/cdp/openapi_client/test/test_send_user_operation_with_end_user_account_request.py new file mode 100644 index 000000000..c736e31a6 --- /dev/null +++ b/python/cdp/openapi_client/test/test_send_user_operation_with_end_user_account_request.py @@ -0,0 +1,72 @@ +# coding: utf-8 + +""" + Coinbase Developer Platform APIs + + The Coinbase Developer Platform APIs - leading the world's transition onchain. + + The version of the OpenAPI document: 2.0.0 + Contact: cdp@coinbase.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from cdp.openapi_client.models.send_user_operation_with_end_user_account_request import SendUserOperationWithEndUserAccountRequest + +class TestSendUserOperationWithEndUserAccountRequest(unittest.TestCase): + """SendUserOperationWithEndUserAccountRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SendUserOperationWithEndUserAccountRequest: + """Test SendUserOperationWithEndUserAccountRequest + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SendUserOperationWithEndUserAccountRequest` + """ + model = SendUserOperationWithEndUserAccountRequest() + if include_optional: + return SendUserOperationWithEndUserAccountRequest( + network = 'base', + calls = [ + cdp.openapi_client.models.evm_call.EvmCall( + to = '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', + value = '0', + data = '0xa9059cbb000000000000000000000000fc807d1be4997e5c7b33e4d8d57e60c5b0f02b1a0000000000000000000000000000000000000000000000000000000000000064', + override_gas_limit = '100000', ) + ], + use_cdp_paymaster = True, + paymaster_url = 'https://example.com', + wallet_secret_id = 'e051beeb-7163-4527-a5b6-35e301529ff2', + data_suffix = '0xdddddddd62617365617070070080218021802180218021802180218021' + ) + else: + return SendUserOperationWithEndUserAccountRequest( + network = 'base', + calls = [ + cdp.openapi_client.models.evm_call.EvmCall( + to = '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', + value = '0', + data = '0xa9059cbb000000000000000000000000fc807d1be4997e5c7b33e4d8d57e60c5b0f02b1a0000000000000000000000000000000000000000000000000000000000000064', + override_gas_limit = '100000', ) + ], + use_cdp_paymaster = True, + ) + """ + + def testSendUserOperationWithEndUserAccountRequest(self): + """Test SendUserOperationWithEndUserAccountRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/python/cdp/openapi_client/test/test_sign_evm_hash200_response.py b/python/cdp/openapi_client/test/test_sign_evm_hash_with_end_user_account200_response.py similarity index 60% rename from python/cdp/openapi_client/test/test_sign_evm_hash200_response.py rename to python/cdp/openapi_client/test/test_sign_evm_hash_with_end_user_account200_response.py index f11f51fa5..44c6c1d68 100644 --- a/python/cdp/openapi_client/test/test_sign_evm_hash200_response.py +++ b/python/cdp/openapi_client/test/test_sign_evm_hash_with_end_user_account200_response.py @@ -15,10 +15,10 @@ import unittest -from cdp.openapi_client.models.sign_evm_hash200_response import SignEvmHash200Response +from cdp.openapi_client.models.sign_evm_hash_with_end_user_account200_response import SignEvmHashWithEndUserAccount200Response -class TestSignEvmHash200Response(unittest.TestCase): - """SignEvmHash200Response unit test stubs""" +class TestSignEvmHashWithEndUserAccount200Response(unittest.TestCase): + """SignEvmHashWithEndUserAccount200Response unit test stubs""" def setUp(self): pass @@ -26,26 +26,26 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional) -> SignEvmHash200Response: - """Test SignEvmHash200Response + def make_instance(self, include_optional) -> SignEvmHashWithEndUserAccount200Response: + """Test SignEvmHashWithEndUserAccount200Response include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `SignEvmHash200Response` + # uncomment below to create an instance of `SignEvmHashWithEndUserAccount200Response` """ - model = SignEvmHash200Response() + model = SignEvmHashWithEndUserAccount200Response() if include_optional: - return SignEvmHash200Response( + return SignEvmHashWithEndUserAccount200Response( signature = '0x1b0c9cf8cd4554c6c6d9e7311e88f1be075d7f25b418a044f4bf2c0a42a93e212ad0a8b54de9e0b5f7e3812de3f2c6cc79aa8c3e1c02e7ad14b4a8f42012c2c01b' ) else: - return SignEvmHash200Response( + return SignEvmHashWithEndUserAccount200Response( signature = '0x1b0c9cf8cd4554c6c6d9e7311e88f1be075d7f25b418a044f4bf2c0a42a93e212ad0a8b54de9e0b5f7e3812de3f2c6cc79aa8c3e1c02e7ad14b4a8f42012c2c01b', ) """ - def testSignEvmHash200Response(self): - """Test SignEvmHash200Response""" + def testSignEvmHashWithEndUserAccount200Response(self): + """Test SignEvmHashWithEndUserAccount200Response""" # inst_req_only = self.make_instance(include_optional=False) # inst_req_and_optional = self.make_instance(include_optional=True) diff --git a/python/cdp/openapi_client/test/test_sign_evm_hash_with_end_user_account_request.py b/python/cdp/openapi_client/test/test_sign_evm_hash_with_end_user_account_request.py new file mode 100644 index 000000000..0759ef804 --- /dev/null +++ b/python/cdp/openapi_client/test/test_sign_evm_hash_with_end_user_account_request.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Coinbase Developer Platform APIs + + The Coinbase Developer Platform APIs - leading the world's transition onchain. + + The version of the OpenAPI document: 2.0.0 + Contact: cdp@coinbase.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from cdp.openapi_client.models.sign_evm_hash_with_end_user_account_request import SignEvmHashWithEndUserAccountRequest + +class TestSignEvmHashWithEndUserAccountRequest(unittest.TestCase): + """SignEvmHashWithEndUserAccountRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SignEvmHashWithEndUserAccountRequest: + """Test SignEvmHashWithEndUserAccountRequest + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SignEvmHashWithEndUserAccountRequest` + """ + model = SignEvmHashWithEndUserAccountRequest() + if include_optional: + return SignEvmHashWithEndUserAccountRequest( + hash = '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef', + address = '0x742d35Cc6634C0532925a3b844Bc454e4438f44e', + wallet_secret_id = 'e051beeb-7163-4527-a5b6-35e301529ff2' + ) + else: + return SignEvmHashWithEndUserAccountRequest( + hash = '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef', + address = '0x742d35Cc6634C0532925a3b844Bc454e4438f44e', + ) + """ + + def testSignEvmHashWithEndUserAccountRequest(self): + """Test SignEvmHashWithEndUserAccountRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/python/cdp/openapi_client/test/test_sign_evm_message200_response.py b/python/cdp/openapi_client/test/test_sign_evm_message_with_end_user_account200_response.py similarity index 62% rename from python/cdp/openapi_client/test/test_sign_evm_message200_response.py rename to python/cdp/openapi_client/test/test_sign_evm_message_with_end_user_account200_response.py index 87dd9ff95..aa18cddd6 100644 --- a/python/cdp/openapi_client/test/test_sign_evm_message200_response.py +++ b/python/cdp/openapi_client/test/test_sign_evm_message_with_end_user_account200_response.py @@ -15,10 +15,10 @@ import unittest -from cdp.openapi_client.models.sign_evm_message200_response import SignEvmMessage200Response +from cdp.openapi_client.models.sign_evm_message_with_end_user_account200_response import SignEvmMessageWithEndUserAccount200Response -class TestSignEvmMessage200Response(unittest.TestCase): - """SignEvmMessage200Response unit test stubs""" +class TestSignEvmMessageWithEndUserAccount200Response(unittest.TestCase): + """SignEvmMessageWithEndUserAccount200Response unit test stubs""" def setUp(self): pass @@ -26,26 +26,26 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional) -> SignEvmMessage200Response: - """Test SignEvmMessage200Response + def make_instance(self, include_optional) -> SignEvmMessageWithEndUserAccount200Response: + """Test SignEvmMessageWithEndUserAccount200Response include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `SignEvmMessage200Response` + # uncomment below to create an instance of `SignEvmMessageWithEndUserAccount200Response` """ - model = SignEvmMessage200Response() + model = SignEvmMessageWithEndUserAccount200Response() if include_optional: - return SignEvmMessage200Response( + return SignEvmMessageWithEndUserAccount200Response( signature = '0x1b0c9cf8cd4554c6c6d9e7311e88f1be075d7f25b418a044f4bf2c0a42a93e212ad0a8b54de9e0b5f7e3812de3f2c6cc79aa8c3e1c02e7ad14b4a8f42012c2c01b' ) else: - return SignEvmMessage200Response( + return SignEvmMessageWithEndUserAccount200Response( signature = '0x1b0c9cf8cd4554c6c6d9e7311e88f1be075d7f25b418a044f4bf2c0a42a93e212ad0a8b54de9e0b5f7e3812de3f2c6cc79aa8c3e1c02e7ad14b4a8f42012c2c01b', ) """ - def testSignEvmMessage200Response(self): - """Test SignEvmMessage200Response""" + def testSignEvmMessageWithEndUserAccount200Response(self): + """Test SignEvmMessageWithEndUserAccount200Response""" # inst_req_only = self.make_instance(include_optional=False) # inst_req_and_optional = self.make_instance(include_optional=True) diff --git a/python/cdp/openapi_client/test/test_sign_evm_message_with_end_user_account_request.py b/python/cdp/openapi_client/test/test_sign_evm_message_with_end_user_account_request.py new file mode 100644 index 000000000..d340c6144 --- /dev/null +++ b/python/cdp/openapi_client/test/test_sign_evm_message_with_end_user_account_request.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Coinbase Developer Platform APIs + + The Coinbase Developer Platform APIs - leading the world's transition onchain. + + The version of the OpenAPI document: 2.0.0 + Contact: cdp@coinbase.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from cdp.openapi_client.models.sign_evm_message_with_end_user_account_request import SignEvmMessageWithEndUserAccountRequest + +class TestSignEvmMessageWithEndUserAccountRequest(unittest.TestCase): + """SignEvmMessageWithEndUserAccountRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SignEvmMessageWithEndUserAccountRequest: + """Test SignEvmMessageWithEndUserAccountRequest + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SignEvmMessageWithEndUserAccountRequest` + """ + model = SignEvmMessageWithEndUserAccountRequest() + if include_optional: + return SignEvmMessageWithEndUserAccountRequest( + address = '0x742d35Cc6634C0532925a3b844Bc454e4438f44e', + message = 'Hello, world!', + wallet_secret_id = 'e051beeb-7163-4527-a5b6-35e301529ff2' + ) + else: + return SignEvmMessageWithEndUserAccountRequest( + address = '0x742d35Cc6634C0532925a3b844Bc454e4438f44e', + message = 'Hello, world!', + ) + """ + + def testSignEvmMessageWithEndUserAccountRequest(self): + """Test SignEvmMessageWithEndUserAccountRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/python/cdp/openapi_client/test/test_sign_evm_transaction200_response.py b/python/cdp/openapi_client/test/test_sign_evm_transaction_with_end_user_account200_response.py similarity index 64% rename from python/cdp/openapi_client/test/test_sign_evm_transaction200_response.py rename to python/cdp/openapi_client/test/test_sign_evm_transaction_with_end_user_account200_response.py index e5b39d6d1..c47bb6b52 100644 --- a/python/cdp/openapi_client/test/test_sign_evm_transaction200_response.py +++ b/python/cdp/openapi_client/test/test_sign_evm_transaction_with_end_user_account200_response.py @@ -15,10 +15,10 @@ import unittest -from cdp.openapi_client.models.sign_evm_transaction200_response import SignEvmTransaction200Response +from cdp.openapi_client.models.sign_evm_transaction_with_end_user_account200_response import SignEvmTransactionWithEndUserAccount200Response -class TestSignEvmTransaction200Response(unittest.TestCase): - """SignEvmTransaction200Response unit test stubs""" +class TestSignEvmTransactionWithEndUserAccount200Response(unittest.TestCase): + """SignEvmTransactionWithEndUserAccount200Response unit test stubs""" def setUp(self): pass @@ -26,26 +26,26 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional) -> SignEvmTransaction200Response: - """Test SignEvmTransaction200Response + def make_instance(self, include_optional) -> SignEvmTransactionWithEndUserAccount200Response: + """Test SignEvmTransactionWithEndUserAccount200Response include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `SignEvmTransaction200Response` + # uncomment below to create an instance of `SignEvmTransactionWithEndUserAccount200Response` """ - model = SignEvmTransaction200Response() + model = SignEvmTransactionWithEndUserAccount200Response() if include_optional: - return SignEvmTransaction200Response( + return SignEvmTransactionWithEndUserAccount200Response( signed_transaction = '0x1b0c9cf8cd4554c6c6d9e7311e88f1be075d7f25b418a044f4bf2c0a42a93e212ad0a8b54de9e0b5f7e3812de3f2c6cc79aa8c3e1c02e7ad14b4a8f42012c2c01b' ) else: - return SignEvmTransaction200Response( + return SignEvmTransactionWithEndUserAccount200Response( signed_transaction = '0x1b0c9cf8cd4554c6c6d9e7311e88f1be075d7f25b418a044f4bf2c0a42a93e212ad0a8b54de9e0b5f7e3812de3f2c6cc79aa8c3e1c02e7ad14b4a8f42012c2c01b', ) """ - def testSignEvmTransaction200Response(self): - """Test SignEvmTransaction200Response""" + def testSignEvmTransactionWithEndUserAccount200Response(self): + """Test SignEvmTransactionWithEndUserAccount200Response""" # inst_req_only = self.make_instance(include_optional=False) # inst_req_and_optional = self.make_instance(include_optional=True) diff --git a/python/cdp/openapi_client/test/test_sign_evm_transaction_with_end_user_account_request.py b/python/cdp/openapi_client/test/test_sign_evm_transaction_with_end_user_account_request.py new file mode 100644 index 000000000..91ff6f8e5 --- /dev/null +++ b/python/cdp/openapi_client/test/test_sign_evm_transaction_with_end_user_account_request.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Coinbase Developer Platform APIs + + The Coinbase Developer Platform APIs - leading the world's transition onchain. + + The version of the OpenAPI document: 2.0.0 + Contact: cdp@coinbase.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from cdp.openapi_client.models.sign_evm_transaction_with_end_user_account_request import SignEvmTransactionWithEndUserAccountRequest + +class TestSignEvmTransactionWithEndUserAccountRequest(unittest.TestCase): + """SignEvmTransactionWithEndUserAccountRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SignEvmTransactionWithEndUserAccountRequest: + """Test SignEvmTransactionWithEndUserAccountRequest + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SignEvmTransactionWithEndUserAccountRequest` + """ + model = SignEvmTransactionWithEndUserAccountRequest() + if include_optional: + return SignEvmTransactionWithEndUserAccountRequest( + address = '0x742d35Cc6634C0532925a3b844Bc454e4438f44e', + transaction = '0xf86b098505d21dba00830334509431415daf58e2c6b7323b4c58712fd92952145da79018080', + wallet_secret_id = 'e051beeb-7163-4527-a5b6-35e301529ff2' + ) + else: + return SignEvmTransactionWithEndUserAccountRequest( + address = '0x742d35Cc6634C0532925a3b844Bc454e4438f44e', + transaction = '0xf86b098505d21dba00830334509431415daf58e2c6b7323b4c58712fd92952145da79018080', + ) + """ + + def testSignEvmTransactionWithEndUserAccountRequest(self): + """Test SignEvmTransactionWithEndUserAccountRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/python/cdp/openapi_client/test/test_sign_evm_typed_data200_response.py b/python/cdp/openapi_client/test/test_sign_evm_typed_data_with_end_user_account200_response.py similarity index 64% rename from python/cdp/openapi_client/test/test_sign_evm_typed_data200_response.py rename to python/cdp/openapi_client/test/test_sign_evm_typed_data_with_end_user_account200_response.py index df2d66d40..1b220bc72 100644 --- a/python/cdp/openapi_client/test/test_sign_evm_typed_data200_response.py +++ b/python/cdp/openapi_client/test/test_sign_evm_typed_data_with_end_user_account200_response.py @@ -15,10 +15,10 @@ import unittest -from cdp.openapi_client.models.sign_evm_typed_data200_response import SignEvmTypedData200Response +from cdp.openapi_client.models.sign_evm_typed_data_with_end_user_account200_response import SignEvmTypedDataWithEndUserAccount200Response -class TestSignEvmTypedData200Response(unittest.TestCase): - """SignEvmTypedData200Response unit test stubs""" +class TestSignEvmTypedDataWithEndUserAccount200Response(unittest.TestCase): + """SignEvmTypedDataWithEndUserAccount200Response unit test stubs""" def setUp(self): pass @@ -26,26 +26,26 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional) -> SignEvmTypedData200Response: - """Test SignEvmTypedData200Response + def make_instance(self, include_optional) -> SignEvmTypedDataWithEndUserAccount200Response: + """Test SignEvmTypedDataWithEndUserAccount200Response include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `SignEvmTypedData200Response` + # uncomment below to create an instance of `SignEvmTypedDataWithEndUserAccount200Response` """ - model = SignEvmTypedData200Response() + model = SignEvmTypedDataWithEndUserAccount200Response() if include_optional: - return SignEvmTypedData200Response( + return SignEvmTypedDataWithEndUserAccount200Response( signature = '0x1b0c9cf8cd4554c6c6d9e7311e88f1be075d7f25b418a044f4bf2c0a42a93e212ad0a8b54de9e0b5f7e3812de3f2c6cc79aa8c3e1c02e7ad14b4a8f42012c2c01b' ) else: - return SignEvmTypedData200Response( + return SignEvmTypedDataWithEndUserAccount200Response( signature = '0x1b0c9cf8cd4554c6c6d9e7311e88f1be075d7f25b418a044f4bf2c0a42a93e212ad0a8b54de9e0b5f7e3812de3f2c6cc79aa8c3e1c02e7ad14b4a8f42012c2c01b', ) """ - def testSignEvmTypedData200Response(self): - """Test SignEvmTypedData200Response""" + def testSignEvmTypedDataWithEndUserAccount200Response(self): + """Test SignEvmTypedDataWithEndUserAccount200Response""" # inst_req_only = self.make_instance(include_optional=False) # inst_req_and_optional = self.make_instance(include_optional=True) diff --git a/python/cdp/openapi_client/test/test_sign_evm_typed_data_with_end_user_account_request.py b/python/cdp/openapi_client/test/test_sign_evm_typed_data_with_end_user_account_request.py new file mode 100644 index 000000000..286afeb36 --- /dev/null +++ b/python/cdp/openapi_client/test/test_sign_evm_typed_data_with_end_user_account_request.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Coinbase Developer Platform APIs + + The Coinbase Developer Platform APIs - leading the world's transition onchain. + + The version of the OpenAPI document: 2.0.0 + Contact: cdp@coinbase.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from cdp.openapi_client.models.sign_evm_typed_data_with_end_user_account_request import SignEvmTypedDataWithEndUserAccountRequest + +class TestSignEvmTypedDataWithEndUserAccountRequest(unittest.TestCase): + """SignEvmTypedDataWithEndUserAccountRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SignEvmTypedDataWithEndUserAccountRequest: + """Test SignEvmTypedDataWithEndUserAccountRequest + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SignEvmTypedDataWithEndUserAccountRequest` + """ + model = SignEvmTypedDataWithEndUserAccountRequest() + if include_optional: + return SignEvmTypedDataWithEndUserAccountRequest( + address = '0x742d35Cc6634C0532925a3b844Bc454e4438f44e', + typed_data = {domain={name=Permit2, chainId=1, verifyingContract=0x000000000022D473030F116dDEE9F6B43aC78BA3}, types={EIP712Domain=[{name=name, type=string}, {name=chainId, type=uint256}, {name=verifyingContract, type=address}], PermitTransferFrom=[{name=permitted, type=TokenPermissions}, {name=spender, type=address}, {name=nonce, type=uint256}, {name=deadline, type=uint256}], TokenPermissions=[{name=token, type=address}, {name=amount, type=uint256}]}, primaryType=PermitTransferFrom, message={permitted={token=0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48, amount=1000000}, spender=0xFfFfFfFFfFFfFFfFFfFFFFFffFFFffffFfFFFfFf, nonce=123456, deadline=1717123200}}, + wallet_secret_id = 'e051beeb-7163-4527-a5b6-35e301529ff2' + ) + else: + return SignEvmTypedDataWithEndUserAccountRequest( + address = '0x742d35Cc6634C0532925a3b844Bc454e4438f44e', + typed_data = {domain={name=Permit2, chainId=1, verifyingContract=0x000000000022D473030F116dDEE9F6B43aC78BA3}, types={EIP712Domain=[{name=name, type=string}, {name=chainId, type=uint256}, {name=verifyingContract, type=address}], PermitTransferFrom=[{name=permitted, type=TokenPermissions}, {name=spender, type=address}, {name=nonce, type=uint256}, {name=deadline, type=uint256}], TokenPermissions=[{name=token, type=address}, {name=amount, type=uint256}]}, primaryType=PermitTransferFrom, message={permitted={token=0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48, amount=1000000}, spender=0xFfFfFfFFfFFfFFfFFfFFFFFffFFFffffFfFFFfFf, nonce=123456, deadline=1717123200}}, + ) + """ + + def testSignEvmTypedDataWithEndUserAccountRequest(self): + """Test SignEvmTypedDataWithEndUserAccountRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/python/cdp/openapi_client/test/test_sign_solana_hash_with_end_user_account200_response.py b/python/cdp/openapi_client/test/test_sign_solana_hash_with_end_user_account200_response.py new file mode 100644 index 000000000..fb6b5b60e --- /dev/null +++ b/python/cdp/openapi_client/test/test_sign_solana_hash_with_end_user_account200_response.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Coinbase Developer Platform APIs + + The Coinbase Developer Platform APIs - leading the world's transition onchain. + + The version of the OpenAPI document: 2.0.0 + Contact: cdp@coinbase.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from cdp.openapi_client.models.sign_solana_hash_with_end_user_account200_response import SignSolanaHashWithEndUserAccount200Response + +class TestSignSolanaHashWithEndUserAccount200Response(unittest.TestCase): + """SignSolanaHashWithEndUserAccount200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SignSolanaHashWithEndUserAccount200Response: + """Test SignSolanaHashWithEndUserAccount200Response + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SignSolanaHashWithEndUserAccount200Response` + """ + model = SignSolanaHashWithEndUserAccount200Response() + if include_optional: + return SignSolanaHashWithEndUserAccount200Response( + signature = '4YecmNqVT9QFqzuSvE9Zih3toZzNAijjXpj8xupgcC6E4VzwzFjuZBk5P99yz9JQaLRLm1K4L4FpMjxByFxQBe2h' + ) + else: + return SignSolanaHashWithEndUserAccount200Response( + signature = '4YecmNqVT9QFqzuSvE9Zih3toZzNAijjXpj8xupgcC6E4VzwzFjuZBk5P99yz9JQaLRLm1K4L4FpMjxByFxQBe2h', + ) + """ + + def testSignSolanaHashWithEndUserAccount200Response(self): + """Test SignSolanaHashWithEndUserAccount200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/python/cdp/openapi_client/test/test_sign_solana_hash_with_end_user_account_request.py b/python/cdp/openapi_client/test/test_sign_solana_hash_with_end_user_account_request.py new file mode 100644 index 000000000..d1463d535 --- /dev/null +++ b/python/cdp/openapi_client/test/test_sign_solana_hash_with_end_user_account_request.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Coinbase Developer Platform APIs + + The Coinbase Developer Platform APIs - leading the world's transition onchain. + + The version of the OpenAPI document: 2.0.0 + Contact: cdp@coinbase.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from cdp.openapi_client.models.sign_solana_hash_with_end_user_account_request import SignSolanaHashWithEndUserAccountRequest + +class TestSignSolanaHashWithEndUserAccountRequest(unittest.TestCase): + """SignSolanaHashWithEndUserAccountRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SignSolanaHashWithEndUserAccountRequest: + """Test SignSolanaHashWithEndUserAccountRequest + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SignSolanaHashWithEndUserAccountRequest` + """ + model = SignSolanaHashWithEndUserAccountRequest() + if include_optional: + return SignSolanaHashWithEndUserAccountRequest( + hash = '3CSwN61FYbyoT6tM7h2aY7u1YpPLedGrcnxrPv4Fz4xu', + address = 'HpabPRRCFbBKSuJr5PdkVvQc85FyxyTWkFM2obBRSvHT', + wallet_secret_id = 'e051beeb-7163-4527-a5b6-35e301529ff2' + ) + else: + return SignSolanaHashWithEndUserAccountRequest( + hash = '3CSwN61FYbyoT6tM7h2aY7u1YpPLedGrcnxrPv4Fz4xu', + address = 'HpabPRRCFbBKSuJr5PdkVvQc85FyxyTWkFM2obBRSvHT', + ) + """ + + def testSignSolanaHashWithEndUserAccountRequest(self): + """Test SignSolanaHashWithEndUserAccountRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/python/cdp/openapi_client/test/test_sign_solana_message200_response.py b/python/cdp/openapi_client/test/test_sign_solana_message_with_end_user_account200_response.py similarity index 62% rename from python/cdp/openapi_client/test/test_sign_solana_message200_response.py rename to python/cdp/openapi_client/test/test_sign_solana_message_with_end_user_account200_response.py index dc9fa4bf1..b8c484e3b 100644 --- a/python/cdp/openapi_client/test/test_sign_solana_message200_response.py +++ b/python/cdp/openapi_client/test/test_sign_solana_message_with_end_user_account200_response.py @@ -15,10 +15,10 @@ import unittest -from cdp.openapi_client.models.sign_solana_message200_response import SignSolanaMessage200Response +from cdp.openapi_client.models.sign_solana_message_with_end_user_account200_response import SignSolanaMessageWithEndUserAccount200Response -class TestSignSolanaMessage200Response(unittest.TestCase): - """SignSolanaMessage200Response unit test stubs""" +class TestSignSolanaMessageWithEndUserAccount200Response(unittest.TestCase): + """SignSolanaMessageWithEndUserAccount200Response unit test stubs""" def setUp(self): pass @@ -26,26 +26,26 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional) -> SignSolanaMessage200Response: - """Test SignSolanaMessage200Response + def make_instance(self, include_optional) -> SignSolanaMessageWithEndUserAccount200Response: + """Test SignSolanaMessageWithEndUserAccount200Response include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `SignSolanaMessage200Response` + # uncomment below to create an instance of `SignSolanaMessageWithEndUserAccount200Response` """ - model = SignSolanaMessage200Response() + model = SignSolanaMessageWithEndUserAccount200Response() if include_optional: - return SignSolanaMessage200Response( + return SignSolanaMessageWithEndUserAccount200Response( signature = '4YecmNqVT9QFqzuSvE9Zih3toZzNAijjXpj8xupgcC6E4VzwzFjuZBk5P99yz9JQaLRLm1K4L4FpMjxByFxQBe2h' ) else: - return SignSolanaMessage200Response( + return SignSolanaMessageWithEndUserAccount200Response( signature = '4YecmNqVT9QFqzuSvE9Zih3toZzNAijjXpj8xupgcC6E4VzwzFjuZBk5P99yz9JQaLRLm1K4L4FpMjxByFxQBe2h', ) """ - def testSignSolanaMessage200Response(self): - """Test SignSolanaMessage200Response""" + def testSignSolanaMessageWithEndUserAccount200Response(self): + """Test SignSolanaMessageWithEndUserAccount200Response""" # inst_req_only = self.make_instance(include_optional=False) # inst_req_and_optional = self.make_instance(include_optional=True) diff --git a/python/cdp/openapi_client/test/test_sign_solana_message_with_end_user_account_request.py b/python/cdp/openapi_client/test/test_sign_solana_message_with_end_user_account_request.py new file mode 100644 index 000000000..f7cd317a4 --- /dev/null +++ b/python/cdp/openapi_client/test/test_sign_solana_message_with_end_user_account_request.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Coinbase Developer Platform APIs + + The Coinbase Developer Platform APIs - leading the world's transition onchain. + + The version of the OpenAPI document: 2.0.0 + Contact: cdp@coinbase.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from cdp.openapi_client.models.sign_solana_message_with_end_user_account_request import SignSolanaMessageWithEndUserAccountRequest + +class TestSignSolanaMessageWithEndUserAccountRequest(unittest.TestCase): + """SignSolanaMessageWithEndUserAccountRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SignSolanaMessageWithEndUserAccountRequest: + """Test SignSolanaMessageWithEndUserAccountRequest + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SignSolanaMessageWithEndUserAccountRequest` + """ + model = SignSolanaMessageWithEndUserAccountRequest() + if include_optional: + return SignSolanaMessageWithEndUserAccountRequest( + address = 'HpabPRRCFbBKSuJr5PdkVvQc85FyxyTWkFM2obBRSvHT', + message = 'SGVsbG8sIHdvcmxk', + wallet_secret_id = 'e051beeb-7163-4527-a5b6-35e301529ff2' + ) + else: + return SignSolanaMessageWithEndUserAccountRequest( + address = 'HpabPRRCFbBKSuJr5PdkVvQc85FyxyTWkFM2obBRSvHT', + message = 'SGVsbG8sIHdvcmxk', + ) + """ + + def testSignSolanaMessageWithEndUserAccountRequest(self): + """Test SignSolanaMessageWithEndUserAccountRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/python/cdp/openapi_client/test/test_sign_solana_transaction200_response.py b/python/cdp/openapi_client/test/test_sign_solana_transaction_with_end_user_account200_response.py similarity index 68% rename from python/cdp/openapi_client/test/test_sign_solana_transaction200_response.py rename to python/cdp/openapi_client/test/test_sign_solana_transaction_with_end_user_account200_response.py index 3347a05f7..98dc8b222 100644 --- a/python/cdp/openapi_client/test/test_sign_solana_transaction200_response.py +++ b/python/cdp/openapi_client/test/test_sign_solana_transaction_with_end_user_account200_response.py @@ -15,10 +15,10 @@ import unittest -from cdp.openapi_client.models.sign_solana_transaction200_response import SignSolanaTransaction200Response +from cdp.openapi_client.models.sign_solana_transaction_with_end_user_account200_response import SignSolanaTransactionWithEndUserAccount200Response -class TestSignSolanaTransaction200Response(unittest.TestCase): - """SignSolanaTransaction200Response unit test stubs""" +class TestSignSolanaTransactionWithEndUserAccount200Response(unittest.TestCase): + """SignSolanaTransactionWithEndUserAccount200Response unit test stubs""" def setUp(self): pass @@ -26,26 +26,26 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional) -> SignSolanaTransaction200Response: - """Test SignSolanaTransaction200Response + def make_instance(self, include_optional) -> SignSolanaTransactionWithEndUserAccount200Response: + """Test SignSolanaTransactionWithEndUserAccount200Response include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `SignSolanaTransaction200Response` + # uncomment below to create an instance of `SignSolanaTransactionWithEndUserAccount200Response` """ - model = SignSolanaTransaction200Response() + model = SignSolanaTransactionWithEndUserAccount200Response() if include_optional: - return SignSolanaTransaction200Response( + return SignSolanaTransactionWithEndUserAccount200Response( signed_transaction = 'AQACAdSOvpk0UJXs/rQRXYKSI9hcR0bkGp24qGv6t0/M1XjcQpHf6AHwLcPjEtKQI7p/U0Zo98lnJ5/PZMfVq/0BAgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAQECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8CBgMBAQAAAAIBAwQAAAAABgIAAAAAAAYDBQEBAAAGBAgAAAAABgUAAAAA6AMAAAAAAAAGBgUBAQEBBgcEAQAAAAYICgMBAQIDBgkCBgAAAAYKAwABAQEGCwMGAQEBBgwDAAABAQAAAAA=' ) else: - return SignSolanaTransaction200Response( + return SignSolanaTransactionWithEndUserAccount200Response( signed_transaction = 'AQACAdSOvpk0UJXs/rQRXYKSI9hcR0bkGp24qGv6t0/M1XjcQpHf6AHwLcPjEtKQI7p/U0Zo98lnJ5/PZMfVq/0BAgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAQECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8CBgMBAQAAAAIBAwQAAAAABgIAAAAAAAYDBQEBAAAGBAgAAAAABgUAAAAA6AMAAAAAAAAGBgUBAQEBBgcEAQAAAAYICgMBAQIDBgkCBgAAAAYKAwABAQEGCwMGAQEBBgwDAAABAQAAAAA=', ) """ - def testSignSolanaTransaction200Response(self): - """Test SignSolanaTransaction200Response""" + def testSignSolanaTransactionWithEndUserAccount200Response(self): + """Test SignSolanaTransactionWithEndUserAccount200Response""" # inst_req_only = self.make_instance(include_optional=False) # inst_req_and_optional = self.make_instance(include_optional=True) diff --git a/python/cdp/openapi_client/test/test_sign_solana_transaction_with_end_user_account_request.py b/python/cdp/openapi_client/test/test_sign_solana_transaction_with_end_user_account_request.py new file mode 100644 index 000000000..0f0fa14d0 --- /dev/null +++ b/python/cdp/openapi_client/test/test_sign_solana_transaction_with_end_user_account_request.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Coinbase Developer Platform APIs + + The Coinbase Developer Platform APIs - leading the world's transition onchain. + + The version of the OpenAPI document: 2.0.0 + Contact: cdp@coinbase.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from cdp.openapi_client.models.sign_solana_transaction_with_end_user_account_request import SignSolanaTransactionWithEndUserAccountRequest + +class TestSignSolanaTransactionWithEndUserAccountRequest(unittest.TestCase): + """SignSolanaTransactionWithEndUserAccountRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SignSolanaTransactionWithEndUserAccountRequest: + """Test SignSolanaTransactionWithEndUserAccountRequest + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SignSolanaTransactionWithEndUserAccountRequest` + """ + model = SignSolanaTransactionWithEndUserAccountRequest() + if include_optional: + return SignSolanaTransactionWithEndUserAccountRequest( + address = 'HpabPRRCFbBKSuJr5PdkVvQc85FyxyTWkFM2obBRSvHT', + transaction = 'AQABAgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAQECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8CBgMBAQAAAAIBAwQAAAAABgIAAAAAAAYDBQEBAAAGBAgAAAAABgUAAAAA6AMAAAAAAAAGBgUBAQEBBgcEAQAAAAYICgMBAQIDBgkCBgAAAAYKAwABAQEGCwMGAQEBBgwDAAABAQAAAAA=', + wallet_secret_id = 'e051beeb-7163-4527-a5b6-35e301529ff2' + ) + else: + return SignSolanaTransactionWithEndUserAccountRequest( + address = 'HpabPRRCFbBKSuJr5PdkVvQc85FyxyTWkFM2obBRSvHT', + transaction = 'AQABAgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAQECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8CBgMBAQAAAAIBAwQAAAAABgIAAAAAAAYDBQEBAAAGBAgAAAAABgUAAAAA6AMAAAAAAAAGBgUBAQEBBgcEAQAAAAYICgMBAQIDBgkCBgAAAAYKAwABAQEGCwMGAQEBBgwDAAABAQAAAAA=', + ) + """ + + def testSignSolanaTransactionWithEndUserAccountRequest(self): + """Test SignSolanaTransactionWithEndUserAccountRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/python/cdp/openapi_client/test/test_sqlapi_alpha_api.py b/python/cdp/openapi_client/test/test_sqlapi_api.py similarity index 80% rename from python/cdp/openapi_client/test/test_sqlapi_alpha_api.py rename to python/cdp/openapi_client/test/test_sqlapi_api.py index 8ad2feab9..cc6042469 100644 --- a/python/cdp/openapi_client/test/test_sqlapi_alpha_api.py +++ b/python/cdp/openapi_client/test/test_sqlapi_api.py @@ -15,14 +15,14 @@ import unittest -from cdp.openapi_client.api.sqlapi_alpha_api import SQLAPIAlphaApi +from cdp.openapi_client.api.sqlapi_api import SQLAPIApi -class TestSQLAPIAlphaApi(unittest.IsolatedAsyncioTestCase): - """SQLAPIAlphaApi unit test stubs""" +class TestSQLAPIApi(unittest.IsolatedAsyncioTestCase): + """SQLAPIApi unit test stubs""" async def asyncSetUp(self) -> None: - self.api = SQLAPIAlphaApi() + self.api = SQLAPIApi() async def asyncTearDown(self) -> None: await self.api.api_client.close() diff --git a/python/cdp/openapi_client/test/test_verify_x402_payment_request.py b/python/cdp/openapi_client/test/test_verify_x402_payment_request.py index e42a7cc2d..bc2e4b018 100644 --- a/python/cdp/openapi_client/test/test_verify_x402_payment_request.py +++ b/python/cdp/openapi_client/test/test_verify_x402_payment_request.py @@ -36,13 +36,13 @@ def make_instance(self, include_optional) -> VerifyX402PaymentRequest: model = VerifyX402PaymentRequest() if include_optional: return VerifyX402PaymentRequest( - x402_version = 1, + x402_version = 2, payment_payload = cdp.openapi_client.models.x402_payment_payload.x402PaymentPayload(), payment_requirements = cdp.openapi_client.models.x402_payment_requirements.x402PaymentRequirements() ) else: return VerifyX402PaymentRequest( - x402_version = 1, + x402_version = 2, payment_payload = cdp.openapi_client.models.x402_payment_payload.x402PaymentPayload(), payment_requirements = cdp.openapi_client.models.x402_payment_requirements.x402PaymentRequirements(), ) diff --git a/python/cdp/openapi_client/test/test_webhook_subscription_list_response.py b/python/cdp/openapi_client/test/test_webhook_subscription_list_response.py index b903d065f..439c93966 100644 --- a/python/cdp/openapi_client/test/test_webhook_subscription_list_response.py +++ b/python/cdp/openapi_client/test/test_webhook_subscription_list_response.py @@ -38,13 +38,13 @@ def make_instance(self, include_optional) -> WebhookSubscriptionListResponse: return WebhookSubscriptionListResponse( next_page_token = 'eyJsYXN0X2lkIjogImFiYzEyMyIsICJ0aW1lc3RhbXAiOiAxNzA3ODIzNzAxfQ==', subscriptions = [ - {subscriptionId=123e4567-e89b-12d3-a456-426614174000, eventTypes=[onchain.activity.detected], isEnabled=true, labels={contract_address=0x833589fcd6edb6e08f4c7c32d4f71b54bda02913, event_name=Transfer, network=base-mainnet, transaction_to=0xf5042e6ffac5a625d4e7848e0b01373d8eb9e222}, description=USDC Transfer events to specific address., createdAt=2025-11-12T09:19:52.051Z, metadata={secret=a1b2c3d4-e5f6-7890-abcd-ef1234567890}, secret=a1b2c3d4-e5f6-7890-abcd-ef1234567890, target={url=https://api.example.com/webhooks}} + {subscriptionId=123e4567-e89b-12d3-a456-426614174000, eventTypes=[onchain.activity.detected], isEnabled=true, labels={contract_address=0x833589fcd6edb6e08f4c7c32d4f71b54bda02913, event_name=Transfer, network=base-mainnet, transaction_to=0xf5042e6ffac5a625d4e7848e0b01373d8eb9e222}, description=USDC Transfer events to specific address., createdAt=2025-11-12T09:19:52.051Z, updatedAt=2025-11-13T11:30:00.000Z, metadata={secret=a1b2c3d4-e5f6-7890-abcd-ef1234567890}, secret=a1b2c3d4-e5f6-7890-abcd-ef1234567890, target={url=https://api.example.com/webhooks}} ] ) else: return WebhookSubscriptionListResponse( subscriptions = [ - {subscriptionId=123e4567-e89b-12d3-a456-426614174000, eventTypes=[onchain.activity.detected], isEnabled=true, labels={contract_address=0x833589fcd6edb6e08f4c7c32d4f71b54bda02913, event_name=Transfer, network=base-mainnet, transaction_to=0xf5042e6ffac5a625d4e7848e0b01373d8eb9e222}, description=USDC Transfer events to specific address., createdAt=2025-11-12T09:19:52.051Z, metadata={secret=a1b2c3d4-e5f6-7890-abcd-ef1234567890}, secret=a1b2c3d4-e5f6-7890-abcd-ef1234567890, target={url=https://api.example.com/webhooks}} + {subscriptionId=123e4567-e89b-12d3-a456-426614174000, eventTypes=[onchain.activity.detected], isEnabled=true, labels={contract_address=0x833589fcd6edb6e08f4c7c32d4f71b54bda02913, event_name=Transfer, network=base-mainnet, transaction_to=0xf5042e6ffac5a625d4e7848e0b01373d8eb9e222}, description=USDC Transfer events to specific address., createdAt=2025-11-12T09:19:52.051Z, updatedAt=2025-11-13T11:30:00.000Z, metadata={secret=a1b2c3d4-e5f6-7890-abcd-ef1234567890}, secret=a1b2c3d4-e5f6-7890-abcd-ef1234567890, target={url=https://api.example.com/webhooks}} ], ) """ diff --git a/python/cdp/openapi_client/test/test_webhook_subscription_response.py b/python/cdp/openapi_client/test/test_webhook_subscription_response.py index 01d390341..b5215ba4f 100644 --- a/python/cdp/openapi_client/test/test_webhook_subscription_response.py +++ b/python/cdp/openapi_client/test/test_webhook_subscription_response.py @@ -37,6 +37,7 @@ def make_instance(self, include_optional) -> WebhookSubscriptionResponse: if include_optional: return WebhookSubscriptionResponse( created_at = '2025-01-15T10:30:00Z', + updated_at = '2025-01-16T14:00:00Z', description = 'A description of the resource.', event_types = [onchain.activity.detected], is_enabled = True, diff --git a/python/cdp/openapi_client/test/test_x402_payment_payload.py b/python/cdp/openapi_client/test/test_x402_payment_payload.py index 3cb3d0cef..bd13eafed 100644 --- a/python/cdp/openapi_client/test/test_x402_payment_payload.py +++ b/python/cdp/openapi_client/test/test_x402_payment_payload.py @@ -36,9 +36,7 @@ def make_instance(self, include_optional) -> X402PaymentPayload: model = X402PaymentPayload() if include_optional: return X402PaymentPayload( - x402_version = 1, - scheme = 'exact', - network = 'base', + x402_version = 2, payload = {signature=0xf3746613c2d920b5fdabc0856f2aeb2d4f88ee6037b8cc5d04a71a4462f134801234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1b, authorization={from=0x742d35Cc6634C0532925a3b844Bc454e4438f44e, to=0x742d35Cc6634C0532925a3b844Bc454e4438f44e, value=1000000000000000000, validAfter=1716150000, validBefore=1716150000, nonce=0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef}}, accepted = cdp.openapi_client.models.x402_v2_payment_requirements.x402V2PaymentRequirements( scheme = 'exact', @@ -52,13 +50,13 @@ def make_instance(self, include_optional) -> X402PaymentPayload: url = 'https://api.example.com/premium/resource/123', description = Premium API access for data analysis, mime_type = 'application/json', ), - extensions = {bazaar={discoveryEnabled=true}} + extensions = {bazaar={discoveryEnabled=true}}, + scheme = 'exact', + network = 'base' ) else: return X402PaymentPayload( - x402_version = 1, - scheme = 'exact', - network = 'base', + x402_version = 2, payload = {signature=0xf3746613c2d920b5fdabc0856f2aeb2d4f88ee6037b8cc5d04a71a4462f134801234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1b, authorization={from=0x742d35Cc6634C0532925a3b844Bc454e4438f44e, to=0x742d35Cc6634C0532925a3b844Bc454e4438f44e, value=1000000000000000000, validAfter=1716150000, validBefore=1716150000, nonce=0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef}}, accepted = cdp.openapi_client.models.x402_v2_payment_requirements.x402V2PaymentRequirements( scheme = 'exact', @@ -68,6 +66,8 @@ def make_instance(self, include_optional) -> X402PaymentPayload: pay_to = '0x742d35Cc6634C0532925a3b844Bc454e4438f44e', max_timeout_seconds = 10, extra = {name=USDC, version=2}, ), + scheme = 'exact', + network = 'base', ) """ diff --git a/python/cdp/openapi_client/test/test_x402_payment_requirements.py b/python/cdp/openapi_client/test/test_x402_payment_requirements.py index ae2b6ffb6..1877733c2 100644 --- a/python/cdp/openapi_client/test/test_x402_payment_requirements.py +++ b/python/cdp/openapi_client/test/test_x402_payment_requirements.py @@ -37,30 +37,30 @@ def make_instance(self, include_optional) -> X402PaymentRequirements: if include_optional: return X402PaymentRequirements( scheme = 'exact', - network = 'eip155:1', + network = 'base', + asset = '0x742d35Cc6634C0532925a3b844Bc454e4438f44e', + amount = '1000000', + pay_to = '0x742d35Cc6634C0532925a3b844Bc454e4438f44e', + max_timeout_seconds = 10, + extra = {gasLimit=1000000}, max_amount_required = '1000000', resource = 'https://api.example.com/premium/resource/123', description = 'A description of the resource.', mime_type = 'application/json', - output_schema = {data=string}, - pay_to = '0x742d35Cc6634C0532925a3b844Bc454e4438f44e', - max_timeout_seconds = 10, - asset = '0x742d35Cc6634C0532925a3b844Bc454e4438f44e', - extra = {name=USDC, version=2}, - amount = '1000000' + output_schema = {data=string} ) else: return X402PaymentRequirements( scheme = 'exact', - network = 'eip155:1', + network = 'base', + asset = '0x742d35Cc6634C0532925a3b844Bc454e4438f44e', + amount = '1000000', + pay_to = '0x742d35Cc6634C0532925a3b844Bc454e4438f44e', + max_timeout_seconds = 10, max_amount_required = '1000000', resource = 'https://api.example.com/premium/resource/123', description = 'A description of the resource.', mime_type = 'application/json', - pay_to = '0x742d35Cc6634C0532925a3b844Bc454e4438f44e', - max_timeout_seconds = 10, - asset = '0x742d35Cc6634C0532925a3b844Bc454e4438f44e', - amount = '1000000', ) """ diff --git a/python/cdp/openapi_client/test/test_x402_supported_payment_kind.py b/python/cdp/openapi_client/test/test_x402_supported_payment_kind.py index 1bf844db8..07cd3ddc3 100644 --- a/python/cdp/openapi_client/test/test_x402_supported_payment_kind.py +++ b/python/cdp/openapi_client/test/test_x402_supported_payment_kind.py @@ -36,14 +36,14 @@ def make_instance(self, include_optional) -> X402SupportedPaymentKind: model = X402SupportedPaymentKind() if include_optional: return X402SupportedPaymentKind( - x402_version = 1, + x402_version = 2, scheme = 'exact', network = 'base', extra = {feePayer=HpabPRRCFbBKSuJr5PdkVvQc85FyxyTWkFM2obBRSvHT} ) else: return X402SupportedPaymentKind( - x402_version = 1, + x402_version = 2, scheme = 'exact', network = 'base', ) diff --git a/python/cdp/openapi_client/test/test_x402_v1_payment_payload.py b/python/cdp/openapi_client/test/test_x402_v1_payment_payload.py index a4bb54b12..b891b55ca 100644 --- a/python/cdp/openapi_client/test/test_x402_v1_payment_payload.py +++ b/python/cdp/openapi_client/test/test_x402_v1_payment_payload.py @@ -36,14 +36,14 @@ def make_instance(self, include_optional) -> X402V1PaymentPayload: model = X402V1PaymentPayload() if include_optional: return X402V1PaymentPayload( - x402_version = 1, + x402_version = 2, scheme = 'exact', network = 'base', payload = {signature=0xf3746613c2d920b5fdabc0856f2aeb2d4f88ee6037b8cc5d04a71a4462f134801234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1b, authorization={from=0x742d35Cc6634C0532925a3b844Bc454e4438f44e, to=0x742d35Cc6634C0532925a3b844Bc454e4438f44e, value=1000000000000000000, validAfter=1716150000, validBefore=1716150000, nonce=0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef}} ) else: return X402V1PaymentPayload( - x402_version = 1, + x402_version = 2, scheme = 'exact', network = 'base', payload = {signature=0xf3746613c2d920b5fdabc0856f2aeb2d4f88ee6037b8cc5d04a71a4462f134801234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1b, authorization={from=0x742d35Cc6634C0532925a3b844Bc454e4438f44e, to=0x742d35Cc6634C0532925a3b844Bc454e4438f44e, value=1000000000000000000, validAfter=1716150000, validBefore=1716150000, nonce=0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef}}, diff --git a/python/cdp/openapi_client/test/test_x402_v2_payment_payload.py b/python/cdp/openapi_client/test/test_x402_v2_payment_payload.py index f242e691b..98539aeb7 100644 --- a/python/cdp/openapi_client/test/test_x402_v2_payment_payload.py +++ b/python/cdp/openapi_client/test/test_x402_v2_payment_payload.py @@ -36,7 +36,7 @@ def make_instance(self, include_optional) -> X402V2PaymentPayload: model = X402V2PaymentPayload() if include_optional: return X402V2PaymentPayload( - x402_version = 1, + x402_version = 2, payload = {signature=0xf3746613c2d920b5fdabc0856f2aeb2d4f88ee6037b8cc5d04a71a4462f134801234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1b, authorization={from=0x742d35Cc6634C0532925a3b844Bc454e4438f44e, to=0x742d35Cc6634C0532925a3b844Bc454e4438f44e, value=1000000000000000000, validAfter=1716150000, validBefore=1716150000, nonce=0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef}}, accepted = cdp.openapi_client.models.x402_v2_payment_requirements.x402V2PaymentRequirements( scheme = 'exact', @@ -54,7 +54,7 @@ def make_instance(self, include_optional) -> X402V2PaymentPayload: ) else: return X402V2PaymentPayload( - x402_version = 1, + x402_version = 2, payload = {signature=0xf3746613c2d920b5fdabc0856f2aeb2d4f88ee6037b8cc5d04a71a4462f134801234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1b, authorization={from=0x742d35Cc6634C0532925a3b844Bc454e4438f44e, to=0x742d35Cc6634C0532925a3b844Bc454e4438f44e, value=1000000000000000000, validAfter=1716150000, validBefore=1716150000, nonce=0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef}}, accepted = cdp.openapi_client.models.x402_v2_payment_requirements.x402V2PaymentRequirements( scheme = 'exact', diff --git a/python/cdp/openapi_client/test/test_x402_v1_payment_payload_payload.py b/python/cdp/openapi_client/test/test_x402_v2_payment_payload_payload.py similarity index 83% rename from python/cdp/openapi_client/test/test_x402_v1_payment_payload_payload.py rename to python/cdp/openapi_client/test/test_x402_v2_payment_payload_payload.py index 9bfaf3c38..9387c9c20 100644 --- a/python/cdp/openapi_client/test/test_x402_v1_payment_payload_payload.py +++ b/python/cdp/openapi_client/test/test_x402_v2_payment_payload_payload.py @@ -15,10 +15,10 @@ import unittest -from cdp.openapi_client.models.x402_v1_payment_payload_payload import X402V1PaymentPayloadPayload +from cdp.openapi_client.models.x402_v2_payment_payload_payload import X402V2PaymentPayloadPayload -class TestX402V1PaymentPayloadPayload(unittest.TestCase): - """X402V1PaymentPayloadPayload unit test stubs""" +class TestX402V2PaymentPayloadPayload(unittest.TestCase): + """X402V2PaymentPayloadPayload unit test stubs""" def setUp(self): pass @@ -26,23 +26,23 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional) -> X402V1PaymentPayloadPayload: - """Test X402V1PaymentPayloadPayload + def make_instance(self, include_optional) -> X402V2PaymentPayloadPayload: + """Test X402V2PaymentPayloadPayload include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `X402V1PaymentPayloadPayload` + # uncomment below to create an instance of `X402V2PaymentPayloadPayload` """ - model = X402V1PaymentPayloadPayload() + model = X402V2PaymentPayloadPayload() if include_optional: - return X402V1PaymentPayloadPayload( + return X402V2PaymentPayloadPayload( signature = '0xf3746613c2d920b5fdabc0856f2aeb2d4f88ee6037b8cc5d04a71a4462f134801234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1b', authorization = {from=0x742d35Cc6634C0532925a3b844Bc454e4438f44e, to=0x742d35Cc6634C0532925a3b844Bc454e4438f44e, value=1000000000000000000, validAfter=1716150000, validBefore=1716150000, nonce=0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef}, permit2_authorization = {from=0x742d35Cc6634C0532925a3b844Bc454e4438f44e, permitted={token=0x036CbD53842c5426634e7929541eC2318f3dCF7e, amount=1000000}, spender=0x4020615294c913F045dc10f0a5cdEbd86c280001, nonce=12345678901234567890, deadline=1716150000, witness={to=0x742d35Cc6634C0532925a3b844Bc454e4438f44e, validAfter=1716150000, extra=0x}}, transaction = 'AQABAgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAQECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8CBgMBAQAAAAIBAwQAAAAABgIAAAAAAAYDBQEBAAAGBAgAAAAABgUAAAAA6AMAAAAAAAAGBgUBAQEBBgcEAQAAAAYICgMBAQIDBgkCBgAAAAYKAwABAQEGCwMGAQEBBgwDAAABAQAAAAA=' ) else: - return X402V1PaymentPayloadPayload( + return X402V2PaymentPayloadPayload( signature = '0xf3746613c2d920b5fdabc0856f2aeb2d4f88ee6037b8cc5d04a71a4462f134801234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1b', authorization = {from=0x742d35Cc6634C0532925a3b844Bc454e4438f44e, to=0x742d35Cc6634C0532925a3b844Bc454e4438f44e, value=1000000000000000000, validAfter=1716150000, validBefore=1716150000, nonce=0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef}, permit2_authorization = {from=0x742d35Cc6634C0532925a3b844Bc454e4438f44e, permitted={token=0x036CbD53842c5426634e7929541eC2318f3dCF7e, amount=1000000}, spender=0x4020615294c913F045dc10f0a5cdEbd86c280001, nonce=12345678901234567890, deadline=1716150000, witness={to=0x742d35Cc6634C0532925a3b844Bc454e4438f44e, validAfter=1716150000, extra=0x}}, @@ -50,8 +50,8 @@ def make_instance(self, include_optional) -> X402V1PaymentPayloadPayload: ) """ - def testX402V1PaymentPayloadPayload(self): - """Test X402V1PaymentPayloadPayload""" + def testX402V2PaymentPayloadPayload(self): + """Test X402V2PaymentPayloadPayload""" # inst_req_only = self.make_instance(include_optional=False) # inst_req_and_optional = self.make_instance(include_optional=True) diff --git a/python/cdp/solana_account.py b/python/cdp/solana_account.py index 4aa2cb219..07696092f 100644 --- a/python/cdp/solana_account.py +++ b/python/cdp/solana_account.py @@ -10,11 +10,11 @@ from cdp.openapi_client.models.request_solana_faucet200_response import ( RequestSolanaFaucet200Response as RequestSolanaFaucetResponse, ) -from cdp.openapi_client.models.sign_solana_message200_response import ( - SignSolanaMessage200Response as SignSolanaMessageResponse, +from cdp.openapi_client.models.sign_solana_message_with_end_user_account200_response import ( + SignSolanaMessageWithEndUserAccount200Response as SignSolanaMessageResponse, ) -from cdp.openapi_client.models.sign_solana_transaction200_response import ( - SignSolanaTransaction200Response as SignSolanaTransactionResponse, +from cdp.openapi_client.models.sign_solana_transaction_with_end_user_account200_response import ( + SignSolanaTransactionWithEndUserAccount200Response as SignSolanaTransactionResponse, ) from cdp.openapi_client.models.solana_account import SolanaAccount as SolanaAccountModel diff --git a/python/cdp/solana_client.py b/python/cdp/solana_client.py index db7e3ea45..6f61274f2 100644 --- a/python/cdp/solana_client.py +++ b/python/cdp/solana_client.py @@ -27,11 +27,11 @@ from cdp.openapi_client.models.request_solana_faucet200_response import ( RequestSolanaFaucet200Response as RequestSolanaFaucetResponse, ) -from cdp.openapi_client.models.sign_solana_message200_response import ( - SignSolanaMessage200Response as SignSolanaMessageResponse, +from cdp.openapi_client.models.sign_solana_message_with_end_user_account200_response import ( + SignSolanaMessageWithEndUserAccount200Response as SignSolanaMessageResponse, ) -from cdp.openapi_client.models.sign_solana_transaction200_response import ( - SignSolanaTransaction200Response as SignSolanaTransactionResponse, +from cdp.openapi_client.models.sign_solana_transaction_with_end_user_account200_response import ( + SignSolanaTransactionWithEndUserAccount200Response as SignSolanaTransactionResponse, ) from cdp.openapi_client.models.update_solana_account_request import UpdateSolanaAccountRequest from cdp.solana_account import ListSolanaAccountsResponse, SolanaAccount diff --git a/python/cdp/test/actions/solana/test_sign_message.py b/python/cdp/test/actions/solana/test_sign_message.py index 857419f51..9976723db 100644 --- a/python/cdp/test/actions/solana/test_sign_message.py +++ b/python/cdp/test/actions/solana/test_sign_message.py @@ -4,10 +4,10 @@ from cdp.actions.solana.sign_message import sign_message from cdp.openapi_client.api.solana_accounts_api import SolanaAccountsApi -from cdp.openapi_client.models.sign_solana_message200_response import ( - SignSolanaMessage200Response as SignSolanaMessageResponse, -) from cdp.openapi_client.models.sign_solana_message_request import SignSolanaMessageRequest +from cdp.openapi_client.models.sign_solana_message_with_end_user_account200_response import ( + SignSolanaMessageWithEndUserAccount200Response as SignSolanaMessageResponse, +) @pytest.mark.asyncio diff --git a/python/cdp/test/actions/solana/test_sign_transaction.py b/python/cdp/test/actions/solana/test_sign_transaction.py index 2156f98c7..af4022696 100644 --- a/python/cdp/test/actions/solana/test_sign_transaction.py +++ b/python/cdp/test/actions/solana/test_sign_transaction.py @@ -4,12 +4,12 @@ from cdp.actions.solana.sign_transaction import sign_transaction from cdp.openapi_client.api.solana_accounts_api import SolanaAccountsApi -from cdp.openapi_client.models.sign_solana_transaction200_response import ( - SignSolanaTransaction200Response as SignSolanaTransactionResponse, -) from cdp.openapi_client.models.sign_solana_transaction_request import ( SignSolanaTransactionRequest, ) +from cdp.openapi_client.models.sign_solana_transaction_with_end_user_account200_response import ( + SignSolanaTransactionWithEndUserAccount200Response as SignSolanaTransactionResponse, +) @pytest.mark.asyncio diff --git a/python/cdp/test/test_account_transfer_strategy.py b/python/cdp/test/test_account_transfer_strategy.py index 783046cf4..ae3f571be 100644 --- a/python/cdp/test/test_account_transfer_strategy.py +++ b/python/cdp/test/test_account_transfer_strategy.py @@ -8,10 +8,10 @@ ) from cdp.api_clients import ApiClients from cdp.evm_server_account import EvmServerAccount -from cdp.openapi_client.models.send_evm_transaction200_response import ( - SendEvmTransaction200Response, -) from cdp.openapi_client.models.send_evm_transaction_request import SendEvmTransactionRequest +from cdp.openapi_client.models.send_evm_transaction_with_end_user_account200_response import ( + SendEvmTransactionWithEndUserAccount200Response, +) @pytest.mark.asyncio @@ -24,7 +24,9 @@ async def test_execute_transfer_eth(): mock_api_clients = MagicMock(spec=ApiClients) mock_api_clients.evm_accounts = AsyncMock() mock_api_clients.evm_accounts.send_evm_transaction = AsyncMock( - return_value=SendEvmTransaction200Response(transaction_hash="0xabc123") + return_value=SendEvmTransactionWithEndUserAccount200Response( + transaction_hash="0xabc123" + ) ) mock_from_account = MagicMock(spec=EvmServerAccount) @@ -64,7 +66,7 @@ async def test_execute_transfer_erc20(): mock_api_clients.evm_accounts = AsyncMock() mock_api_clients.evm_accounts.send_evm_transaction = AsyncMock( side_effect=[ - SendEvmTransaction200Response(transaction_hash="0xtransfer456"), + SendEvmTransactionWithEndUserAccount200Response(transaction_hash="0xtransfer456"), ] ) diff --git a/python/cdp/test/test_evm_client.py b/python/cdp/test/test_evm_client.py index 805957880..774201597 100644 --- a/python/cdp/test/test_evm_client.py +++ b/python/cdp/test/test_evm_client.py @@ -33,14 +33,18 @@ from cdp.openapi_client.models.export_evm_account_request import ExportEvmAccountRequest from cdp.openapi_client.models.import_evm_account_request import ImportEvmAccountRequest from cdp.openapi_client.models.request_evm_faucet_request import RequestEvmFaucetRequest -from cdp.openapi_client.models.send_evm_transaction200_response import SendEvmTransaction200Response from cdp.openapi_client.models.send_evm_transaction_request import SendEvmTransactionRequest +from cdp.openapi_client.models.send_evm_transaction_with_end_user_account200_response import ( + SendEvmTransactionWithEndUserAccount200Response, +) from cdp.openapi_client.models.sign_evm_hash_request import SignEvmHashRequest from cdp.openapi_client.models.sign_evm_message_request import SignEvmMessageRequest from cdp.openapi_client.models.sign_evm_transaction_request import ( SignEvmTransactionRequest, ) -from cdp.openapi_client.models.sign_evm_typed_data200_response import SignEvmTypedData200Response +from cdp.openapi_client.models.sign_evm_typed_data_with_end_user_account200_response import ( + SignEvmTypedDataWithEndUserAccount200Response, +) from cdp.openapi_client.models.update_evm_account_request import UpdateEvmAccountRequest from cdp.openapi_client.models.update_evm_smart_account_request import UpdateEvmSmartAccountRequest from cdp.update_account_types import UpdateAccountOptions @@ -638,7 +642,7 @@ async def test_send_transaction_serialized(): mock_api_clients = AsyncMock() mock_api_clients.evm_accounts = mock_evm_accounts_api mock_evm_accounts_api.send_evm_transaction = AsyncMock( - return_value=SendEvmTransaction200Response(transaction_hash="0x123") + return_value=SendEvmTransactionWithEndUserAccount200Response(transaction_hash="0x123") ) client = EvmClient(api_clients=mock_api_clients) @@ -668,7 +672,7 @@ async def test_send_transaction_eip1559(): mock_api_clients = AsyncMock() mock_api_clients.evm_accounts = mock_evm_accounts_api mock_evm_accounts_api.send_evm_transaction = AsyncMock( - return_value=SendEvmTransaction200Response(transaction_hash="0x123") + return_value=SendEvmTransactionWithEndUserAccount200Response(transaction_hash="0x123") ) client = EvmClient(api_clients=mock_api_clients) @@ -704,7 +708,7 @@ async def test_send_transaction_dynamic_fee(): mock_api_clients = AsyncMock() mock_api_clients.evm_accounts = mock_evm_accounts_api mock_evm_accounts_api.send_evm_transaction = AsyncMock( - return_value=SendEvmTransaction200Response(transaction_hash="0x123") + return_value=SendEvmTransactionWithEndUserAccount200Response(transaction_hash="0x123") ) client = EvmClient(api_clients=mock_api_clients) @@ -856,7 +860,7 @@ async def test_sign_typed_data(): test_idempotency_key = "test-idempotency-key" mock_evm_accounts_api.sign_evm_typed_data = AsyncMock( - return_value=SignEvmTypedData200Response(signature="0x123") + return_value=SignEvmTypedDataWithEndUserAccount200Response(signature="0x123") ) client = EvmClient(api_clients=mock_api_clients) diff --git a/python/cdp/test/test_evm_server_account.py b/python/cdp/test/test_evm_server_account.py index a5f367942..789c1df23 100644 --- a/python/cdp/test/test_evm_server_account.py +++ b/python/cdp/test/test_evm_server_account.py @@ -19,8 +19,10 @@ from cdp.openapi_client.models.eip712_domain import EIP712Domain from cdp.openapi_client.models.eip712_message import EIP712Message from cdp.openapi_client.models.request_evm_faucet_request import RequestEvmFaucetRequest -from cdp.openapi_client.models.send_evm_transaction200_response import SendEvmTransaction200Response from cdp.openapi_client.models.send_evm_transaction_request import SendEvmTransactionRequest +from cdp.openapi_client.models.send_evm_transaction_with_end_user_account200_response import ( + SendEvmTransactionWithEndUserAccount200Response, +) from cdp.openapi_client.models.sign_evm_hash_request import SignEvmHashRequest from cdp.openapi_client.models.sign_evm_message_request import SignEvmMessageRequest from cdp.openapi_client.models.sign_evm_transaction_request import ( @@ -312,7 +314,7 @@ async def test_send_transaction_serialized(mock_api, server_account_model_factor server_account_model = server_account_model_factory(address, name) mock_api_instance = mock_api.return_value mock_api_instance.send_evm_transaction = AsyncMock( - return_value=SendEvmTransaction200Response(transaction_hash="0x123") + return_value=SendEvmTransactionWithEndUserAccount200Response(transaction_hash="0x123") ) server_account = EvmServerAccount(server_account_model, mock_api_instance, mock_api_instance) @@ -343,7 +345,7 @@ async def test_send_transaction_eip1559(mock_api, server_account_model_factory): server_account_model = server_account_model_factory(address, name) mock_api_instance = mock_api.return_value mock_api_instance.send_evm_transaction = AsyncMock( - return_value=SendEvmTransaction200Response(transaction_hash="0x456") + return_value=SendEvmTransactionWithEndUserAccount200Response(transaction_hash="0x456") ) server_account = EvmServerAccount(server_account_model, mock_api_instance, mock_api_instance) @@ -380,7 +382,7 @@ async def test_send_transaction_dynamic_fee(mock_api, server_account_model_facto server_account_model = server_account_model_factory(address, name) mock_api_instance = mock_api.return_value mock_api_instance.send_evm_transaction = AsyncMock( - return_value=SendEvmTransaction200Response(transaction_hash="0x789") + return_value=SendEvmTransactionWithEndUserAccount200Response(transaction_hash="0x789") ) server_account = EvmServerAccount(server_account_model, mock_api_instance, mock_api_instance) diff --git a/python/cdp/test/test_solana_account.py b/python/cdp/test/test_solana_account.py index 9535700d9..e01f4487b 100644 --- a/python/cdp/test/test_solana_account.py +++ b/python/cdp/test/test_solana_account.py @@ -6,14 +6,14 @@ RequestSolanaFaucet200Response as RequestSolanaFaucetResponse, ) from cdp.openapi_client.models.request_solana_faucet_request import RequestSolanaFaucetRequest -from cdp.openapi_client.models.sign_solana_message200_response import ( - SignSolanaMessage200Response as SignSolanaMessageResponse, -) from cdp.openapi_client.models.sign_solana_message_request import SignSolanaMessageRequest -from cdp.openapi_client.models.sign_solana_transaction200_response import ( - SignSolanaTransaction200Response as SignSolanaTransactionResponse, +from cdp.openapi_client.models.sign_solana_message_with_end_user_account200_response import ( + SignSolanaMessageWithEndUserAccount200Response as SignSolanaMessageResponse, ) from cdp.openapi_client.models.sign_solana_transaction_request import SignSolanaTransactionRequest +from cdp.openapi_client.models.sign_solana_transaction_with_end_user_account200_response import ( + SignSolanaTransactionWithEndUserAccount200Response as SignSolanaTransactionResponse, +) from cdp.openapi_client.models.solana_account import SolanaAccount as SolanaAccountModel from cdp.solana_account import SolanaAccount diff --git a/python/cdp/test/test_solana_client.py b/python/cdp/test/test_solana_client.py index 71aeabcaa..60b217776 100644 --- a/python/cdp/test/test_solana_client.py +++ b/python/cdp/test/test_solana_client.py @@ -22,24 +22,24 @@ from cdp.openapi_client.models.request_solana_faucet_request import ( RequestSolanaFaucetRequest, ) -from cdp.openapi_client.models.send_solana_transaction200_response import ( - SendSolanaTransaction200Response as SendSolanaTransactionResponse, -) from cdp.openapi_client.models.send_solana_transaction_request import ( SendSolanaTransactionRequest, ) -from cdp.openapi_client.models.sign_solana_message200_response import ( - SignSolanaMessage200Response as SignSolanaMessageResponse, +from cdp.openapi_client.models.send_solana_transaction_with_end_user_account200_response import ( + SendSolanaTransactionWithEndUserAccount200Response as SendSolanaTransactionResponse, ) from cdp.openapi_client.models.sign_solana_message_request import ( SignSolanaMessageRequest, ) -from cdp.openapi_client.models.sign_solana_transaction200_response import ( - SignSolanaTransaction200Response as SignSolanaTransactionResponse, +from cdp.openapi_client.models.sign_solana_message_with_end_user_account200_response import ( + SignSolanaMessageWithEndUserAccount200Response as SignSolanaMessageResponse, ) from cdp.openapi_client.models.sign_solana_transaction_request import ( SignSolanaTransactionRequest, ) +from cdp.openapi_client.models.sign_solana_transaction_with_end_user_account200_response import ( + SignSolanaTransactionWithEndUserAccount200Response as SignSolanaTransactionResponse, +) from cdp.openapi_client.models.solana_account import SolanaAccount as SolanaAccountModel from cdp.openapi_client.models.update_solana_account_request import UpdateSolanaAccountRequest from cdp.solana_client import SolanaClient diff --git a/typescript/src/auth/utils/http.ts b/typescript/src/auth/utils/http.ts index eddbf6013..e61db53c0 100644 --- a/typescript/src/auth/utils/http.ts +++ b/typescript/src/auth/utils/http.ts @@ -134,6 +134,7 @@ function requiresWalletAuth(requestMethod: string, requestPath: string): boolean (requestPath?.includes("/accounts") || requestPath?.includes("/spend-permissions") || requestPath?.includes("/user-operations/prepare-and-send") || + requestPath?.includes("/embedded-wallet-api/") || requestPath?.endsWith("/end-users") || requestPath?.endsWith("/end-users/import") || /\/end-users\/[^/]+\/evm$/.test(requestPath) || diff --git a/typescript/src/client/cdp.ts b/typescript/src/client/cdp.ts index e803a20ff..f281e94af 100644 --- a/typescript/src/client/cdp.ts +++ b/typescript/src/client/cdp.ts @@ -13,6 +13,8 @@ export interface CdpClientOptions { apiKeySecret?: string; /** The wallet secret. */ walletSecret?: string; + /** The CDP project ID. Required for end-user delegation operations (signing, sending). */ + projectId?: string; /** Whether to enable debugging. */ debugging?: boolean; /** The host URL to connect to. */ @@ -50,6 +52,7 @@ export class CdpClient { * CDP_API_KEY_ID=your-api-key-id * CDP_API_KEY_SECRET=your-api-key-secret * CDP_WALLET_SECRET=your-wallet-secret + * CDP_PROJECT_ID=your-project-id * ``` * * Or passed as options to the constructor: @@ -59,6 +62,7 @@ export class CdpClient { * apiKeyId: "your-api-key-id", * apiKeySecret: "your-api-key-secret", * walletSecret: "your-wallet-secret", + * projectId: "your-project-id", * }); * ``` * @@ -83,6 +87,7 @@ We recommend using https://github.com/Schniz/fnm for managing your Node.js versi const apiKeyId = options.apiKeyId ?? process.env.CDP_API_KEY_ID ?? process.env.CDP_API_KEY_NAME; const apiKeySecret = options.apiKeySecret ?? process.env.CDP_API_KEY_SECRET; const walletSecret = options.walletSecret ?? process.env.CDP_WALLET_SECRET; + const projectId = options.projectId ?? process.env.CDP_PROJECT_ID; if (!apiKeyId || !apiKeySecret) { throw new Error(` @@ -135,6 +140,6 @@ For more information, see: https://github.com/coinbase/cdp-sdk/blob/main/typescr this.evm = new EvmClient(); this.solana = new SolanaClient(); this.policies = new PoliciesClient(); - this.endUser = new CDPEndUserClient(); + this.endUser = new CDPEndUserClient(projectId); } } diff --git a/typescript/src/client/end-user/endUser.test.ts b/typescript/src/client/end-user/endUser.test.ts index 94cd9358b..b902294b1 100644 --- a/typescript/src/client/end-user/endUser.test.ts +++ b/typescript/src/client/end-user/endUser.test.ts @@ -12,6 +12,7 @@ import type { AddEndUserEvmAccountOptions, AddEndUserEvmSmartAccountOptions, AddEndUserSolanaAccountOptions, + RevokeDelegationForEndUserOptions, } from "./endUser.types.js"; import { APIError } from "../../openapi-client/errors.js"; import { UserInputValidationError } from "../../errors.js"; @@ -38,6 +39,20 @@ vi.mock("../../openapi-client", () => { addEndUserEvmAccount: vi.fn(), addEndUserEvmSmartAccount: vi.fn(), addEndUserSolanaAccount: vi.fn(), + revokeDelegationForEndUser: vi.fn(), + signEvmHashWithEndUserAccount: vi.fn(), + signEvmTransactionWithEndUserAccount: vi.fn(), + signEvmMessageWithEndUserAccount: vi.fn(), + signEvmTypedDataWithEndUserAccount: vi.fn(), + sendEvmTransactionWithEndUserAccount: vi.fn(), + sendEvmAssetWithEndUserAccount: vi.fn(), + sendUserOperationWithEndUserAccount: vi.fn(), + createEvmEip7702DelegationWithEndUserAccount: vi.fn(), + signSolanaHashWithEndUserAccount: vi.fn(), + signSolanaMessageWithEndUserAccount: vi.fn(), + signSolanaTransactionWithEndUserAccount: vi.fn(), + sendSolanaTransactionWithEndUserAccount: vi.fn(), + sendSolanaAssetWithEndUserAccount: vi.fn(), }, }; }); @@ -63,11 +78,13 @@ describe("EndUserClient", () => { createdAt: "2024-01-01T00:00:00Z", }; + const testProjectId = "test-project-id"; + beforeEach(() => { vi.clearAllMocks(); mockRandomUUID.mockReturnValue("generated-uuid"); mockPublicEncrypt.mockReturnValue(Buffer.from("encrypted-private-key")); - client = new CDPEndUserClient(); + client = new CDPEndUserClient(testProjectId); }); describe("createEndUser", () => { @@ -656,6 +673,41 @@ describe("EndUserClient", () => { }); }); + describe("revokeDelegationForEndUser", () => { + it("should revoke delegation for an end user", async () => { + const options: RevokeDelegationForEndUserOptions = { + userId: "test-user-id", + }; + ( + CdpOpenApiClient.revokeDelegationForEndUser as MockedFunction< + typeof CdpOpenApiClient.revokeDelegationForEndUser + > + ).mockResolvedValue(undefined); + + await client.revokeDelegationForEndUser(options); + + expect(CdpOpenApiClient.revokeDelegationForEndUser).toHaveBeenCalledWith( + testProjectId, + "test-user-id", + {}, + ); + }); + + it("should handle errors when revoking delegation", async () => { + const options: RevokeDelegationForEndUserOptions = { + userId: "test-user-id", + }; + const expectedError = new APIError(404, "not_found", "End user not found"); + ( + CdpOpenApiClient.revokeDelegationForEndUser as MockedFunction< + typeof CdpOpenApiClient.revokeDelegationForEndUser + > + ).mockRejectedValue(expectedError); + + await expect(client.revokeDelegationForEndUser(options)).rejects.toThrow(expectedError); + }); + }); + describe("EndUserAccount methods", () => { const mockEvmAccountResult = { evmAccount: { @@ -740,5 +792,737 @@ describe("EndUserClient", () => { expect(CdpOpenApiClient.addEndUserSolanaAccount).toHaveBeenCalledWith(mockEndUser.userId, {}); expect(result).toEqual(mockSolanaAccountResult); }); + + it("should call revokeDelegation on EndUserAccount", async () => { + ( + CdpOpenApiClient.createEndUser as MockedFunction + ).mockResolvedValue(mockEndUser); + ( + CdpOpenApiClient.revokeDelegationForEndUser as MockedFunction< + typeof CdpOpenApiClient.revokeDelegationForEndUser + > + ).mockResolvedValue(undefined); + + const endUser = await client.createEndUser({ + authenticationMethods: [{ type: "email", email: "test@example.com" }], + }); + + await endUser.revokeDelegation(); + + expect(CdpOpenApiClient.revokeDelegationForEndUser).toHaveBeenCalledWith( + testProjectId, + mockEndUser.userId, + {}, + ); + }); + }); + + // ─── Delegated Sign/Send Operations ─── + + describe("signEvmHash", () => { + const mockResult = { signature: "0xsig123" }; + + it("should sign an EVM hash on behalf of an end user", async () => { + ( + CdpOpenApiClient.signEvmHashWithEndUserAccount as MockedFunction< + typeof CdpOpenApiClient.signEvmHashWithEndUserAccount + > + ).mockResolvedValue(mockResult); + + const result = await client.signEvmHash({ + userId: "test-user-id", + hash: "0xhash123", + address: "0x123", + }); + + expect(CdpOpenApiClient.signEvmHashWithEndUserAccount).toHaveBeenCalledWith( + testProjectId, + "test-user-id", + { hash: "0xhash123", address: "0x123" }, + ); + expect(result).toEqual(mockResult); + }); + + it("should handle errors", async () => { + const expectedError = new APIError(400, "invalid_request", "Invalid hash"); + ( + CdpOpenApiClient.signEvmHashWithEndUserAccount as MockedFunction< + typeof CdpOpenApiClient.signEvmHashWithEndUserAccount + > + ).mockRejectedValue(expectedError); + + await expect( + client.signEvmHash({ userId: "test-user-id", hash: "0x", address: "0x123" }), + ).rejects.toThrow(expectedError); + }); + }); + + describe("signEvmTransaction", () => { + const mockResult = { signedTransaction: "0xsigned123" }; + + it("should sign an EVM transaction on behalf of an end user", async () => { + ( + CdpOpenApiClient.signEvmTransactionWithEndUserAccount as MockedFunction< + typeof CdpOpenApiClient.signEvmTransactionWithEndUserAccount + > + ).mockResolvedValue(mockResult); + + const result = await client.signEvmTransaction({ + userId: "test-user-id", + address: "0x123", + transaction: "0x02abc", + }); + + expect(CdpOpenApiClient.signEvmTransactionWithEndUserAccount).toHaveBeenCalledWith( + testProjectId, + "test-user-id", + { address: "0x123", transaction: "0x02abc" }, + ); + expect(result).toEqual(mockResult); + }); + }); + + describe("signEvmMessage", () => { + const mockResult = { signature: "0xmsgsig" }; + + it("should sign an EVM message on behalf of an end user", async () => { + ( + CdpOpenApiClient.signEvmMessageWithEndUserAccount as MockedFunction< + typeof CdpOpenApiClient.signEvmMessageWithEndUserAccount + > + ).mockResolvedValue(mockResult); + + const result = await client.signEvmMessage({ + userId: "test-user-id", + address: "0x123", + message: "Hello", + }); + + expect(CdpOpenApiClient.signEvmMessageWithEndUserAccount).toHaveBeenCalledWith( + testProjectId, + "test-user-id", + { address: "0x123", message: "Hello" }, + ); + expect(result).toEqual(mockResult); + }); + }); + + describe("signEvmTypedData", () => { + const mockResult = { signature: "0xtypedsig" }; + const mockTypedData = { + domain: { name: "Test" }, + types: { Test: [{ name: "value", type: "uint256" }] }, + primaryType: "Test", + message: { value: 1 }, + }; + + it("should sign EVM typed data on behalf of an end user", async () => { + ( + CdpOpenApiClient.signEvmTypedDataWithEndUserAccount as MockedFunction< + typeof CdpOpenApiClient.signEvmTypedDataWithEndUserAccount + > + ).mockResolvedValue(mockResult); + + const result = await client.signEvmTypedData({ + userId: "test-user-id", + address: "0x123", + typedData: mockTypedData, + }); + + expect(CdpOpenApiClient.signEvmTypedDataWithEndUserAccount).toHaveBeenCalledWith( + testProjectId, + "test-user-id", + { address: "0x123", typedData: mockTypedData }, + ); + expect(result).toEqual(mockResult); + }); + }); + + describe("sendEvmTransaction", () => { + const mockResult = { transactionHash: "0xtxhash" }; + + it("should send an EVM transaction on behalf of an end user", async () => { + ( + CdpOpenApiClient.sendEvmTransactionWithEndUserAccount as MockedFunction< + typeof CdpOpenApiClient.sendEvmTransactionWithEndUserAccount + > + ).mockResolvedValue(mockResult); + + const result = await client.sendEvmTransaction({ + userId: "test-user-id", + address: "0x123", + transaction: "0x02abc", + network: "base-sepolia", + }); + + expect(CdpOpenApiClient.sendEvmTransactionWithEndUserAccount).toHaveBeenCalledWith( + testProjectId, + "test-user-id", + { + address: "0x123", + transaction: "0x02abc", + network: "base-sepolia", + }, + ); + expect(result).toEqual(mockResult); + }); + }); + + describe("sendEvmAsset", () => { + const mockResult = { transactionHash: "0xassethash", userOpHash: null }; + + it("should send an EVM asset on behalf of an end user", async () => { + ( + CdpOpenApiClient.sendEvmAssetWithEndUserAccount as MockedFunction< + typeof CdpOpenApiClient.sendEvmAssetWithEndUserAccount + > + ).mockResolvedValue(mockResult); + + const result = await client.sendEvmAsset({ + userId: "test-user-id", + address: "0x123", + to: "0xrecipient", + amount: "1000000", + network: "base-sepolia", + }); + + expect(CdpOpenApiClient.sendEvmAssetWithEndUserAccount).toHaveBeenCalledWith( + testProjectId, + "test-user-id", + "0x123", + "usdc", + { + to: "0xrecipient", + amount: "1000000", + network: "base-sepolia", + useCdpPaymaster: undefined, + paymasterUrl: undefined, + }, + ); + expect(result).toEqual(mockResult); + }); + + it("should pass custom asset parameter", async () => { + ( + CdpOpenApiClient.sendEvmAssetWithEndUserAccount as MockedFunction< + typeof CdpOpenApiClient.sendEvmAssetWithEndUserAccount + > + ).mockResolvedValue(mockResult); + + await client.sendEvmAsset({ + userId: "test-user-id", + address: "0x123", + asset: "usdc", + to: "0xrecipient", + amount: "1000000", + network: "base-sepolia", + useCdpPaymaster: true, + }); + + expect(CdpOpenApiClient.sendEvmAssetWithEndUserAccount).toHaveBeenCalledWith( + testProjectId, + "test-user-id", + "0x123", + "usdc", + { + to: "0xrecipient", + amount: "1000000", + network: "base-sepolia", + useCdpPaymaster: true, + paymasterUrl: undefined, + }, + ); + }); + }); + + describe("sendUserOperation", () => { + const mockResult = { + network: "base-sepolia" as const, + userOpHash: "0xuophash", + calls: [{ to: "0xrecipient", value: "0", data: "0x" }], + status: "pending" as const, + }; + + it("should send a user operation on behalf of an end user", async () => { + ( + CdpOpenApiClient.sendUserOperationWithEndUserAccount as MockedFunction< + typeof CdpOpenApiClient.sendUserOperationWithEndUserAccount + > + ).mockResolvedValue(mockResult); + + const calls = [{ to: "0xrecipient", value: "0", data: "0x" }]; + + const result = await client.sendUserOperation({ + userId: "test-user-id", + address: "0xsmart", + network: "base-sepolia", + calls, + useCdpPaymaster: true, + }); + + expect(CdpOpenApiClient.sendUserOperationWithEndUserAccount).toHaveBeenCalledWith( + testProjectId, + "test-user-id", + "0xsmart", + { + network: "base-sepolia", + calls, + useCdpPaymaster: true, + paymasterUrl: undefined, + dataSuffix: undefined, + }, + ); + expect(result).toEqual(mockResult); + }); + }); + + describe("createEvmEip7702Delegation", () => { + const mockResult = { delegationOperationId: "op-123" }; + + it("should create an EIP-7702 delegation on behalf of an end user", async () => { + ( + CdpOpenApiClient.createEvmEip7702DelegationWithEndUserAccount as MockedFunction< + typeof CdpOpenApiClient.createEvmEip7702DelegationWithEndUserAccount + > + ).mockResolvedValue(mockResult); + + const result = await client.createEvmEip7702Delegation({ + userId: "test-user-id", + address: "0x123", + network: "base-sepolia", + enableSpendPermissions: true, + }); + + expect(CdpOpenApiClient.createEvmEip7702DelegationWithEndUserAccount).toHaveBeenCalledWith( + testProjectId, + "test-user-id", + { + address: "0x123", + network: "base-sepolia", + enableSpendPermissions: true, + }, + ); + expect(result).toEqual(mockResult); + }); + }); + + describe("signSolanaHash", () => { + const mockResult = { signature: "solsig123" }; + + it("should sign a Solana hash on behalf of an end user", async () => { + ( + CdpOpenApiClient.signSolanaHashWithEndUserAccount as MockedFunction< + typeof CdpOpenApiClient.signSolanaHashWithEndUserAccount + > + ).mockResolvedValue(mockResult); + + const result = await client.signSolanaHash({ + userId: "test-user-id", + hash: "base64hash", + address: "So1ana123", + }); + + expect(CdpOpenApiClient.signSolanaHashWithEndUserAccount).toHaveBeenCalledWith( + testProjectId, + "test-user-id", + { hash: "base64hash", address: "So1ana123" }, + ); + expect(result).toEqual(mockResult); + }); + }); + + describe("signSolanaMessage", () => { + const mockResult = { signature: "solmsgsig" }; + + it("should sign a Solana message on behalf of an end user", async () => { + ( + CdpOpenApiClient.signSolanaMessageWithEndUserAccount as MockedFunction< + typeof CdpOpenApiClient.signSolanaMessageWithEndUserAccount + > + ).mockResolvedValue(mockResult); + + const result = await client.signSolanaMessage({ + userId: "test-user-id", + address: "So1ana123", + message: "base64msg", + }); + + expect(CdpOpenApiClient.signSolanaMessageWithEndUserAccount).toHaveBeenCalledWith( + testProjectId, + "test-user-id", + { address: "So1ana123", message: "base64msg" }, + ); + expect(result).toEqual(mockResult); + }); + }); + + describe("signSolanaTransaction", () => { + const mockResult = { signedTransaction: "solsignedtx" }; + + it("should sign a Solana transaction on behalf of an end user", async () => { + ( + CdpOpenApiClient.signSolanaTransactionWithEndUserAccount as MockedFunction< + typeof CdpOpenApiClient.signSolanaTransactionWithEndUserAccount + > + ).mockResolvedValue(mockResult); + + const result = await client.signSolanaTransaction({ + userId: "test-user-id", + address: "So1ana123", + transaction: "base64tx", + }); + + expect(CdpOpenApiClient.signSolanaTransactionWithEndUserAccount).toHaveBeenCalledWith( + testProjectId, + "test-user-id", + { address: "So1ana123", transaction: "base64tx" }, + ); + expect(result).toEqual(mockResult); + }); + }); + + describe("sendSolanaTransaction", () => { + const mockResult = { transactionSignature: "soltxsig" }; + + it("should send a Solana transaction on behalf of an end user", async () => { + ( + CdpOpenApiClient.sendSolanaTransactionWithEndUserAccount as MockedFunction< + typeof CdpOpenApiClient.sendSolanaTransactionWithEndUserAccount + > + ).mockResolvedValue(mockResult); + + const result = await client.sendSolanaTransaction({ + userId: "test-user-id", + address: "So1ana123", + transaction: "base64tx", + network: "solana-devnet", + }); + + expect(CdpOpenApiClient.sendSolanaTransactionWithEndUserAccount).toHaveBeenCalledWith( + testProjectId, + "test-user-id", + { + address: "So1ana123", + transaction: "base64tx", + network: "solana-devnet", + }, + ); + expect(result).toEqual(mockResult); + }); + }); + + describe("sendSolanaAsset", () => { + const mockResult = { transactionSignature: "solassetsig" }; + + it("should send a Solana asset on behalf of an end user", async () => { + ( + CdpOpenApiClient.sendSolanaAssetWithEndUserAccount as MockedFunction< + typeof CdpOpenApiClient.sendSolanaAssetWithEndUserAccount + > + ).mockResolvedValue(mockResult); + + const result = await client.sendSolanaAsset({ + userId: "test-user-id", + address: "So1ana123", + to: "Recipient123", + amount: "1000000", + network: "solana-devnet", + }); + + expect(CdpOpenApiClient.sendSolanaAssetWithEndUserAccount).toHaveBeenCalledWith( + testProjectId, + "test-user-id", + "So1ana123", + "usdc", + { + to: "Recipient123", + amount: "1000000", + network: "solana-devnet", + createRecipientAta: undefined, + }, + ); + expect(result).toEqual(mockResult); + }); + }); + + // ─── EndUserAccount Delegated Methods ─── + + describe("EndUserAccount delegated methods", () => { + it("should call signEvmHash with auto-picked address on EndUserAccount", async () => { + const mockResult = { signature: "0xsig" }; + ( + CdpOpenApiClient.createEndUser as MockedFunction + ).mockResolvedValue(mockEndUser); + ( + CdpOpenApiClient.signEvmHashWithEndUserAccount as MockedFunction< + typeof CdpOpenApiClient.signEvmHashWithEndUserAccount + > + ).mockResolvedValue(mockResult); + + const endUser = await client.createEndUser({ + authenticationMethods: [{ type: "email", email: "test@example.com" }], + }); + + const result = await endUser.signEvmHash({ hash: "0xhash" }); + + expect(CdpOpenApiClient.signEvmHashWithEndUserAccount).toHaveBeenCalledWith( + testProjectId, + mockEndUser.userId, + { hash: "0xhash", address: "0x123" }, + ); + expect(result).toEqual(mockResult); + }); + + it("should call signEvmHash with explicit address override on EndUserAccount", async () => { + const mockResult = { signature: "0xsig" }; + ( + CdpOpenApiClient.createEndUser as MockedFunction + ).mockResolvedValue(mockEndUser); + ( + CdpOpenApiClient.signEvmHashWithEndUserAccount as MockedFunction< + typeof CdpOpenApiClient.signEvmHashWithEndUserAccount + > + ).mockResolvedValue(mockResult); + + const endUser = await client.createEndUser({ + authenticationMethods: [{ type: "email", email: "test@example.com" }], + }); + + await endUser.signEvmHash({ hash: "0xhash", address: "0xcustom" }); + + expect(CdpOpenApiClient.signEvmHashWithEndUserAccount).toHaveBeenCalledWith( + testProjectId, + mockEndUser.userId, + { hash: "0xhash", address: "0xcustom" }, + ); + }); + + it("should throw when no EVM account for auto-pick", async () => { + const endUserNoAccounts = { + ...mockEndUser, + evmAccountObjects: [], + evmAccounts: [], + }; + ( + CdpOpenApiClient.createEndUser as MockedFunction + ).mockResolvedValue(endUserNoAccounts); + + const endUser = await client.createEndUser({ + authenticationMethods: [{ type: "email", email: "test@example.com" }], + }); + + await expect(endUser.signEvmHash({ hash: "0xhash" })).rejects.toThrow("No EVM account found"); + }); + + it("should call sendUserOperation with auto-picked smart account address", async () => { + const mockResult = { + network: "base-sepolia" as const, + userOpHash: "0xuophash", + calls: [{ to: "0xrecipient", value: "0", data: "0x" }], + status: "pending" as const, + }; + ( + CdpOpenApiClient.createEndUser as MockedFunction + ).mockResolvedValue(mockEndUser); + ( + CdpOpenApiClient.sendUserOperationWithEndUserAccount as MockedFunction< + typeof CdpOpenApiClient.sendUserOperationWithEndUserAccount + > + ).mockResolvedValue(mockResult); + + const endUser = await client.createEndUser({ + authenticationMethods: [{ type: "email", email: "test@example.com" }], + }); + + const calls = [{ to: "0xrecipient", value: "0", data: "0x" }]; + + await endUser.sendUserOperation({ + network: "base-sepolia", + calls, + useCdpPaymaster: true, + }); + + expect(CdpOpenApiClient.sendUserOperationWithEndUserAccount).toHaveBeenCalledWith( + testProjectId, + mockEndUser.userId, + "0x123", // auto-picked from evmSmartAccountObjects[0] + { + network: "base-sepolia", + calls, + useCdpPaymaster: true, + paymasterUrl: undefined, + dataSuffix: undefined, + }, + ); + }); + + it("should throw when no smart account for sendUserOperation auto-pick", async () => { + const endUserNoSmartAccounts = { + ...mockEndUser, + evmSmartAccountObjects: [], + evmSmartAccounts: [], + }; + ( + CdpOpenApiClient.createEndUser as MockedFunction + ).mockResolvedValue(endUserNoSmartAccounts); + + const endUser = await client.createEndUser({ + authenticationMethods: [{ type: "email", email: "test@example.com" }], + }); + + await expect( + endUser.sendUserOperation({ + network: "base-sepolia", + calls: [{ to: "0x", value: "0", data: "0x" }], + useCdpPaymaster: true, + }), + ).rejects.toThrow("No EVM smart account found"); + }); + + it("should call signSolanaHash with auto-picked address on EndUserAccount", async () => { + const mockResult = { signature: "solsig" }; + ( + CdpOpenApiClient.createEndUser as MockedFunction + ).mockResolvedValue(mockEndUser); + ( + CdpOpenApiClient.signSolanaHashWithEndUserAccount as MockedFunction< + typeof CdpOpenApiClient.signSolanaHashWithEndUserAccount + > + ).mockResolvedValue(mockResult); + + const endUser = await client.createEndUser({ + authenticationMethods: [{ type: "email", email: "test@example.com" }], + }); + + const result = await endUser.signSolanaHash({ hash: "base64hash" }); + + expect(CdpOpenApiClient.signSolanaHashWithEndUserAccount).toHaveBeenCalledWith( + testProjectId, + mockEndUser.userId, + { hash: "base64hash", address: "test123" }, + ); + expect(result).toEqual(mockResult); + }); + + it("should throw when no Solana account for auto-pick", async () => { + const endUserNoSolana = { + ...mockEndUser, + solanaAccountObjects: [], + solanaAccounts: [], + }; + ( + CdpOpenApiClient.createEndUser as MockedFunction + ).mockResolvedValue(endUserNoSolana); + + const endUser = await client.createEndUser({ + authenticationMethods: [{ type: "email", email: "test@example.com" }], + }); + + await expect(endUser.signSolanaHash({ hash: "base64hash" })).rejects.toThrow( + "No Solana account found", + ); + }); + + it("should call sendEvmAsset with auto-picked address and default asset", async () => { + const mockResult = { transactionHash: "0xhash", userOpHash: null }; + ( + CdpOpenApiClient.createEndUser as MockedFunction + ).mockResolvedValue(mockEndUser); + ( + CdpOpenApiClient.sendEvmAssetWithEndUserAccount as MockedFunction< + typeof CdpOpenApiClient.sendEvmAssetWithEndUserAccount + > + ).mockResolvedValue(mockResult); + + const endUser = await client.createEndUser({ + authenticationMethods: [{ type: "email", email: "test@example.com" }], + }); + + await endUser.sendEvmAsset({ + to: "0xrecipient", + amount: "1000000", + network: "base-sepolia", + }); + + expect(CdpOpenApiClient.sendEvmAssetWithEndUserAccount).toHaveBeenCalledWith( + testProjectId, + mockEndUser.userId, + "0x123", + "usdc", + { + to: "0xrecipient", + amount: "1000000", + network: "base-sepolia", + useCdpPaymaster: undefined, + paymasterUrl: undefined, + }, + ); + }); + + it("should call sendSolanaAsset with auto-picked address on EndUserAccount", async () => { + const mockResult = { transactionSignature: "solsig" }; + ( + CdpOpenApiClient.createEndUser as MockedFunction + ).mockResolvedValue(mockEndUser); + ( + CdpOpenApiClient.sendSolanaAssetWithEndUserAccount as MockedFunction< + typeof CdpOpenApiClient.sendSolanaAssetWithEndUserAccount + > + ).mockResolvedValue(mockResult); + + const endUser = await client.createEndUser({ + authenticationMethods: [{ type: "email", email: "test@example.com" }], + }); + + await endUser.sendSolanaAsset({ + to: "Recipient", + amount: "1000000", + network: "solana-devnet", + }); + + expect(CdpOpenApiClient.sendSolanaAssetWithEndUserAccount).toHaveBeenCalledWith( + testProjectId, + mockEndUser.userId, + "test123", + "usdc", + { + to: "Recipient", + amount: "1000000", + network: "solana-devnet", + createRecipientAta: undefined, + }, + ); + }); + + it("should call createEvmEip7702Delegation with auto-picked address on EndUserAccount", async () => { + const mockResult = { delegationOperationId: "op-123" }; + ( + CdpOpenApiClient.createEndUser as MockedFunction + ).mockResolvedValue(mockEndUser); + ( + CdpOpenApiClient.createEvmEip7702DelegationWithEndUserAccount as MockedFunction< + typeof CdpOpenApiClient.createEvmEip7702DelegationWithEndUserAccount + > + ).mockResolvedValue(mockResult); + + const endUser = await client.createEndUser({ + authenticationMethods: [{ type: "email", email: "test@example.com" }], + }); + + const result = await endUser.createEvmEip7702Delegation({ + network: "base-sepolia", + }); + + expect(CdpOpenApiClient.createEvmEip7702DelegationWithEndUserAccount).toHaveBeenCalledWith( + testProjectId, + mockEndUser.userId, + { + address: "0x123", + network: "base-sepolia", + enableSpendPermissions: undefined, + }, + ); + expect(result).toEqual(mockResult); + }); }); }); diff --git a/typescript/src/client/end-user/endUser.ts b/typescript/src/client/end-user/endUser.ts index a4a5f4141..2a4f7e902 100644 --- a/typescript/src/client/end-user/endUser.ts +++ b/typescript/src/client/end-user/endUser.ts @@ -14,6 +14,33 @@ import { type AddEndUserEvmSmartAccountResult, type AddEndUserSolanaAccountOptions, type AddEndUserSolanaAccountResult, + type RevokeDelegationForEndUserOptions, + type SignEvmHashOptions, + type SignEvmHashResult, + type SignEvmTransactionOptions, + type SignEvmTransactionResult, + type SignEvmMessageOptions, + type SignEvmMessageResult, + type SignEvmTypedDataOptions, + type SignEvmTypedDataResult, + type SendEvmTransactionOptions, + type SendEvmTransactionResult, + type SendEvmAssetOptions, + type SendEvmAssetResult, + type SendUserOperationOptions, + type SendUserOperationResult, + type CreateEvmEip7702DelegationOptions, + type CreateEvmEip7702DelegationForEndUserResult, + type SignSolanaHashOptions, + type SignSolanaHashResult, + type SignSolanaMessageOptions, + type SignSolanaMessageResult, + type SignSolanaTransactionOptions, + type SignSolanaTransactionResult, + type SendSolanaTransactionOptions, + type SendSolanaTransactionResult, + type SendSolanaAssetOptions, + type SendSolanaAssetResult, type EndUserAccount, } from "./endUser.types.js"; import { toEndUserAccount } from "./toEndUserAccount.js"; @@ -26,6 +53,17 @@ import { CdpOpenApiClient, type ListEndUsers200 } from "../../openapi-client/ind * The CDP end user client. */ export class CDPEndUserClient { + private projectId?: string; + + /** + * Creates a new CDPEndUserClient. + * + * @param projectId - The CDP project ID. Required for delegation operations (signing, sending). + */ + constructor(projectId?: string) { + this.projectId = projectId; + } + /** * Creates an end user. An end user is an entity that can own CDP EVM accounts, * EVM smart accounts, and/or Solana accounts. @@ -66,7 +104,7 @@ export class CDPEndUserClient { userId, }); - return toEndUserAccount(CdpOpenApiClient, { endUser }); + return toEndUserAccount(CdpOpenApiClient, { endUser, projectId: this.projectId }); } /** @@ -139,7 +177,7 @@ export class CDPEndUserClient { const endUser = await CdpOpenApiClient.getEndUser(userId); - return toEndUserAccount(CdpOpenApiClient, { endUser }); + return toEndUserAccount(CdpOpenApiClient, { endUser, projectId: this.projectId }); } /** @@ -235,6 +273,461 @@ export class CDPEndUserClient { return CdpOpenApiClient.addEndUserSolanaAccount(userId, {}); } + /** + * Revokes all active delegations for the specified end user. + * This operation can be performed by the end user themselves or by a developer using their API key. + * + * @param options - The options for revoking the delegation. + * + * @returns A promise that resolves when the delegation has been revoked. + * + * @example **Revoke all delegations for an end user** + * ```ts + * await cdp.endUser.revokeDelegationForEndUser({ + * userId: "user-123" + * }); + * ``` + */ + async revokeDelegationForEndUser(options: RevokeDelegationForEndUserOptions): Promise { + Analytics.trackAction({ + action: "revoke_delegation_for_end_user", + }); + + const { userId } = options; + + await CdpOpenApiClient.revokeDelegationForEndUser(this.requireProjectId(), userId, {}); + } + + // ─── Delegated EVM Sign Methods ─── + + /** + * Signs an EVM hash on behalf of an end user using a delegation. + * The end user must have previously created a delegation granting signing permissions. + * + * @param options - The options for signing an EVM hash. + * + * @returns A promise that resolves to the signature. + * + * @example + * ```ts + * const result = await cdp.endUser.signEvmHash({ + * userId: "user-123", + * hash: "0xabcdef...", + * address: "0x1234..." + * }); + * console.log(result.signature); + * ``` + */ + async signEvmHash(options: SignEvmHashOptions): Promise { + Analytics.trackAction({ action: "end_user_sign_evm_hash" }); + + return CdpOpenApiClient.signEvmHashWithEndUserAccount(this.requireProjectId(), options.userId, { + hash: options.hash, + address: options.address, + }); + } + + /** + * Signs an EVM transaction on behalf of an end user using a delegation. + * + * @param options - The options for signing an EVM transaction. + * + * @returns A promise that resolves to the signed transaction. + * + * @example + * ```ts + * const result = await cdp.endUser.signEvmTransaction({ + * userId: "user-123", + * address: "0x1234...", + * transaction: "0x02..." + * }); + * console.log(result.signedTransaction); + * ``` + */ + async signEvmTransaction(options: SignEvmTransactionOptions): Promise { + Analytics.trackAction({ action: "end_user_sign_evm_transaction" }); + + return CdpOpenApiClient.signEvmTransactionWithEndUserAccount( + this.requireProjectId(), + options.userId, + { + address: options.address, + transaction: options.transaction, + }, + ); + } + + /** + * Signs an EVM message (EIP-191) on behalf of an end user using a delegation. + * + * @param options - The options for signing an EVM message. + * + * @returns A promise that resolves to the signature. + * + * @example + * ```ts + * const result = await cdp.endUser.signEvmMessage({ + * userId: "user-123", + * address: "0x1234...", + * message: "Hello, World!" + * }); + * console.log(result.signature); + * ``` + */ + async signEvmMessage(options: SignEvmMessageOptions): Promise { + Analytics.trackAction({ action: "end_user_sign_evm_message" }); + + return CdpOpenApiClient.signEvmMessageWithEndUserAccount( + this.requireProjectId(), + options.userId, + { + address: options.address, + message: options.message, + }, + ); + } + + /** + * Signs EVM EIP-712 typed data on behalf of an end user using a delegation. + * + * @param options - The options for signing EVM typed data. + * + * @returns A promise that resolves to the signature. + * + * @example + * ```ts + * const result = await cdp.endUser.signEvmTypedData({ + * userId: "user-123", + * address: "0x1234...", + * typedData: { domain: {}, types: {}, primaryType: "...", message: {} } + * }); + * console.log(result.signature); + * ``` + */ + async signEvmTypedData(options: SignEvmTypedDataOptions): Promise { + Analytics.trackAction({ action: "end_user_sign_evm_typed_data" }); + + return CdpOpenApiClient.signEvmTypedDataWithEndUserAccount( + this.requireProjectId(), + options.userId, + { + address: options.address, + typedData: options.typedData, + }, + ); + } + + // ─── Delegated EVM Send Methods ─── + + /** + * Sends an EVM transaction on behalf of an end user using a delegation. + * + * @param options - The options for sending an EVM transaction. + * + * @returns A promise that resolves to the transaction hash. + * + * @example + * ```ts + * const result = await cdp.endUser.sendEvmTransaction({ + * userId: "user-123", + * address: "0x1234...", + * transaction: "0x02...", + * network: "base-sepolia" + * }); + * console.log(result.transactionHash); + * ``` + */ + async sendEvmTransaction(options: SendEvmTransactionOptions): Promise { + Analytics.trackAction({ action: "end_user_send_evm_transaction" }); + + return CdpOpenApiClient.sendEvmTransactionWithEndUserAccount( + this.requireProjectId(), + options.userId, + { + address: options.address, + transaction: options.transaction, + network: options.network, + }, + ); + } + + /** + * Sends an EVM asset (e.g. USDC) on behalf of an end user using a delegation. + * + * @param options - The options for sending an EVM asset. + * + * @returns A promise that resolves to the transaction result. + * + * @example + * ```ts + * const result = await cdp.endUser.sendEvmAsset({ + * userId: "user-123", + * address: "0x1234...", + * to: "0xabcd...", + * amount: "1000000", + * network: "base-sepolia" + * }); + * console.log(result.transactionHash); + * ``` + */ + async sendEvmAsset(options: SendEvmAssetOptions): Promise { + Analytics.trackAction({ action: "end_user_send_evm_asset" }); + + const asset = options.asset ?? "usdc"; + + return CdpOpenApiClient.sendEvmAssetWithEndUserAccount( + this.requireProjectId(), + options.userId, + options.address, + asset, + { + to: options.to, + amount: options.amount, + network: options.network, + useCdpPaymaster: options.useCdpPaymaster, + paymasterUrl: options.paymasterUrl, + }, + ); + } + + /** + * Sends a user operation on behalf of an end user using a delegation. + * + * @param options - The options for sending a user operation. + * + * @returns A promise that resolves to the user operation result. + * + * @example + * ```ts + * const result = await cdp.endUser.sendUserOperation({ + * userId: "user-123", + * address: "0x1234...", + * network: "base-sepolia", + * calls: [{ to: "0xabcd...", value: "0", data: "0x" }], + * useCdpPaymaster: true + * }); + * ``` + */ + async sendUserOperation(options: SendUserOperationOptions): Promise { + Analytics.trackAction({ action: "end_user_send_user_operation" }); + + return CdpOpenApiClient.sendUserOperationWithEndUserAccount( + this.requireProjectId(), + options.userId, + options.address, + { + network: options.network, + calls: options.calls, + useCdpPaymaster: options.useCdpPaymaster, + paymasterUrl: options.paymasterUrl, + dataSuffix: options.dataSuffix, + }, + ); + } + + // ─── Delegated EVM EIP-7702 Delegation Method ─── + + /** + * Creates an EVM EIP-7702 delegation on behalf of an end user. + * + * @param options - The options for creating an EIP-7702 delegation. + * + * @returns A promise that resolves to the delegation operation ID. + * + * @example + * ```ts + * const result = await cdp.endUser.createEvmEip7702Delegation({ + * userId: "user-123", + * address: "0x1234...", + * network: "base-sepolia" + * }); + * console.log(result.delegationOperationId); + * ``` + */ + async createEvmEip7702Delegation( + options: CreateEvmEip7702DelegationOptions, + ): Promise { + Analytics.trackAction({ action: "end_user_create_evm_eip7702_delegation" }); + + return CdpOpenApiClient.createEvmEip7702DelegationWithEndUserAccount( + this.requireProjectId(), + options.userId, + { + address: options.address, + network: options.network, + enableSpendPermissions: options.enableSpendPermissions, + }, + ); + } + + // ─── Delegated Solana Sign Methods ─── + + /** + * Signs a Solana hash on behalf of an end user using a delegation. + * + * @param options - The options for signing a Solana hash. + * + * @returns A promise that resolves to the signature. + * + * @example + * ```ts + * const result = await cdp.endUser.signSolanaHash({ + * userId: "user-123", + * hash: "base64hash...", + * address: "So1ana..." + * }); + * console.log(result.signature); + * ``` + */ + async signSolanaHash(options: SignSolanaHashOptions): Promise { + Analytics.trackAction({ action: "end_user_sign_solana_hash" }); + + return CdpOpenApiClient.signSolanaHashWithEndUserAccount( + this.requireProjectId(), + options.userId, + { + hash: options.hash, + address: options.address, + }, + ); + } + + /** + * Signs a Solana message on behalf of an end user using a delegation. + * + * @param options - The options for signing a Solana message. + * + * @returns A promise that resolves to the signature. + * + * @example + * ```ts + * const result = await cdp.endUser.signSolanaMessage({ + * userId: "user-123", + * address: "So1ana...", + * message: "base64message..." + * }); + * console.log(result.signature); + * ``` + */ + async signSolanaMessage(options: SignSolanaMessageOptions): Promise { + Analytics.trackAction({ action: "end_user_sign_solana_message" }); + + return CdpOpenApiClient.signSolanaMessageWithEndUserAccount( + this.requireProjectId(), + options.userId, + { + address: options.address, + message: options.message, + }, + ); + } + + /** + * Signs a Solana transaction on behalf of an end user using a delegation. + * + * @param options - The options for signing a Solana transaction. + * + * @returns A promise that resolves to the signed transaction. + * + * @example + * ```ts + * const result = await cdp.endUser.signSolanaTransaction({ + * userId: "user-123", + * address: "So1ana...", + * transaction: "base64tx..." + * }); + * console.log(result.signedTransaction); + * ``` + */ + async signSolanaTransaction( + options: SignSolanaTransactionOptions, + ): Promise { + Analytics.trackAction({ action: "end_user_sign_solana_transaction" }); + + return CdpOpenApiClient.signSolanaTransactionWithEndUserAccount( + this.requireProjectId(), + options.userId, + { + address: options.address, + transaction: options.transaction, + }, + ); + } + + // ─── Delegated Solana Send Methods ─── + + /** + * Sends a Solana transaction on behalf of an end user using a delegation. + * + * @param options - The options for sending a Solana transaction. + * + * @returns A promise that resolves to the transaction signature. + * + * @example + * ```ts + * const result = await cdp.endUser.sendSolanaTransaction({ + * userId: "user-123", + * address: "So1ana...", + * transaction: "base64tx...", + * network: "solana-devnet" + * }); + * console.log(result.transactionSignature); + * ``` + */ + async sendSolanaTransaction( + options: SendSolanaTransactionOptions, + ): Promise { + Analytics.trackAction({ action: "end_user_send_solana_transaction" }); + + return CdpOpenApiClient.sendSolanaTransactionWithEndUserAccount( + this.requireProjectId(), + options.userId, + { + address: options.address, + transaction: options.transaction, + network: options.network, + }, + ); + } + + /** + * Sends a Solana asset (e.g. USDC) on behalf of an end user using a delegation. + * + * @param options - The options for sending a Solana asset. + * + * @returns A promise that resolves to the transaction signature. + * + * @example + * ```ts + * const result = await cdp.endUser.sendSolanaAsset({ + * userId: "user-123", + * address: "So1ana...", + * to: "Recipi...", + * amount: "1000000", + * network: "solana-devnet" + * }); + * console.log(result.transactionSignature); + * ``` + */ + async sendSolanaAsset(options: SendSolanaAssetOptions): Promise { + Analytics.trackAction({ action: "end_user_send_solana_asset" }); + + const asset = options.asset ?? "usdc"; + + return CdpOpenApiClient.sendSolanaAssetWithEndUserAccount( + this.requireProjectId(), + options.userId, + options.address, + asset, + { + to: options.to, + amount: options.amount, + network: options.network, + createRecipientAta: options.createRecipientAta, + }, + ); + } + /** * Validates an end user's access token. Throws an error if the access token is invalid. * @@ -253,7 +746,7 @@ export class CDPEndUserClient { accessToken, }); - return toEndUserAccount(CdpOpenApiClient, { endUser }); + return toEndUserAccount(CdpOpenApiClient, { endUser, projectId: this.projectId }); } /** @@ -342,6 +835,22 @@ export class CDPEndUserClient { keyType: options.keyType, }); - return toEndUserAccount(CdpOpenApiClient, { endUser }); + return toEndUserAccount(CdpOpenApiClient, { endUser, projectId: this.projectId }); + } + + /** + * Returns the configured project ID or throws if not configured. + * + * @returns The project ID. + */ + private requireProjectId(): string { + if (!this.projectId) { + throw new UserInputValidationError( + "Missing required project ID for delegation operation. " + + "Set the CDP_PROJECT_ID environment variable or pass projectId to the CdpClient constructor.", + ); + } + + return this.projectId; } } diff --git a/typescript/src/client/end-user/endUser.types.ts b/typescript/src/client/end-user/endUser.types.ts index b33f8692c..bb24afeda 100644 --- a/typescript/src/client/end-user/endUser.types.ts +++ b/typescript/src/client/end-user/endUser.types.ts @@ -7,6 +7,27 @@ import type { AddEndUserEvmSmartAccount201, AddEndUserSolanaAccount201, EndUser as OpenAPIEndUser, + SignEvmHashWithEndUserAccount200, + SignEvmTransactionWithEndUserAccount200, + SignEvmMessageWithEndUserAccount200, + SignEvmTypedDataWithEndUserAccount200, + SendEvmTransactionWithEndUserAccount200, + SendEvmTransactionWithEndUserAccountBodyNetwork, + SendEvmAssetWithEndUserAccount200, + SendEvmAssetWithEndUserAccountBodyNetwork, + SendUserOperationWithEndUserAccountResult, + EvmUserOperationNetwork, + EvmCall, + CreateEvmEip7702DelegationWithEndUserAccount201, + EvmEip7702DelegationNetwork, + SignSolanaHashWithEndUserAccount200, + SignSolanaMessageWithEndUserAccount200, + SignSolanaTransactionWithEndUserAccount200, + SendSolanaTransactionWithEndUserAccount200, + SendSolanaTransactionWithEndUserAccountBodyNetwork, + SendSolanaAssetWithEndUserAccount200, + SendSolanaAssetWithEndUserAccountBodyNetwork, + EIP712Message, } from "../../openapi-client/index.js"; import type { Prettify } from "../../types/utils.js"; @@ -120,6 +141,444 @@ export interface ImportEndUserOptions { encryptionPublicKey?: string; } +/** + * The options for revoking all active delegations for an end user. + */ +export interface RevokeDelegationForEndUserOptions { + /** + * The unique identifier of the end user. + */ + userId: string; +} + +// ─── EVM Sign Options/Results ─── + +/** + * The options for signing an EVM hash on behalf of an end user. + */ +export interface SignEvmHashOptions { + /** The unique identifier of the end user. */ + userId: string; + /** The 32-byte hash to sign, hex-encoded. */ + hash: string; + /** The EVM address to sign with. */ + address: string; +} + +/** + * The result of signing an EVM hash on behalf of an end user. + */ +export type SignEvmHashResult = SignEvmHashWithEndUserAccount200; + +/** + * The options for signing an EVM transaction on behalf of an end user. + */ +export interface SignEvmTransactionOptions { + /** The unique identifier of the end user. */ + userId: string; + /** The EVM address to sign with. */ + address: string; + /** The RLP-serialized EIP-1559 transaction to sign, hex-encoded. */ + transaction: string; +} + +/** + * The result of signing an EVM transaction on behalf of an end user. + */ +export type SignEvmTransactionResult = SignEvmTransactionWithEndUserAccount200; + +/** + * The options for signing an EVM message on behalf of an end user. + */ +export interface SignEvmMessageOptions { + /** The unique identifier of the end user. */ + userId: string; + /** The EVM address to sign with. */ + address: string; + /** The EIP-191 message to sign. */ + message: string; +} + +/** + * The result of signing an EVM message on behalf of an end user. + */ +export type SignEvmMessageResult = SignEvmMessageWithEndUserAccount200; + +/** + * The options for signing EVM EIP-712 typed data on behalf of an end user. + */ +export interface SignEvmTypedDataOptions { + /** The unique identifier of the end user. */ + userId: string; + /** The EVM address to sign with. */ + address: string; + /** The EIP-712 typed data to sign. */ + typedData: EIP712Message; +} + +/** + * The result of signing EVM typed data on behalf of an end user. + */ +export type SignEvmTypedDataResult = SignEvmTypedDataWithEndUserAccount200; + +// ─── EVM Send Options/Results ─── + +/** + * The options for sending an EVM transaction on behalf of an end user. + */ +export interface SendEvmTransactionOptions { + /** The unique identifier of the end user. */ + userId: string; + /** The EVM address to send from. */ + address: string; + /** The RLP-serialized EIP-1559 transaction to send, hex-encoded. */ + transaction: string; + /** The network to send the transaction on. */ + network: SendEvmTransactionWithEndUserAccountBodyNetwork; +} + +/** + * The result of sending an EVM transaction on behalf of an end user. + */ +export type SendEvmTransactionResult = SendEvmTransactionWithEndUserAccount200; + +/** + * The options for sending an EVM asset on behalf of an end user. + */ +export interface SendEvmAssetOptions { + /** The unique identifier of the end user. */ + userId: string; + /** The EVM address to send from. */ + address: string; + /** The asset to send. Defaults to "usdc". */ + asset?: "usdc"; + /** The recipient address. */ + to: string; + /** The amount to send. */ + amount: string; + /** The network to send on. */ + network: SendEvmAssetWithEndUserAccountBodyNetwork; + /** Whether to use the CDP paymaster. */ + useCdpPaymaster?: boolean; + /** A custom paymaster URL. */ + paymasterUrl?: string; +} + +/** + * The result of sending an EVM asset on behalf of an end user. + */ +export type SendEvmAssetResult = SendEvmAssetWithEndUserAccount200; + +/** + * The options for sending a user operation on behalf of an end user. + */ +export interface SendUserOperationOptions { + /** The unique identifier of the end user. */ + userId: string; + /** The EVM smart account address. */ + address: string; + /** The network to send the user operation on. */ + network: EvmUserOperationNetwork; + /** The calls to execute. */ + calls: EvmCall[]; + /** Whether to use the CDP paymaster. */ + useCdpPaymaster: boolean; + /** A custom paymaster URL. */ + paymasterUrl?: string; + /** An optional data suffix. */ + dataSuffix?: string; +} + +/** + * The result of sending a user operation on behalf of an end user. + */ +export type SendUserOperationResult = SendUserOperationWithEndUserAccountResult; + +// ─── EVM EIP-7702 Delegation Options/Results ─── + +/** + * The options for creating an EVM EIP-7702 delegation on behalf of an end user. + */ +export interface CreateEvmEip7702DelegationOptions { + /** The unique identifier of the end user. */ + userId: string; + /** The EVM address to delegate. */ + address: string; + /** The network for the delegation. */ + network: EvmEip7702DelegationNetwork; + /** Whether to enable spend permissions for the delegation. */ + enableSpendPermissions?: boolean; +} + +/** + * The result of creating an EVM EIP-7702 delegation on behalf of an end user. + */ +export type CreateEvmEip7702DelegationForEndUserResult = + CreateEvmEip7702DelegationWithEndUserAccount201; + +// ─── Solana Sign Options/Results ─── + +/** + * The options for signing a Solana hash on behalf of an end user. + */ +export interface SignSolanaHashOptions { + /** The unique identifier of the end user. */ + userId: string; + /** The 32-byte hash to sign. */ + hash: string; + /** The Solana address to sign with. */ + address: string; +} + +/** + * The result of signing a Solana hash on behalf of an end user. + */ +export type SignSolanaHashResult = SignSolanaHashWithEndUserAccount200; + +/** + * The options for signing a Solana message on behalf of an end user. + */ +export interface SignSolanaMessageOptions { + /** The unique identifier of the end user. */ + userId: string; + /** The Solana address to sign with. */ + address: string; + /** The base64-encoded message to sign. */ + message: string; +} + +/** + * The result of signing a Solana message on behalf of an end user. + */ +export type SignSolanaMessageResult = SignSolanaMessageWithEndUserAccount200; + +/** + * The options for signing a Solana transaction on behalf of an end user. + */ +export interface SignSolanaTransactionOptions { + /** The unique identifier of the end user. */ + userId: string; + /** The Solana address to sign with. */ + address: string; + /** The base64-encoded Solana transaction to sign. */ + transaction: string; +} + +/** + * The result of signing a Solana transaction on behalf of an end user. + */ +export type SignSolanaTransactionResult = SignSolanaTransactionWithEndUserAccount200; + +// ─── Solana Send Options/Results ─── + +/** + * The options for sending a Solana transaction on behalf of an end user. + */ +export interface SendSolanaTransactionOptions { + /** The unique identifier of the end user. */ + userId: string; + /** The Solana address to send from. */ + address: string; + /** The base64-encoded Solana transaction to send. */ + transaction: string; + /** The Solana network to send on. */ + network: SendSolanaTransactionWithEndUserAccountBodyNetwork; +} + +/** + * The result of sending a Solana transaction on behalf of an end user. + */ +export type SendSolanaTransactionResult = SendSolanaTransactionWithEndUserAccount200; + +/** + * The options for sending a Solana asset on behalf of an end user. + */ +export interface SendSolanaAssetOptions { + /** The unique identifier of the end user. */ + userId: string; + /** The Solana address to send from. */ + address: string; + /** The asset to send. Defaults to "usdc". */ + asset?: "usdc"; + /** The recipient address. */ + to: string; + /** The amount to send. */ + amount: string; + /** The Solana network to send on. */ + network: SendSolanaAssetWithEndUserAccountBodyNetwork; + /** Whether to create the recipient's associated token account if it doesn't exist. */ + createRecipientAta?: boolean; +} + +/** + * The result of sending a Solana asset on behalf of an end user. + */ +export type SendSolanaAssetResult = SendSolanaAssetWithEndUserAccount200; + +// ─── EndUserAccount Action Method Options (address optional, userId auto-bound) ─── + +/** + * The options for signing an EVM hash on an EndUser object. + */ +export interface AccountSignEvmHashOptions { + /** The 32-byte hash to sign, hex-encoded. */ + hash: string; + /** The EVM address to sign with. Uses the first EVM account if not provided. */ + address?: string; +} + +/** + * The options for signing an EVM transaction on an EndUser object. + */ +export interface AccountSignEvmTransactionOptions { + /** The EVM address to sign with. Uses the first EVM account if not provided. */ + address?: string; + /** The RLP-serialized EIP-1559 transaction to sign, hex-encoded. */ + transaction: string; +} + +/** + * The options for signing an EVM message on an EndUser object. + */ +export interface AccountSignEvmMessageOptions { + /** The EVM address to sign with. Uses the first EVM account if not provided. */ + address?: string; + /** The EIP-191 message to sign. */ + message: string; +} + +/** + * The options for signing EVM typed data on an EndUser object. + */ +export interface AccountSignEvmTypedDataOptions { + /** The EVM address to sign with. Uses the first EVM account if not provided. */ + address?: string; + /** The EIP-712 typed data to sign. */ + typedData: EIP712Message; +} + +/** + * The options for sending an EVM transaction on an EndUser object. + */ +export interface AccountSendEvmTransactionOptions { + /** The EVM address to send from. Uses the first EVM account if not provided. */ + address?: string; + /** The RLP-serialized EIP-1559 transaction to send, hex-encoded. */ + transaction: string; + /** The network to send the transaction on. */ + network: SendEvmTransactionWithEndUserAccountBodyNetwork; +} + +/** + * The options for sending an EVM asset on an EndUser object. + */ +export interface AccountSendEvmAssetOptions { + /** The EVM address to send from. Uses the first EVM account if not provided. */ + address?: string; + /** The asset to send. Defaults to "usdc". */ + asset?: "usdc"; + /** The recipient address. */ + to: string; + /** The amount to send. */ + amount: string; + /** The network to send on. */ + network: SendEvmAssetWithEndUserAccountBodyNetwork; + /** Whether to use the CDP paymaster. */ + useCdpPaymaster?: boolean; + /** A custom paymaster URL. */ + paymasterUrl?: string; +} + +/** + * The options for sending a user operation on an EndUser object. + */ +export interface AccountSendUserOperationOptions { + /** The EVM smart account address. Uses the first smart account if not provided. */ + address?: string; + /** The network to send the user operation on. */ + network: EvmUserOperationNetwork; + /** The calls to execute. */ + calls: EvmCall[]; + /** Whether to use the CDP paymaster. */ + useCdpPaymaster: boolean; + /** A custom paymaster URL. */ + paymasterUrl?: string; + /** An optional data suffix. */ + dataSuffix?: string; +} + +/** + * The options for creating an EVM EIP-7702 delegation on an EndUser object. + */ +export interface AccountCreateEvmEip7702DelegationOptions { + /** The EVM address to delegate. Uses the first EVM account if not provided. */ + address?: string; + /** The network for the delegation. */ + network: EvmEip7702DelegationNetwork; + /** Whether to enable spend permissions for the delegation. */ + enableSpendPermissions?: boolean; +} + +/** + * The options for signing a Solana hash on an EndUser object. + */ +export interface AccountSignSolanaHashOptions { + /** The 32-byte hash to sign. */ + hash: string; + /** The Solana address to sign with. Uses the first Solana account if not provided. */ + address?: string; +} + +/** + * The options for signing a Solana message on an EndUser object. + */ +export interface AccountSignSolanaMessageOptions { + /** The Solana address to sign with. Uses the first Solana account if not provided. */ + address?: string; + /** The base64-encoded message to sign. */ + message: string; +} + +/** + * The options for signing a Solana transaction on an EndUser object. + */ +export interface AccountSignSolanaTransactionOptions { + /** The Solana address to sign with. Uses the first Solana account if not provided. */ + address?: string; + /** The base64-encoded Solana transaction to sign. */ + transaction: string; +} + +/** + * The options for sending a Solana transaction on an EndUser object. + */ +export interface AccountSendSolanaTransactionOptions { + /** The Solana address to send from. Uses the first Solana account if not provided. */ + address?: string; + /** The base64-encoded Solana transaction to send. */ + transaction: string; + /** The Solana network to send on. */ + network: SendSolanaTransactionWithEndUserAccountBodyNetwork; +} + +/** + * The options for sending a Solana asset on an EndUser object. + */ +export interface AccountSendSolanaAssetOptions { + /** The Solana address to send from. Uses the first Solana account if not provided. */ + address?: string; + /** The asset to send. Defaults to "usdc". */ + asset?: "usdc"; + /** The recipient address. */ + to: string; + /** The amount to send. */ + amount: string; + /** The Solana network to send on. */ + network: SendSolanaAssetWithEndUserAccountBodyNetwork; + /** Whether to create the recipient's associated token account if it doesn't exist. */ + createRecipientAta?: boolean; +} + /** * The options for adding an EVM smart account to an EndUser object. */ @@ -191,6 +650,145 @@ export type EndUserAccountActions = { * ``` */ addSolanaAccount: () => Promise; + + /** + * Revokes all active delegations for this end user. + * This operation can be performed by the end user themselves or by a developer using their API key. + * + * @returns A promise that resolves when the delegation has been revoked. + * + * @example + * ```ts + * const endUser = await cdp.endUser.getEndUser({ userId: "user-123" }); + * + * await endUser.revokeDelegation(); + * ``` + */ + revokeDelegation: () => Promise; + + // ─── Delegated EVM Sign Methods ─── + + /** + * Signs an EVM hash on behalf of this end user using a delegation. + * + * @param options - The signing options. + * @returns A promise that resolves to the signature. + */ + signEvmHash: (options: AccountSignEvmHashOptions) => Promise; + + /** + * Signs an EVM transaction on behalf of this end user using a delegation. + * + * @param options - The signing options. + * @returns A promise that resolves to the signed transaction. + */ + signEvmTransaction: ( + options: AccountSignEvmTransactionOptions, + ) => Promise; + + /** + * Signs an EVM message on behalf of this end user using a delegation. + * + * @param options - The signing options. + * @returns A promise that resolves to the signature. + */ + signEvmMessage: (options: AccountSignEvmMessageOptions) => Promise; + + /** + * Signs EVM EIP-712 typed data on behalf of this end user using a delegation. + * + * @param options - The signing options. + * @returns A promise that resolves to the signature. + */ + signEvmTypedData: (options: AccountSignEvmTypedDataOptions) => Promise; + + // ─── Delegated EVM Send Methods ─── + + /** + * Sends an EVM transaction on behalf of this end user using a delegation. + * + * @param options - The send options. + * @returns A promise that resolves to the transaction hash. + */ + sendEvmTransaction: ( + options: AccountSendEvmTransactionOptions, + ) => Promise; + + /** + * Sends an EVM asset on behalf of this end user using a delegation. + * + * @param options - The send options. + * @returns A promise that resolves to the transaction result. + */ + sendEvmAsset: (options: AccountSendEvmAssetOptions) => Promise; + + /** + * Sends a user operation on behalf of this end user using a delegation. + * + * @param options - The send options. + * @returns A promise that resolves to the user operation result. + */ + sendUserOperation: (options: AccountSendUserOperationOptions) => Promise; + + // ─── Delegated EVM EIP-7702 Delegation Method ─── + + /** + * Creates an EVM EIP-7702 delegation on behalf of this end user. + * + * @param options - The delegation options. + * @returns A promise that resolves to the delegation operation ID. + */ + createEvmEip7702Delegation: ( + options: AccountCreateEvmEip7702DelegationOptions, + ) => Promise; + + // ─── Delegated Solana Sign Methods ─── + + /** + * Signs a Solana hash on behalf of this end user using a delegation. + * + * @param options - The signing options. + * @returns A promise that resolves to the signature. + */ + signSolanaHash: (options: AccountSignSolanaHashOptions) => Promise; + + /** + * Signs a Solana message on behalf of this end user using a delegation. + * + * @param options - The signing options. + * @returns A promise that resolves to the signature. + */ + signSolanaMessage: (options: AccountSignSolanaMessageOptions) => Promise; + + /** + * Signs a Solana transaction on behalf of this end user using a delegation. + * + * @param options - The signing options. + * @returns A promise that resolves to the signed transaction. + */ + signSolanaTransaction: ( + options: AccountSignSolanaTransactionOptions, + ) => Promise; + + // ─── Delegated Solana Send Methods ─── + + /** + * Sends a Solana transaction on behalf of this end user using a delegation. + * + * @param options - The send options. + * @returns A promise that resolves to the transaction signature. + */ + sendSolanaTransaction: ( + options: AccountSendSolanaTransactionOptions, + ) => Promise; + + /** + * Sends a Solana asset on behalf of this end user using a delegation. + * + * @param options - The send options. + * @returns A promise that resolves to the transaction signature. + */ + sendSolanaAsset: (options: AccountSendSolanaAssetOptions) => Promise; }; /** diff --git a/typescript/src/client/end-user/toEndUserAccount.ts b/typescript/src/client/end-user/toEndUserAccount.ts index 958085874..9260c012e 100644 --- a/typescript/src/client/end-user/toEndUserAccount.ts +++ b/typescript/src/client/end-user/toEndUserAccount.ts @@ -6,6 +6,32 @@ import type { AddEndUserEvmSmartAccountResult, AddEndUserSolanaAccountResult, AddEvmSmartAccountOptions, + SignEvmHashResult, + SignEvmTransactionResult, + SignEvmMessageResult, + SignEvmTypedDataResult, + SendEvmTransactionResult, + SendEvmAssetResult, + SendUserOperationResult, + CreateEvmEip7702DelegationForEndUserResult, + SignSolanaHashResult, + SignSolanaMessageResult, + SignSolanaTransactionResult, + SendSolanaTransactionResult, + SendSolanaAssetResult, + AccountSignEvmHashOptions, + AccountSignEvmTransactionOptions, + AccountSignEvmMessageOptions, + AccountSignEvmTypedDataOptions, + AccountSendEvmTransactionOptions, + AccountSendEvmAssetOptions, + AccountSendUserOperationOptions, + AccountCreateEvmEip7702DelegationOptions, + AccountSignSolanaHashOptions, + AccountSignSolanaMessageOptions, + AccountSignSolanaTransactionOptions, + AccountSendSolanaTransactionOptions, + AccountSendSolanaAssetOptions, } from "./endUser.types.js"; import type { CdpOpenApiClientType, @@ -18,11 +44,83 @@ import type { export type ToEndUserAccountOptions = { /** The end user from the API response. */ endUser: OpenAPIEndUser; + /** The CDP project ID. Required for delegation operations (signing, sending). */ + projectId?: string; }; +/** + * Returns the project ID or throws if not configured. + * Used by delegation operations that require a project ID. + * + * @param projectId - The project ID to validate. + * @returns The validated project ID. + */ +function requireProjectId(projectId: string | undefined): string { + if (!projectId) { + throw new Error( + "Missing required project ID for delegation operation. " + + "Set the CDP_PROJECT_ID environment variable or pass projectId to the CdpClient constructor.", + ); + } + + return projectId; +} + +/** + * Resolves the first EVM EOA address for this end user, or throws if none exist and no override was provided. + * + * @param endUser - The OpenAPI end user. + * @param override - An optional address override. + * @returns The resolved EVM address. + */ +function resolveEvmAddress(endUser: OpenAPIEndUser, override?: string): string { + const address = override ?? endUser.evmAccountObjects[0]?.address; + if (!address) { + throw new Error( + "No EVM account found on this end user. Provide an explicit address or add an EVM account first.", + ); + } + return address; +} + +/** + * Resolves the first EVM smart account address for this end user, or throws if none exist and no override was provided. + * + * @param endUser - The OpenAPI end user. + * @param override - An optional address override. + * @returns The resolved EVM smart account address. + */ +function resolveEvmSmartAccountAddress(endUser: OpenAPIEndUser, override?: string): string { + const address = override ?? endUser.evmSmartAccountObjects[0]?.address; + if (!address) { + throw new Error( + "No EVM smart account found on this end user. Provide an explicit address or add an EVM smart account first.", + ); + } + return address; +} + +/** + * Resolves the first Solana address for this end user, or throws if none exist and no override was provided. + * + * @param endUser - The OpenAPI end user. + * @param override - An optional address override. + * @returns The resolved Solana address. + */ +function resolveSolanaAddress(endUser: OpenAPIEndUser, override?: string): string { + const address = override ?? endUser.solanaAccountObjects[0]?.address; + if (!address) { + throw new Error( + "No Solana account found on this end user. Provide an explicit address or add a Solana account first.", + ); + } + return address; +} + /** * Creates an EndUserAccount instance with actions from an existing OpenAPI EndUser. - * This wraps the raw API response and adds convenience methods for adding accounts. + * This wraps the raw API response and adds convenience methods for adding accounts + * and performing delegated signing/sending operations. * * @param apiClient - The API client. * @param options - Configuration options. @@ -33,46 +131,252 @@ export function toEndUserAccount( apiClient: CdpOpenApiClientType, options: ToEndUserAccountOptions, ): EndUserAccount { + const { endUser, projectId } = options; + const endUserAccount: EndUserAccount = { // Pass through all properties from the OpenAPI EndUser - userId: options.endUser.userId, - authenticationMethods: options.endUser.authenticationMethods, - mfaMethods: options.endUser.mfaMethods, - evmAccounts: options.endUser.evmAccounts, - evmAccountObjects: options.endUser.evmAccountObjects, - evmSmartAccounts: options.endUser.evmSmartAccounts, - evmSmartAccountObjects: options.endUser.evmSmartAccountObjects, - solanaAccounts: options.endUser.solanaAccounts, - solanaAccountObjects: options.endUser.solanaAccountObjects, - createdAt: options.endUser.createdAt, - - // Add action methods - async addEvmAccount(): Promise { - Analytics.trackAction({ - action: "end_user_add_evm_account", - }); + userId: endUser.userId, + authenticationMethods: endUser.authenticationMethods, + mfaMethods: endUser.mfaMethods, + evmAccounts: endUser.evmAccounts, + evmAccountObjects: endUser.evmAccountObjects, + evmSmartAccounts: endUser.evmSmartAccounts, + evmSmartAccountObjects: endUser.evmSmartAccountObjects, + solanaAccounts: endUser.solanaAccounts, + solanaAccountObjects: endUser.solanaAccountObjects, + createdAt: endUser.createdAt, + + // ─── Account Management Methods ─── - return apiClient.addEndUserEvmAccount(options.endUser.userId, {}); + async addEvmAccount(): Promise { + Analytics.trackAction({ action: "end_user_add_evm_account" }); + return apiClient.addEndUserEvmAccount(endUser.userId, {}); }, async addEvmSmartAccount( smartAccountOptions: AddEvmSmartAccountOptions, ): Promise { - Analytics.trackAction({ - action: "end_user_add_evm_smart_account", - }); - - return apiClient.addEndUserEvmSmartAccount(options.endUser.userId, { + Analytics.trackAction({ action: "end_user_add_evm_smart_account" }); + return apiClient.addEndUserEvmSmartAccount(endUser.userId, { enableSpendPermissions: smartAccountOptions.enableSpendPermissions, }); }, async addSolanaAccount(): Promise { - Analytics.trackAction({ - action: "end_user_add_solana_account", + Analytics.trackAction({ action: "end_user_add_solana_account" }); + return apiClient.addEndUserSolanaAccount(endUser.userId, {}); + }, + + async revokeDelegation(): Promise { + Analytics.trackAction({ action: "end_user_revoke_delegation" }); + await apiClient.revokeDelegationForEndUser(requireProjectId(projectId), endUser.userId, {}); + }, + + // ─── Delegated EVM Sign Methods ─── + + async signEvmHash(opts: AccountSignEvmHashOptions): Promise { + Analytics.trackAction({ action: "end_user_sign_evm_hash" }); + const address = resolveEvmAddress(endUser, opts.address); + return apiClient.signEvmHashWithEndUserAccount(requireProjectId(projectId), endUser.userId, { + hash: opts.hash, + address, }); + }, + + async signEvmTransaction( + opts: AccountSignEvmTransactionOptions, + ): Promise { + Analytics.trackAction({ action: "end_user_sign_evm_transaction" }); + const address = resolveEvmAddress(endUser, opts.address); + return apiClient.signEvmTransactionWithEndUserAccount( + requireProjectId(projectId), + endUser.userId, + { + address, + transaction: opts.transaction, + }, + ); + }, + + async signEvmMessage(opts: AccountSignEvmMessageOptions): Promise { + Analytics.trackAction({ action: "end_user_sign_evm_message" }); + const address = resolveEvmAddress(endUser, opts.address); + return apiClient.signEvmMessageWithEndUserAccount( + requireProjectId(projectId), + endUser.userId, + { + address, + message: opts.message, + }, + ); + }, + + async signEvmTypedData(opts: AccountSignEvmTypedDataOptions): Promise { + Analytics.trackAction({ action: "end_user_sign_evm_typed_data" }); + const address = resolveEvmAddress(endUser, opts.address); + return apiClient.signEvmTypedDataWithEndUserAccount( + requireProjectId(projectId), + endUser.userId, + { + address, + typedData: opts.typedData, + }, + ); + }, + + // ─── Delegated EVM Send Methods ─── + + async sendEvmTransaction( + opts: AccountSendEvmTransactionOptions, + ): Promise { + Analytics.trackAction({ action: "end_user_send_evm_transaction" }); + const address = resolveEvmAddress(endUser, opts.address); + return apiClient.sendEvmTransactionWithEndUserAccount( + requireProjectId(projectId), + endUser.userId, + { + address, + transaction: opts.transaction, + network: opts.network, + }, + ); + }, + + async sendEvmAsset(opts: AccountSendEvmAssetOptions): Promise { + Analytics.trackAction({ action: "end_user_send_evm_asset" }); + const address = resolveEvmAddress(endUser, opts.address); + const asset = opts.asset ?? "usdc"; + return apiClient.sendEvmAssetWithEndUserAccount( + requireProjectId(projectId), + endUser.userId, + address, + asset, + { + to: opts.to, + amount: opts.amount, + network: opts.network, + useCdpPaymaster: opts.useCdpPaymaster, + paymasterUrl: opts.paymasterUrl, + }, + ); + }, + + async sendUserOperation( + opts: AccountSendUserOperationOptions, + ): Promise { + Analytics.trackAction({ action: "end_user_send_user_operation" }); + const address = resolveEvmSmartAccountAddress(endUser, opts.address); + return apiClient.sendUserOperationWithEndUserAccount( + requireProjectId(projectId), + endUser.userId, + address, + { + network: opts.network, + calls: opts.calls, + useCdpPaymaster: opts.useCdpPaymaster, + paymasterUrl: opts.paymasterUrl, + dataSuffix: opts.dataSuffix, + }, + ); + }, + + // ─── Delegated EVM EIP-7702 Delegation Method ─── + + async createEvmEip7702Delegation( + opts: AccountCreateEvmEip7702DelegationOptions, + ): Promise { + Analytics.trackAction({ action: "end_user_create_evm_eip7702_delegation" }); + const address = resolveEvmAddress(endUser, opts.address); + return apiClient.createEvmEip7702DelegationWithEndUserAccount( + requireProjectId(projectId), + endUser.userId, + { + address, + network: opts.network, + enableSpendPermissions: opts.enableSpendPermissions, + }, + ); + }, + + // ─── Delegated Solana Sign Methods ─── + + async signSolanaHash(opts: AccountSignSolanaHashOptions): Promise { + Analytics.trackAction({ action: "end_user_sign_solana_hash" }); + const address = resolveSolanaAddress(endUser, opts.address); + return apiClient.signSolanaHashWithEndUserAccount( + requireProjectId(projectId), + endUser.userId, + { + hash: opts.hash, + address, + }, + ); + }, + + async signSolanaMessage( + opts: AccountSignSolanaMessageOptions, + ): Promise { + Analytics.trackAction({ action: "end_user_sign_solana_message" }); + const address = resolveSolanaAddress(endUser, opts.address); + return apiClient.signSolanaMessageWithEndUserAccount( + requireProjectId(projectId), + endUser.userId, + { + address, + message: opts.message, + }, + ); + }, + + async signSolanaTransaction( + opts: AccountSignSolanaTransactionOptions, + ): Promise { + Analytics.trackAction({ action: "end_user_sign_solana_transaction" }); + const address = resolveSolanaAddress(endUser, opts.address); + return apiClient.signSolanaTransactionWithEndUserAccount( + requireProjectId(projectId), + endUser.userId, + { + address, + transaction: opts.transaction, + }, + ); + }, + + // ─── Delegated Solana Send Methods ─── + + async sendSolanaTransaction( + opts: AccountSendSolanaTransactionOptions, + ): Promise { + Analytics.trackAction({ action: "end_user_send_solana_transaction" }); + const address = resolveSolanaAddress(endUser, opts.address); + return apiClient.sendSolanaTransactionWithEndUserAccount( + requireProjectId(projectId), + endUser.userId, + { + address, + transaction: opts.transaction, + network: opts.network, + }, + ); + }, - return apiClient.addEndUserSolanaAccount(options.endUser.userId, {}); + async sendSolanaAsset(opts: AccountSendSolanaAssetOptions): Promise { + Analytics.trackAction({ action: "end_user_send_solana_asset" }); + const address = resolveSolanaAddress(endUser, opts.address); + const asset = opts.asset ?? "usdc"; + return apiClient.sendSolanaAssetWithEndUserAccount( + requireProjectId(projectId), + endUser.userId, + address, + asset, + { + to: opts.to, + amount: opts.amount, + network: opts.network, + createRecipientAta: opts.createRecipientAta, + }, + ); }, }; diff --git a/typescript/src/index.ts b/typescript/src/index.ts index 9f04c1b60..4089e602b 100644 --- a/typescript/src/index.ts +++ b/typescript/src/index.ts @@ -15,7 +15,37 @@ export { export { NetworkError } from "./openapi-client/errors.js"; export type { SpendPermission, SpendPermissionInput } from "./spend-permissions/types.js"; export type { SpendPermissionNetwork, ListEndUsers200, EndUser } from "./openapi-client/index.js"; -export type { ListEndUsersOptions, EndUserAccount } from "./client/end-user/endUser.types.js"; +export type { + ListEndUsersOptions, + EndUserAccount, + RevokeDelegationForEndUserOptions, + SignEvmHashOptions, + SignEvmHashResult, + SignEvmTransactionOptions, + SignEvmTransactionResult, + SignEvmMessageOptions, + SignEvmMessageResult, + SignEvmTypedDataOptions, + SignEvmTypedDataResult, + SendEvmTransactionOptions, + SendEvmTransactionResult, + SendEvmAssetOptions, + SendEvmAssetResult, + SendUserOperationOptions, + SendUserOperationResult, + CreateEvmEip7702DelegationOptions as CreateEvmEip7702DelegationForEndUserOptions, + CreateEvmEip7702DelegationForEndUserResult, + SignSolanaHashOptions, + SignSolanaHashResult, + SignSolanaMessageOptions, + SignSolanaMessageResult, + SignSolanaTransactionOptions, + SignSolanaTransactionResult, + SendSolanaTransactionOptions, + SendSolanaTransactionResult, + SendSolanaAssetOptions, + SendSolanaAssetResult, +} from "./client/end-user/endUser.types.js"; export { SPEND_PERMISSION_MANAGER_ABI as spendPermissionManagerAbi, SPEND_PERMISSION_MANAGER_ADDRESS as spendPermissionManagerAddress, diff --git a/typescript/src/openapi-client/cdpApiClient.test.ts b/typescript/src/openapi-client/cdpApiClient.test.ts index 5216eacb7..970641e50 100644 --- a/typescript/src/openapi-client/cdpApiClient.test.ts +++ b/typescript/src/openapi-client/cdpApiClient.test.ts @@ -24,6 +24,10 @@ describe("cdpApiClient", () => { }) as unknown as Mocked; mockAxiosInstance.getUri = vi.fn(() => "https://api.cdp.coinbase.com/platform"); + mockAxiosInstance.interceptors = { + request: { use: vi.fn(), eject: vi.fn(), clear: vi.fn() }, + response: { use: vi.fn(), eject: vi.fn(), clear: vi.fn() }, + } as any; (Axios.create as any).mockReturnValue(mockAxiosInstance); (Axios.isAxiosError as any) = vi.fn(); @@ -638,4 +642,109 @@ describe("cdpApiClient", () => { }); }); }); + + describe("delegated routing interceptor", () => { + let delegatedRoutingInterceptor: (config: any) => any; + + beforeEach(() => { + configure(defaultOptions); + + // The delegated routing interceptor is the first registered (index 0) + delegatedRoutingInterceptor = (mockAxiosInstance.interceptors.request.use as any).mock + .calls[0][0]; + }); + + it("should prepend /delegated to end-user EVM sign URLs", () => { + const config = { + url: "/v2/embedded-wallet-api/projects/test-project/end-users/test-user/evm/sign", + }; + + const result = delegatedRoutingInterceptor(config); + + expect(result.url).toBe( + "/delegated/v2/embedded-wallet-api/projects/test-project/end-users/test-user/evm/sign", + ); + }); + + it("should prepend /delegated to revokeDelegation URLs", () => { + const config = { + url: "/v2/embedded-wallet-api/projects/test-project/end-users/test-user/delegation", + }; + + const result = delegatedRoutingInterceptor(config); + + expect(result.url).toBe( + "/delegated/v2/embedded-wallet-api/projects/test-project/end-users/test-user/delegation", + ); + }); + + it("should prepend /delegated to EVM send transaction URLs", () => { + const config = { + url: "/v2/embedded-wallet-api/projects/test-project/end-users/test-user/evm/send/transaction", + }; + + const result = delegatedRoutingInterceptor(config); + + expect(result.url).toBe( + "/delegated/v2/embedded-wallet-api/projects/test-project/end-users/test-user/evm/send/transaction", + ); + }); + + it("should prepend /delegated to Solana sign URLs", () => { + const config = { + url: "/v2/embedded-wallet-api/projects/test-project/end-users/test-user/solana/sign/message", + }; + + const result = delegatedRoutingInterceptor(config); + + expect(result.url).toBe( + "/delegated/v2/embedded-wallet-api/projects/test-project/end-users/test-user/solana/sign/message", + ); + }); + + it("should prepend /delegated to smart account send URLs", () => { + const config = { + url: "/v2/embedded-wallet-api/projects/test-project/end-users/test-user/evm/smart-accounts/0x1234/send", + }; + + const result = delegatedRoutingInterceptor(config); + + expect(result.url).toBe( + "/delegated/v2/embedded-wallet-api/projects/test-project/end-users/test-user/evm/smart-accounts/0x1234/send", + ); + }); + + it("should NOT rewrite non-end-user embedded-wallet-api URLs", () => { + const paths = [ + "/v2/embedded-wallet-api/projects/test-project/auth/init", + "/v2/embedded-wallet-api/projects/test-project/auth/refresh", + "/v2/embedded-wallet-api/projects/test-project/auth/logout", + "/v2/embedded-wallet-api/projects/test-project/auth/verify/email", + "/v2/embedded-wallet-api/projects/test-project/config", + "/v2/embedded-wallet-api/projects/test-project/attestation/challenge", + ]; + + for (const url of paths) { + const config = { url }; + const result = delegatedRoutingInterceptor(config); + expect(result.url).toBe(url); + } + }); + + it("should NOT rewrite non-embedded-wallet-api URLs", () => { + const paths = ["/v2/end-users", "/v2/end-users/test-user", "/v2/evm/accounts", "/test"]; + + for (const url of paths) { + const config = { url }; + const result = delegatedRoutingInterceptor(config); + expect(result.url).toBe(url); + } + }); + + it("should handle config without url", () => { + const config = {}; + const result = delegatedRoutingInterceptor(config); + expect(result.url).toBeUndefined(); + }); + }); }); diff --git a/typescript/src/openapi-client/cdpApiClient.ts b/typescript/src/openapi-client/cdpApiClient.ts index 86f34fddb..668fc5a3c 100644 --- a/typescript/src/openapi-client/cdpApiClient.ts +++ b/typescript/src/openapi-client/cdpApiClient.ts @@ -85,6 +85,22 @@ export const configure = (options: CdpOptions) => { expiresIn: options.expiresIn, debug: options.debugging, }); + + /* + * Delegated routing interceptor. + * Registered after withAuth so it runs BEFORE the auth interceptor (LIFO order). + * This rewrites the URL first, then the auth interceptor computes JWT headers + * (Authorization and X-Wallet-Auth) against the rewritten URL path, ensuring + * the `uris` claim matches the actual request URL. + * The API gateway validates the JWT, strips the /delegated prefix, and forwards + * to the backend. + */ + axiosInstance.interceptors.request.use(config => { + if (config.url && isDelegatedEndUserPath(config.url)) { + config.url = `/delegated${config.url}`; + } + return config; + }); }; /** @@ -307,6 +323,20 @@ export const cdpApiClient = async ( } }; +/** + * Checks if the given request URL is a delegated end-user operation that should + * be routed through the /platform/delegated gateway prefix. + * + * These endpoints require both Authorization and X-Wallet-Auth headers to be + * forwarded by the API gateway, which the /delegated prefix enables. + * + * @param url - The request URL (relative, without base path). + * @returns True if the path should be routed through /platform/delegated. + */ +const isDelegatedEndUserPath = (url: string): boolean => { + return /^\/v2\/embedded-wallet-api\/projects\/[^/]+\/end-users\//.test(url); +}; + /** * Validates the call to the cdpApiClient. * diff --git a/typescript/src/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.ts b/typescript/src/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.ts index 43152cca4..5b623f1c2 100644 --- a/typescript/src/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.ts +++ b/typescript/src/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v7.6.0 🍺 + * Generated by orval v7.21.0 🍺 * Do not edit manually. * Coinbase Developer Platform APIs * The Coinbase Developer Platform APIs - leading the world's transition onchain. @@ -84,6 +84,7 @@ export const OAuth2ProviderType = { apple: "apple", x: "x", telegram: "telegram", + github: "github", } as const; /** @@ -311,6 +312,9 @@ export const ErrorType = { order_already_filled: "order_already_filled", order_already_canceled: "order_already_canceled", account_not_ready: "account_not_ready", + insufficient_liquidity: "insufficient_liquidity", + insufficient_allowance: "insufficient_allowance", + transaction_simulation_failed: "transaction_simulation_failed", } as const; /** @@ -334,26 +338,19 @@ export interface Error { errorLink?: Url; } -export interface EvmAccount { - /** - * The 0x-prefixed, checksum EVM address. - * @pattern ^0x[0-9a-fA-F]{40}$ - */ - address: string; - /** - * An optional name for the account. -Account names can consist of alphanumeric characters and hyphens, and be between 2 and 36 characters long. -Account names are guaranteed to be unique across all EVM accounts in the developer's CDP Project. - * @pattern ^[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$ - */ - name?: string; - /** The list of policy IDs that apply to the account. This will include both the project-level policy and the account-level policy, if one exists. */ - policies?: string[]; - /** The UTC ISO 8601 timestamp at which the account was created. */ - createdAt?: string; - /** The UTC ISO 8601 timestamp at which the account was last updated. */ - updatedAt?: string; -} +/** + * A blockchain address. Format varies by network (e.g., 0x-prefixed for EVM, base58 for Solana). + * @minLength 1 + * @maxLength 128 + */ +export type BlockchainAddress = string; + +/** + * The symbol of the asset (e.g., eth, usd, usdc, usdt). + * @minLength 1 + * @maxLength 42 + */ +export type Asset = string; /** * The domain of the EIP-712 typed data. @@ -420,67 +417,6 @@ export const EvmEip7702DelegationNetwork = { "ethereum-sepolia": "ethereum-sepolia", } as const; -/** - * The current status of the delegation operation. -UNSPECIFIED means the status has not been set. PENDING means the operation has been created but not yet submitted. SUBMITTED means the operation has been submitted to the network. COMPLETED means the operation has completed successfully. FAILED means the operation has failed. - */ -export type EvmEip7702DelegationOperationStatus = - (typeof EvmEip7702DelegationOperationStatus)[keyof typeof EvmEip7702DelegationOperationStatus]; - -// eslint-disable-next-line @typescript-eslint/no-redeclare -export const EvmEip7702DelegationOperationStatus = { - UNSPECIFIED: "UNSPECIFIED", - PENDING: "PENDING", - SUBMITTED: "SUBMITTED", - COMPLETED: "COMPLETED", - FAILED: "FAILED", -} as const; - -/** - * The status of an EIP-7702 delegation operation. - */ -export interface EvmEip7702DelegationOperation { - /** The unique identifier for the delegation operation. */ - delegationOperationId: string; - /** The current status of the delegation operation. -UNSPECIFIED means the status has not been set. PENDING means the operation has been created but not yet submitted. SUBMITTED means the operation has been submitted to the network. COMPLETED means the operation has completed successfully. FAILED means the operation has failed. */ - status: EvmEip7702DelegationOperationStatus; - /** - * The hash of the delegation transaction, if available. Present once the transaction has been submitted to the network. - * @pattern ^0x[0-9a-fA-F]{64}$ - */ - transactionHash?: string; - network: EvmEip7702DelegationNetwork; - /** - * The address the account has delegated to, if any. Only present when the account has an active delegation. - * @pattern ^0x[0-9a-fA-F]{40}$ - */ - delegateAddress?: string; -} - -export interface EvmSmartAccount { - /** - * The 0x-prefixed, checksum address of the Smart Account. - * @pattern ^0x[0-9a-fA-F]{40}$ - */ - address: string; - /** Today, only a single owner can be set for a Smart Account, but this is an array to allow having multiple owners in the future. The address is a 0x-prefixed, checksum address. */ - owners: string[]; - /** - * An optional name for the account. -Account names can consist of alphanumeric characters and hyphens, and be between 2 and 36 characters long. -Account names are guaranteed to be unique across all Smart Accounts in the developer's CDP Project. - * @pattern ^[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$ - */ - name?: string; - /** The list of policy IDs that apply to the smart account. This will include both the project-level policy and the account-level policy, if one exists. */ - policies?: string[]; - /** The UTC ISO 8601 timestamp at which the account was created. */ - createdAt?: string; - /** The UTC ISO 8601 timestamp at which the account was last updated. */ - updatedAt?: string; -} - /** * The network the user operation is for. */ @@ -606,6 +542,106 @@ export const SpendPermissionNetwork = { polygon: "polygon", } as const; +/** + * Request parameters for revoking a Spend Permission. + */ +export interface RevokeSpendPermissionRequest { + /** + * The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header. + * @pattern ^[a-zA-Z0-9-]{1,100}$ + */ + walletSecretId: string; + network: SpendPermissionNetwork; + /** The hash of the spend permission to revoke. */ + permissionHash: string; + /** Whether to use the CDP Paymaster for the user operation. */ + useCdpPaymaster: boolean; + /** The paymaster URL of the spend permission. */ + paymasterUrl?: Url; +} + +export interface EvmAccount { + /** + * The 0x-prefixed, checksum EVM address. + * @pattern ^0x[0-9a-fA-F]{40}$ + */ + address: string; + /** + * An optional name for the account. +Account names can consist of alphanumeric characters and hyphens, and be between 2 and 36 characters long. +Account names are guaranteed to be unique across all EVM accounts in the developer's CDP Project. + * @pattern ^[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$ + */ + name?: string; + /** The list of policy IDs that apply to the account. This will include both the project-level policy and the account-level policy, if one exists. */ + policies?: string[]; + /** The UTC ISO 8601 timestamp at which the account was created. */ + createdAt?: string; + /** The UTC ISO 8601 timestamp at which the account was last updated. */ + updatedAt?: string; +} + +/** + * The current status of the delegation operation. +UNSPECIFIED means the status has not been set. PENDING means the operation has been created but not yet submitted. SUBMITTED means the operation has been submitted to the network. COMPLETED means the operation has completed successfully. FAILED means the operation has failed. + */ +export type EvmEip7702DelegationOperationStatus = + (typeof EvmEip7702DelegationOperationStatus)[keyof typeof EvmEip7702DelegationOperationStatus]; + +// eslint-disable-next-line @typescript-eslint/no-redeclare +export const EvmEip7702DelegationOperationStatus = { + UNSPECIFIED: "UNSPECIFIED", + PENDING: "PENDING", + SUBMITTED: "SUBMITTED", + COMPLETED: "COMPLETED", + FAILED: "FAILED", +} as const; + +/** + * The status of an EIP-7702 delegation operation. + */ +export interface EvmEip7702DelegationOperation { + /** The unique identifier for the delegation operation. */ + delegationOperationId: string; + /** The current status of the delegation operation. +UNSPECIFIED means the status has not been set. PENDING means the operation has been created but not yet submitted. SUBMITTED means the operation has been submitted to the network. COMPLETED means the operation has completed successfully. FAILED means the operation has failed. */ + status: EvmEip7702DelegationOperationStatus; + /** + * The hash of the delegation transaction, if available. Present once the transaction has been submitted to the network. + * @pattern ^0x[0-9a-fA-F]{64}$ + */ + transactionHash?: string; + network: EvmEip7702DelegationNetwork; + /** + * The address the account has delegated to, if any. Only present when the account has an active delegation. + * @pattern ^0x[0-9a-fA-F]{40}$ + */ + delegateAddress?: string; +} + +export interface EvmSmartAccount { + /** + * The 0x-prefixed, checksum address of the Smart Account. + * @pattern ^0x[0-9a-fA-F]{40}$ + */ + address: string; + /** Today, only a single owner can be set for a Smart Account, but this is an array to allow having multiple owners in the future. The address is a 0x-prefixed, checksum address. */ + owners: string[]; + /** + * An optional name for the account. +Account names can consist of alphanumeric characters and hyphens, and be between 2 and 36 characters long. +Account names are guaranteed to be unique across all Smart Accounts in the developer's CDP Project. + * @pattern ^[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$ + */ + name?: string; + /** The list of policy IDs that apply to the smart account. This will include both the project-level policy and the account-level policy, if one exists. */ + policies?: string[]; + /** The UTC ISO 8601 timestamp at which the account was created. */ + createdAt?: string; + /** The UTC ISO 8601 timestamp at which the account was last updated. */ + updatedAt?: string; +} + /** * Request parameters for creating a Spend Permission. */ @@ -686,7 +722,7 @@ export interface SpendPermissionResponseObject { /** * Request parameters for revoking a Spend Permission. */ -export interface RevokeSpendPermissionRequest { +export interface EvmSpendPermissionsRevokeSpendPermissionRequest { network: SpendPermissionNetwork; /** The hash of the spend permission to revoke. */ permissionHash: string; @@ -3012,6 +3048,8 @@ export type WebhookSubscriptionResponseLabels = { [key: string]: string }; export interface WebhookSubscriptionResponse { /** When the subscription was created. */ createdAt: string; + /** When the subscription was last updated. */ + updatedAt?: string; /** Description of the webhook subscription. */ description?: Description; /** Types of events to subscribe to. Event types follow a three-part dot-separated format: @@ -3248,53 +3286,6 @@ export interface X402ExactSolanaPayload { transaction: string; } -/** - * The scheme of the payment protocol to use. Currently, the only supported scheme is `exact`. - */ -export type X402V1PaymentPayloadScheme = - (typeof X402V1PaymentPayloadScheme)[keyof typeof X402V1PaymentPayloadScheme]; - -// eslint-disable-next-line @typescript-eslint/no-redeclare -export const X402V1PaymentPayloadScheme = { - exact: "exact", -} as const; - -/** - * The network of the blockchain to send payment on. - */ -export type X402V1PaymentPayloadNetwork = - (typeof X402V1PaymentPayloadNetwork)[keyof typeof X402V1PaymentPayloadNetwork]; - -// eslint-disable-next-line @typescript-eslint/no-redeclare -export const X402V1PaymentPayloadNetwork = { - "base-sepolia": "base-sepolia", - base: "base", - "solana-devnet": "solana-devnet", - solana: "solana", - polygon: "polygon", -} as const; - -/** - * The payload of the payment depending on the x402Version, scheme, and network. - */ -export type X402V1PaymentPayloadPayload = - | X402ExactEvmPayload - | X402ExactEvmPermit2Payload - | X402ExactSolanaPayload; - -/** - * The x402 protocol payment payload that the client attaches to x402-paid API requests to the resource server in the X-PAYMENT header. - */ -export interface X402V1PaymentPayload { - x402Version: X402Version; - /** The scheme of the payment protocol to use. Currently, the only supported scheme is `exact`. */ - scheme: X402V1PaymentPayloadScheme; - /** The network of the blockchain to send payment on. */ - network: X402V1PaymentPayloadNetwork; - /** The payload of the payment depending on the x402Version, scheme, and network. */ - payload: X402V1PaymentPayloadPayload; -} - /** * The scheme of the payment protocol to use. Currently, the only supported scheme is `exact`. */ @@ -3383,31 +3374,25 @@ export interface X402V2PaymentPayload { extensions?: X402V2PaymentPayloadExtensions; } -/** - * The x402 protocol payment payload that the client attaches to x402-paid API requests to the resource server in the X-PAYMENT header. -For EVM networks, smart account signatures can be longer than 65 bytes. - */ -export type X402PaymentPayload = X402V1PaymentPayload | X402V2PaymentPayload; - /** * The scheme of the payment protocol to use. Currently, the only supported scheme is `exact`. */ -export type X402V1PaymentRequirementsScheme = - (typeof X402V1PaymentRequirementsScheme)[keyof typeof X402V1PaymentRequirementsScheme]; +export type X402V1PaymentPayloadScheme = + (typeof X402V1PaymentPayloadScheme)[keyof typeof X402V1PaymentPayloadScheme]; // eslint-disable-next-line @typescript-eslint/no-redeclare -export const X402V1PaymentRequirementsScheme = { +export const X402V1PaymentPayloadScheme = { exact: "exact", } as const; /** * The network of the blockchain to send payment on. */ -export type X402V1PaymentRequirementsNetwork = - (typeof X402V1PaymentRequirementsNetwork)[keyof typeof X402V1PaymentRequirementsNetwork]; +export type X402V1PaymentPayloadNetwork = + (typeof X402V1PaymentPayloadNetwork)[keyof typeof X402V1PaymentPayloadNetwork]; // eslint-disable-next-line @typescript-eslint/no-redeclare -export const X402V1PaymentRequirementsNetwork = { +export const X402V1PaymentPayloadNetwork = { "base-sepolia": "base-sepolia", base: "base", "solana-devnet": "solana-devnet", @@ -3416,9 +3401,62 @@ export const X402V1PaymentRequirementsNetwork = { } as const; /** - * The optional JSON schema describing the resource output. + * The payload of the payment depending on the x402Version, scheme, and network. */ -export type X402V1PaymentRequirementsOutputSchema = { [key: string]: unknown }; +export type X402V1PaymentPayloadPayload = + | X402ExactEvmPayload + | X402ExactEvmPermit2Payload + | X402ExactSolanaPayload; + +/** + * The x402 protocol payment payload that the client attaches to x402-paid API requests to the resource server in the X-PAYMENT header. + */ +export interface X402V1PaymentPayload { + x402Version: X402Version; + /** The scheme of the payment protocol to use. Currently, the only supported scheme is `exact`. */ + scheme: X402V1PaymentPayloadScheme; + /** The network of the blockchain to send payment on. */ + network: X402V1PaymentPayloadNetwork; + /** The payload of the payment depending on the x402Version, scheme, and network. */ + payload: X402V1PaymentPayloadPayload; +} + +/** + * The x402 protocol payment payload that the client attaches to x402-paid API requests to the resource server in the X-PAYMENT header. +For EVM networks, smart account signatures can be longer than 65 bytes. + */ +export type X402PaymentPayload = X402V2PaymentPayload | X402V1PaymentPayload; + +/** + * The scheme of the payment protocol to use. Currently, the only supported scheme is `exact`. + */ +export type X402V1PaymentRequirementsScheme = + (typeof X402V1PaymentRequirementsScheme)[keyof typeof X402V1PaymentRequirementsScheme]; + +// eslint-disable-next-line @typescript-eslint/no-redeclare +export const X402V1PaymentRequirementsScheme = { + exact: "exact", +} as const; + +/** + * The network of the blockchain to send payment on. + */ +export type X402V1PaymentRequirementsNetwork = + (typeof X402V1PaymentRequirementsNetwork)[keyof typeof X402V1PaymentRequirementsNetwork]; + +// eslint-disable-next-line @typescript-eslint/no-redeclare +export const X402V1PaymentRequirementsNetwork = { + "base-sepolia": "base-sepolia", + base: "base", + "solana-devnet": "solana-devnet", + solana: "solana", + polygon: "polygon", +} as const; + +/** + * The optional JSON schema describing the resource output. + */ +export type X402V1PaymentRequirementsOutputSchema = { [key: string]: unknown }; /** * The optional additional scheme-specific payment info. @@ -3470,7 +3508,7 @@ For Solana-based networks, the asset will be a base58-encoded Solana address. /** * The x402 protocol payment requirements that the resource server expects the client's payment payload to meet. */ -export type X402PaymentRequirements = X402V1PaymentRequirements | X402V2PaymentRequirements; +export type X402PaymentRequirements = X402V2PaymentRequirements | X402V1PaymentRequirements; /** * The reason the payment is invalid on the x402 protocol. @@ -3735,13 +3773,6 @@ export interface X402SupportedPaymentKind { extra?: X402SupportedPaymentKindExtra; } -/** - * A blockchain address. Format varies by network (e.g., 0x-prefixed for EVM, base58 for Solana). - * @minLength 1 - * @maxLength 128 - */ -export type BlockchainAddress = string; - /** * The type of payment method to be used to complete an onramp order. */ @@ -4084,6 +4115,22 @@ Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/i */ export type IdempotencyKeyParameter = string; +/** + * A JWT signed using your Wallet Secret, encoded in base64. Refer to the +[Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) +section of our Authentication docs for more details on how to generate your Wallet Token. + + */ +export type XDeveloperAuthParameter = string; + +/** + * A JWT signed using your Wallet Secret, encoded in base64. Refer to the +[Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token) +section of our Authentication docs for more details on how to generate your Wallet Token. + + */ +export type XWalletAuthOptionalParameter = string; + /** * The number of resources to return per page. */ @@ -4130,6 +4177,8 @@ If `userId` is not provided in the request, the server will generate a random UU export type ListEndUsersParams = { /** * The number of end users to return per page. + * @minimum 1 + * @maximum 100 */ pageSize?: number; /** @@ -4211,6 +4260,368 @@ export type ImportEndUserBody = { keyType: ImportEndUserBodyKeyType; }; +export type SignEvmHashWithEndUserAccountBody = { + /** The arbitrary 32 byte hash to sign. */ + hash: string; + /** + * The 0x-prefixed address of the EVM account belonging to the end user. + * @pattern ^0x[0-9a-fA-F]{40}$ + */ + address: string; + /** + * Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header. + * @pattern ^[a-zA-Z0-9-]{1,100}$ + */ + walletSecretId?: string; +}; + +export type SignEvmHashWithEndUserAccount200 = { + /** The signature of the hash, as a 0x-prefixed hex string. */ + signature: string; +}; + +export type SignEvmTransactionWithEndUserAccountBody = { + /** + * The 0x-prefixed address of the EVM account belonging to the end user. + * @pattern ^0x[0-9a-fA-F]{40}$ + */ + address: string; + /** The RLP-encoded transaction to sign, as a 0x-prefixed hex string. */ + transaction: string; + /** + * Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header. + * @pattern ^[a-zA-Z0-9-]{1,100}$ + */ + walletSecretId?: string; +}; + +export type SignEvmTransactionWithEndUserAccount200 = { + /** The RLP-encoded signed transaction, as a 0x-prefixed hex string. */ + signedTransaction: string; +}; + +/** + * The network to send the transaction to. + */ +export type SendEvmTransactionWithEndUserAccountBodyNetwork = + (typeof SendEvmTransactionWithEndUserAccountBodyNetwork)[keyof typeof SendEvmTransactionWithEndUserAccountBodyNetwork]; + +// eslint-disable-next-line @typescript-eslint/no-redeclare +export const SendEvmTransactionWithEndUserAccountBodyNetwork = { + base: "base", + "base-sepolia": "base-sepolia", + ethereum: "ethereum", + "ethereum-sepolia": "ethereum-sepolia", + avalanche: "avalanche", + polygon: "polygon", + optimism: "optimism", + arbitrum: "arbitrum", +} as const; + +export type SendEvmTransactionWithEndUserAccountBody = { + /** + * The 0x-prefixed address of the EVM account belonging to the end user. + * @pattern ^0x[0-9a-fA-F]{40}$ + */ + address: string; + /** The network to send the transaction to. */ + network: SendEvmTransactionWithEndUserAccountBodyNetwork; + /** + * Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header. + * @pattern ^[a-zA-Z0-9-]{1,100}$ + */ + walletSecretId?: string; + /** The RLP-encoded transaction to sign and send, as a 0x-prefixed hex string. */ + transaction: string; +}; + +export type SendEvmTransactionWithEndUserAccount200 = { + /** The hash of the transaction, as a 0x-prefixed hex string. */ + transactionHash: string; +}; + +/** + * The EVM network to send USDC on. + */ +export type SendEvmAssetWithEndUserAccountBodyNetwork = + (typeof SendEvmAssetWithEndUserAccountBodyNetwork)[keyof typeof SendEvmAssetWithEndUserAccountBodyNetwork]; + +// eslint-disable-next-line @typescript-eslint/no-redeclare +export const SendEvmAssetWithEndUserAccountBodyNetwork = { + base: "base", + "base-sepolia": "base-sepolia", + ethereum: "ethereum", + "ethereum-sepolia": "ethereum-sepolia", + avalanche: "avalanche", + polygon: "polygon", + optimism: "optimism", + arbitrum: "arbitrum", +} as const; + +export type SendEvmAssetWithEndUserAccountBody = { + /** + * The 0x-prefixed address of the recipient. + * @pattern ^0x[0-9a-fA-F]{40}$ + */ + to: BlockchainAddress; + /** + * The amount of USDC to send as a decimal string (e.g., "1.5" or "25.50"). + * @minLength 1 + * @maxLength 32 + */ + amount: string; + /** The EVM network to send USDC on. */ + network: SendEvmAssetWithEndUserAccountBodyNetwork; + /** Whether to use CDP Paymaster to sponsor gas fees. Only applicable for EVM Smart Accounts. When true, the transaction gas will be paid by the Paymaster, allowing users to send USDC without holding native gas tokens. Ignored for EOA accounts. Cannot be used together with `paymasterUrl`. */ + useCdpPaymaster?: boolean; + /** Optional custom Paymaster URL to use for gas sponsorship. Only applicable for EVM Smart Accounts. This allows you to use your own Paymaster service instead of CDP's Paymaster. Cannot be used together with `useCdpPaymaster`. */ + paymasterUrl?: Url; + /** + * Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header. + * @pattern ^[a-zA-Z0-9-]{1,100}$ + */ + walletSecretId?: string; +}; + +export type SendEvmAssetWithEndUserAccount200 = { + /** + * The hash of the transaction, as a 0x-prefixed hex string. Populated for EOA accounts. Null for Smart Accounts (use userOpHash instead). + * @nullable + */ + transactionHash?: string | null; + /** + * The hash of the user operation, as a 0x-prefixed hex string. Populated for Smart Accounts. Null for EOA accounts (use transactionHash instead). + * @nullable + */ + userOpHash?: string | null; +}; + +export type SignEvmMessageWithEndUserAccountBody = { + /** + * The 0x-prefixed address of the EVM account belonging to the end user. + * @pattern ^0x[0-9a-fA-F]{40}$ + */ + address: string; + /** The message to sign. */ + message: string; + /** + * Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header. + * @pattern ^[a-zA-Z0-9-]{1,100}$ + */ + walletSecretId?: string; +}; + +export type SignEvmMessageWithEndUserAccount200 = { + /** The signature of the message, as a 0x-prefixed hex string. */ + signature: string; +}; + +export type SignEvmTypedDataWithEndUserAccountBody = { + /** + * The 0x-prefixed address of the EVM account belonging to the end user. + * @pattern ^0x[0-9a-fA-F]{40}$ + */ + address: string; + typedData: EIP712Message; + /** + * Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header. + * @pattern ^[a-zA-Z0-9-]{1,100}$ + */ + walletSecretId?: string; +}; + +export type SignEvmTypedDataWithEndUserAccount200 = { + /** The signature of the typed data, as a 0x-prefixed hex string. */ + signature: string; +}; + +export type RevokeDelegationForEndUserBody = { + /** + * When revoking with a wallet authentication scheme, the ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header. + * @pattern ^[a-zA-Z0-9-]{1,100}$ + */ + walletSecretId?: string; +}; + +export type CreateEvmEip7702DelegationWithEndUserAccountBody = { + /** + * The 0x-prefixed address of the EVM account to delegate. + * @pattern ^0x[0-9a-fA-F]{40}$ + */ + address: string; + network: EvmEip7702DelegationNetwork; + /** Whether to configure spend permissions for the upgraded, delegated account. When enabled, the account can grant permissions for third parties to spend on its behalf. */ + enableSpendPermissions?: boolean; + /** + * Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header. + * @pattern ^[a-zA-Z0-9-]{1,100}$ + */ + walletSecretId?: string; +}; + +export type CreateEvmEip7702DelegationWithEndUserAccount201 = { + /** The unique identifier for the delegation operation. Use this to poll the operation status. */ + delegationOperationId: string; +}; + +export type SendUserOperationWithEndUserAccountBody = { + network: EvmUserOperationNetwork; + /** The list of calls to make from the Smart Account. */ + calls: EvmCall[]; + /** Whether to use the CDP Paymaster for the user operation. */ + useCdpPaymaster: boolean; + /** The URL of the paymaster to use for the user operation. If using the CDP Paymaster, use the `useCdpPaymaster` option. */ + paymasterUrl?: Url; + /** + * Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header. + * @pattern ^[a-zA-Z0-9-]{1,100}$ + */ + walletSecretId?: string; + /** + * The EIP-8021 data suffix (hex-encoded) that enables transaction attribution for the user operation. + * @pattern ^0x[0-9a-fA-F]+$ + */ + dataSuffix?: string; +}; + +export type SignSolanaHashWithEndUserAccountBody = { + /** The arbitrary 32 byte hash to sign as base58 encoded string. */ + hash: string; + /** + * The base58 encoded address of the Solana account belonging to the end user. + * @pattern ^[1-9A-HJ-NP-Za-km-z]{32,44}$ + */ + address: string; + /** + * Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header. + * @pattern ^[a-zA-Z0-9-]{1,100}$ + */ + walletSecretId?: string; +}; + +export type SignSolanaHashWithEndUserAccount200 = { + /** The signature of the hash, as a base58 encoded string. */ + signature: string; +}; + +export type SignSolanaMessageWithEndUserAccountBody = { + /** + * The base58 encoded address of the Solana account belonging to the end user. + * @pattern ^[1-9A-HJ-NP-Za-km-z]{32,44}$ + */ + address: string; + /** The base64 encoded arbitrary message to sign. */ + message: string; + /** + * Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header. + * @pattern ^[a-zA-Z0-9-]{1,100}$ + */ + walletSecretId?: string; +}; + +export type SignSolanaMessageWithEndUserAccount200 = { + /** The signature of the message, as a base58 encoded string. */ + signature: string; +}; + +export type SignSolanaTransactionWithEndUserAccountBody = { + /** + * The base58 encoded address of the Solana account belonging to the end user. + * @pattern ^[1-9A-HJ-NP-Za-km-z]{32,44}$ + */ + address: string; + /** The base64 encoded transaction to sign. */ + transaction: string; + /** + * Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header. + * @pattern ^[a-zA-Z0-9-]{1,100}$ + */ + walletSecretId?: string; +}; + +export type SignSolanaTransactionWithEndUserAccount200 = { + /** The base64 encoded signed transaction. */ + signedTransaction: string; +}; + +/** + * The Solana network to send the transaction to. + */ +export type SendSolanaTransactionWithEndUserAccountBodyNetwork = + (typeof SendSolanaTransactionWithEndUserAccountBodyNetwork)[keyof typeof SendSolanaTransactionWithEndUserAccountBodyNetwork]; + +// eslint-disable-next-line @typescript-eslint/no-redeclare +export const SendSolanaTransactionWithEndUserAccountBodyNetwork = { + solana: "solana", + "solana-devnet": "solana-devnet", +} as const; + +export type SendSolanaTransactionWithEndUserAccountBody = { + /** + * The base58 encoded address of the Solana account belonging to the end user. + * @pattern ^[1-9A-HJ-NP-Za-km-z]{32,44}$ + */ + address: string; + /** The Solana network to send the transaction to. */ + network: SendSolanaTransactionWithEndUserAccountBodyNetwork; + /** + * Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header. + * @pattern ^[a-zA-Z0-9-]{1,100}$ + */ + walletSecretId?: string; + /** The base64 encoded transaction to sign and send. This transaction can contain multiple instructions for native Solana batching. */ + transaction: string; + /** Whether transaction fees should be sponsored by CDP. When true, CDP sponsors the transaction fees on behalf of the end user. When false, the end user is responsible for paying the transaction fees. */ + useCdpSponsor?: boolean; +}; + +export type SendSolanaTransactionWithEndUserAccount200 = { + /** The base58 encoded transaction signature. */ + transactionSignature: string; +}; + +/** + * The Solana network to send USDC on. + */ +export type SendSolanaAssetWithEndUserAccountBodyNetwork = + (typeof SendSolanaAssetWithEndUserAccountBodyNetwork)[keyof typeof SendSolanaAssetWithEndUserAccountBodyNetwork]; + +// eslint-disable-next-line @typescript-eslint/no-redeclare +export const SendSolanaAssetWithEndUserAccountBodyNetwork = { + solana: "solana", + "solana-devnet": "solana-devnet", +} as const; + +export type SendSolanaAssetWithEndUserAccountBody = { + /** + * The base58 encoded address of the recipient. + * @pattern ^[1-9A-HJ-NP-Za-km-z]{32,44}$ + */ + to: BlockchainAddress; + /** + * The amount of USDC to send as a decimal string (e.g., "1.5" or "25.50"). + * @minLength 1 + * @maxLength 32 + */ + amount: string; + /** The Solana network to send USDC on. */ + network: SendSolanaAssetWithEndUserAccountBodyNetwork; + /** Whether to automatically create an Associated Token Account (ATA) for the recipient if it doesn't exist. When true, the sender pays the rent-exempt minimum to create the recipient's USDC ATA. When false, the transaction will fail if the recipient doesn't have a USDC ATA. */ + createRecipientAta?: boolean; + /** + * Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header. + * @pattern ^[a-zA-Z0-9-]{1,100}$ + */ + walletSecretId?: string; + /** Whether transaction fees should be sponsored by CDP. When true, CDP sponsors the transaction fees on behalf of the end user. When false, the end user is responsible for paying the transaction fees. */ + useCdpSponsor?: boolean; +}; + +export type SendSolanaAssetWithEndUserAccount200 = { + /** The base58 encoded transaction signature. */ + transactionSignature: string; +}; + export type ListEvmAccountsParams = { /** * The number of resources to return per page. @@ -4769,6 +5180,7 @@ export type RequestSolanaFaucetBodyToken = export const RequestSolanaFaucetBodyToken = { sol: "sol", usdc: "usdc", + cbtusd: "cbtusd", } as const; export type RequestSolanaFaucetBody = { @@ -4825,6 +5237,8 @@ export type ListDataTokenBalances200 = ListDataTokenBalances200AllOf & ListRespo export type ListWebhookSubscriptionsParams = { /** * The number of subscriptions to return per page. + * @minimum 1 + * @maximum 100 */ pageSize?: number; /** diff --git a/typescript/src/openapi-client/generated/embedded-wallets-core-functionality/embedded-wallets-core-functionality.ts b/typescript/src/openapi-client/generated/embedded-wallets-core-functionality/embedded-wallets-core-functionality.ts new file mode 100644 index 000000000..f4320b6b8 --- /dev/null +++ b/typescript/src/openapi-client/generated/embedded-wallets-core-functionality/embedded-wallets-core-functionality.ts @@ -0,0 +1,455 @@ +/** + * Generated by orval v7.21.0 🍺 + * Do not edit manually. + * Coinbase Developer Platform APIs + * The Coinbase Developer Platform APIs - leading the world's transition onchain. + * OpenAPI spec version: 2.0.0 + */ +import type { + BlockchainAddress, + CreateEvmEip7702DelegationWithEndUserAccount201, + CreateEvmEip7702DelegationWithEndUserAccountBody, + EvmUserOperation, + RevokeDelegationForEndUserBody, + RevokeSpendPermissionRequest, + SendEvmAssetWithEndUserAccount200, + SendEvmAssetWithEndUserAccountBody, + SendEvmTransactionWithEndUserAccount200, + SendEvmTransactionWithEndUserAccountBody, + SendSolanaAssetWithEndUserAccount200, + SendSolanaAssetWithEndUserAccountBody, + SendSolanaTransactionWithEndUserAccount200, + SendSolanaTransactionWithEndUserAccountBody, + SendUserOperationWithEndUserAccountBody, + SignEvmHashWithEndUserAccount200, + SignEvmHashWithEndUserAccountBody, + SignEvmMessageWithEndUserAccount200, + SignEvmMessageWithEndUserAccountBody, + SignEvmTransactionWithEndUserAccount200, + SignEvmTransactionWithEndUserAccountBody, + SignEvmTypedDataWithEndUserAccount200, + SignEvmTypedDataWithEndUserAccountBody, + SignSolanaHashWithEndUserAccount200, + SignSolanaHashWithEndUserAccountBody, + SignSolanaMessageWithEndUserAccount200, + SignSolanaMessageWithEndUserAccountBody, + SignSolanaTransactionWithEndUserAccount200, + SignSolanaTransactionWithEndUserAccountBody, +} from "../coinbaseDeveloperPlatformAPIs.schemas.js"; + +import { cdpApiClient } from "../../cdpApiClient.js"; + +type SecondParameter unknown> = Parameters[1]; + +/** + * Signs an arbitrary 32 byte hash with the end user's given EVM account. + * @summary Sign a hash with end user EVM account + */ +export const signEvmHashWithEndUserAccount = ( + projectId: string, + userId: string, + signEvmHashWithEndUserAccountBody: SignEvmHashWithEndUserAccountBody, + options?: SecondParameter>, +) => { + return cdpApiClient( + { + url: `/v2/embedded-wallet-api/projects/${projectId}/end-users/${userId}/evm/sign`, + method: "POST", + headers: { "Content-Type": "application/json" }, + data: signEvmHashWithEndUserAccountBody, + }, + options, + ); +}; +/** + * Signs a transaction with the given end user EVM account. +The transaction should be serialized as a hex string using [RLP](https://ethereum.org/en/developers/docs/data-structures-and-encoding/rlp/). + +The transaction must be an [EIP-1559 dynamic fee transaction](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1559.md). The developer is responsible for ensuring that the unsigned transaction is valid, as the API will not validate the transaction. + * @summary Sign a transaction with end user EVM account + */ +export const signEvmTransactionWithEndUserAccount = ( + projectId: string, + userId: string, + signEvmTransactionWithEndUserAccountBody: SignEvmTransactionWithEndUserAccountBody, + options?: SecondParameter>, +) => { + return cdpApiClient( + { + url: `/v2/embedded-wallet-api/projects/${projectId}/end-users/${userId}/evm/sign/transaction`, + method: "POST", + headers: { "Content-Type": "application/json" }, + data: signEvmTransactionWithEndUserAccountBody, + }, + options, + ); +}; +/** + * Signs a transaction with the given end user EVM account and sends it to the indicated supported network. This API handles nonce management and gas estimation, leaving the developer to provide only the minimal set of fields necessary to send the transaction. The transaction should be serialized as a hex string using [RLP](https://ethereum.org/en/developers/docs/data-structures-and-encoding/rlp/). + +The transaction must be an [EIP-1559 dynamic fee transaction](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1559.md). + + +**Transaction fields and API behavior** + +- `to` *(Required)*: The address of the contract or account to send the transaction to. +- `chainId` *(Ignored)*: The value of the `chainId` field in the transaction is ignored. + The transaction will be sent to the network indicated by the `network` field in the request body. + +- `nonce` *(Optional)*: The nonce to use for the transaction. If not provided, the API will assign + a nonce to the transaction based on the current state of the account. + +- `maxPriorityFeePerGas` *(Optional)*: The maximum priority fee per gas to use for the transaction. + If not provided, the API will estimate a value based on current network conditions. + +- `maxFeePerGas` *(Optional)*: The maximum fee per gas to use for the transaction. + If not provided, the API will estimate a value based on current network conditions. + +- `gasLimit` *(Optional)*: The gas limit to use for the transaction. If not provided, the API will estimate a value + based on the `to` and `data` fields of the transaction. + +- `value` *(Optional)*: The amount of ETH, in wei, to send with the transaction. +- `data` *(Optional)*: The data to send with the transaction; only used for contract calls. +- `accessList` *(Optional)*: The access list to use for the transaction. + * @summary Send a transaction with end user EVM account + */ +export const sendEvmTransactionWithEndUserAccount = ( + projectId: string, + userId: string, + sendEvmTransactionWithEndUserAccountBody: SendEvmTransactionWithEndUserAccountBody, + options?: SecondParameter>, +) => { + return cdpApiClient( + { + url: `/v2/embedded-wallet-api/projects/${projectId}/end-users/${userId}/evm/send/transaction`, + method: "POST", + headers: { "Content-Type": "application/json" }, + data: sendEvmTransactionWithEndUserAccountBody, + }, + options, + ); +}; +/** + * Sends USDC from an end user's EVM account (EOA or Smart Account) to a recipient address on a supported EVM network. This endpoint simplifies USDC transfers by automatically handling contract resolution, decimal conversion, gas estimation, and transaction encoding. +The `amount` field accepts human-readable amounts as decimal strings (e.g., "1.5", "25.50"). + * @summary Send USDC on EVM + */ +export const sendEvmAssetWithEndUserAccount = ( + projectId: string, + userId: string, + address: BlockchainAddress, + asset: "usdc", + sendEvmAssetWithEndUserAccountBody: SendEvmAssetWithEndUserAccountBody, + options?: SecondParameter>, +) => { + return cdpApiClient( + { + url: `/v2/embedded-wallet-api/projects/${projectId}/end-users/${userId}/evm/${address}/send/${asset}`, + method: "POST", + headers: { "Content-Type": "application/json" }, + data: sendEvmAssetWithEndUserAccountBody, + }, + options, + ); +}; +/** + * Signs an [EIP-191](https://eips.ethereum.org/EIPS/eip-191) message with the given end user EVM account. + +Per the specification, the message in the request body is prepended with `0x19 <0x45 (E)> ` before being signed. + * @summary Sign an EIP-191 message with end user EVM account + */ +export const signEvmMessageWithEndUserAccount = ( + projectId: string, + userId: string, + signEvmMessageWithEndUserAccountBody: SignEvmMessageWithEndUserAccountBody, + options?: SecondParameter>, +) => { + return cdpApiClient( + { + url: `/v2/embedded-wallet-api/projects/${projectId}/end-users/${userId}/evm/sign/message`, + method: "POST", + headers: { "Content-Type": "application/json" }, + data: signEvmMessageWithEndUserAccountBody, + }, + options, + ); +}; +/** + * Signs [EIP-712](https://eips.ethereum.org/EIPS/eip-712) typed data with the given end user EVM account. + * @summary Sign EIP-712 typed data with end user EVM account + */ +export const signEvmTypedDataWithEndUserAccount = ( + projectId: string, + userId: string, + signEvmTypedDataWithEndUserAccountBody: SignEvmTypedDataWithEndUserAccountBody, + options?: SecondParameter>, +) => { + return cdpApiClient( + { + url: `/v2/embedded-wallet-api/projects/${projectId}/end-users/${userId}/evm/sign/typed-data`, + method: "POST", + headers: { "Content-Type": "application/json" }, + data: signEvmTypedDataWithEndUserAccountBody, + }, + options, + ); +}; +/** + * Revokes all active delegations for the specified end user. This operation can be performed by the end user themselves or by a developer using their API key. + * @summary Revoke delegation for end user + */ +export const revokeDelegationForEndUser = ( + projectId: string, + userId: string, + revokeDelegationForEndUserBody: RevokeDelegationForEndUserBody, + options?: SecondParameter>, +) => { + return cdpApiClient( + { + url: `/v2/embedded-wallet-api/projects/${projectId}/end-users/${userId}/delegation`, + method: "DELETE", + headers: { "Content-Type": "application/json" }, + data: revokeDelegationForEndUserBody, + }, + options, + ); +}; +/** + * Creates an EIP-7702 delegation for an end user's EVM EOA account, upgrading it with smart account capabilities. + +This endpoint: +- Retrieves delegation artifacts from onchain +- Signs the EIP-7702 authorization for delegation +- Assembles and submits a Type 4 transaction +- Creates an associated smart account object + +The delegation allows the EVM EOA to be used as a smart account, which enables batched transactions and gas sponsorship via paymaster. + * @summary Create EIP-7702 delegation for end user EVM account + */ +export const createEvmEip7702DelegationWithEndUserAccount = ( + projectId: string, + userId: string, + createEvmEip7702DelegationWithEndUserAccountBody: CreateEvmEip7702DelegationWithEndUserAccountBody, + options?: SecondParameter>, +) => { + return cdpApiClient( + { + url: `/v2/embedded-wallet-api/projects/${projectId}/end-users/${userId}/evm/eip7702/delegation`, + method: "POST", + headers: { "Content-Type": "application/json" }, + data: createEvmEip7702DelegationWithEndUserAccountBody, + }, + options, + ); +}; +/** + * Prepares, signs, and sends a user operation for an end user's Smart Account. + * @summary Send a user operation for end user Smart Account + */ +export const sendUserOperationWithEndUserAccount = ( + projectId: string, + userId: string, + address: string, + sendUserOperationWithEndUserAccountBody: SendUserOperationWithEndUserAccountBody, + options?: SecondParameter>, +) => { + return cdpApiClient( + { + url: `/v2/embedded-wallet-api/projects/${projectId}/end-users/${userId}/evm/smart-accounts/${address}/send`, + method: "POST", + headers: { "Content-Type": "application/json" }, + data: sendUserOperationWithEndUserAccountBody, + }, + options, + ); +}; +/** + * Revokes an existing spend permission. + * @summary Revoke a spend permission + */ +export const revokeSpendPermissionWithEndUserAccount = ( + projectId: string, + userId: string, + address: string, + revokeSpendPermissionRequest: RevokeSpendPermissionRequest, + options?: SecondParameter>, +) => { + return cdpApiClient( + { + url: `/v2/embedded-wallet-api/projects/${projectId}/end-users/${userId}/evm/smart-accounts/${address}/spend-permissions/revoke`, + method: "POST", + headers: { "Content-Type": "application/json" }, + data: revokeSpendPermissionRequest, + }, + options, + ); +}; +/** + * Signs an arbitrary 32 byte hash with the end user's given Solana account. + * @summary Sign a hash with end user Solana account + */ +export const signSolanaHashWithEndUserAccount = ( + projectId: string, + userId: string, + signSolanaHashWithEndUserAccountBody: SignSolanaHashWithEndUserAccountBody, + options?: SecondParameter>, +) => { + return cdpApiClient( + { + url: `/v2/embedded-wallet-api/projects/${projectId}/end-users/${userId}/solana/sign`, + method: "POST", + headers: { "Content-Type": "application/json" }, + data: signSolanaHashWithEndUserAccountBody, + }, + options, + ); +}; +/** + * Signs an arbitrary Base64 encoded message with the given Solana account. + **WARNING:** Never sign a message that you didn't generate as it may put your funds at risk. + * @summary Sign a Base64 encoded message + */ +export const signSolanaMessageWithEndUserAccount = ( + projectId: string, + userId: string, + signSolanaMessageWithEndUserAccountBody: SignSolanaMessageWithEndUserAccountBody, + options?: SecondParameter>, +) => { + return cdpApiClient( + { + url: `/v2/embedded-wallet-api/projects/${projectId}/end-users/${userId}/solana/sign/message`, + method: "POST", + headers: { "Content-Type": "application/json" }, + data: signSolanaMessageWithEndUserAccountBody, + }, + options, + ); +}; +/** + * Signs a transaction with the given end user Solana account. +The unsigned transaction should be serialized into a byte array and then encoded as base64. +**Transaction types** +The following transaction types are supported: +* [Legacy transactions](https://solana-labs.github.io/solana-web3.js/classes/Transaction.html) +* [Versioned transactions](https://solana-labs.github.io/solana-web3.js/classes/VersionedTransaction.html) +The developer is responsible for ensuring that the unsigned transaction is valid, as the API will not validate the transaction. + * @summary Sign a transaction with end user Solana account + */ +export const signSolanaTransactionWithEndUserAccount = ( + projectId: string, + userId: string, + signSolanaTransactionWithEndUserAccountBody: SignSolanaTransactionWithEndUserAccountBody, + options?: SecondParameter>, +) => { + return cdpApiClient( + { + url: `/v2/embedded-wallet-api/projects/${projectId}/end-users/${userId}/solana/sign/transaction`, + method: "POST", + headers: { "Content-Type": "application/json" }, + data: signSolanaTransactionWithEndUserAccountBody, + }, + options, + ); +}; +/** + * Signs a transaction with the given end user Solana account and sends it to the indicated supported network. +The API handles recent blockhash management and fee estimation, leaving the developer to provide only the minimal set of fields necessary to send the transaction. +The unsigned transaction should be serialized into a byte array and then encoded as base64. +**Transaction types** +The following transaction types are supported: +* [Legacy transactions](https://solana.com/developers/guides/advanced/versions#current-transaction-versions) +* [Versioned transactions](https://solana.com/developers/guides/advanced/versions) +**Instruction Batching** +To batch multiple operations, include multiple instructions within a single transaction. All instructions within a transaction are executed atomically - if any instruction fails, the entire transaction fails and is rolled back. +**Network Support** +The following Solana networks are supported: +* `solana` - Solana Mainnet +* `solana-devnet` - Solana Devnet +The developer is responsible for ensuring that the unsigned transaction is valid, as the API will not validate the transaction. + * @summary Send a transaction with end user Solana account + */ +export const sendSolanaTransactionWithEndUserAccount = ( + projectId: string, + userId: string, + sendSolanaTransactionWithEndUserAccountBody: SendSolanaTransactionWithEndUserAccountBody, + options?: SecondParameter>, +) => { + return cdpApiClient( + { + url: `/v2/embedded-wallet-api/projects/${projectId}/end-users/${userId}/solana/send/transaction`, + method: "POST", + headers: { "Content-Type": "application/json" }, + data: sendSolanaTransactionWithEndUserAccountBody, + }, + options, + ); +}; +/** + * Sends USDC from an end user's Solana account to a recipient address on the Solana network. This endpoint simplifies USDC transfers by automatically handling mint resolution, Associated Token Account (ATA) creation, decimal conversion, and transaction encoding. +The `amount` field accepts human-readable amounts as decimal strings (e.g., "1.5", "25.50"). +Use the optional `createRecipientAta` parameter to control whether the sender pays for creating the recipient's Associated Token Account if it doesn't exist. + * @summary Send USDC on Solana + */ +export const sendSolanaAssetWithEndUserAccount = ( + projectId: string, + userId: string, + address: BlockchainAddress, + asset: "usdc", + sendSolanaAssetWithEndUserAccountBody: SendSolanaAssetWithEndUserAccountBody, + options?: SecondParameter>, +) => { + return cdpApiClient( + { + url: `/v2/embedded-wallet-api/projects/${projectId}/end-users/${userId}/solana/${address}/send/${asset}`, + method: "POST", + headers: { "Content-Type": "application/json" }, + data: sendSolanaAssetWithEndUserAccountBody, + }, + options, + ); +}; +export type SignEvmHashWithEndUserAccountResult = NonNullable< + Awaited> +>; +export type SignEvmTransactionWithEndUserAccountResult = NonNullable< + Awaited> +>; +export type SendEvmTransactionWithEndUserAccountResult = NonNullable< + Awaited> +>; +export type SendEvmAssetWithEndUserAccountResult = NonNullable< + Awaited> +>; +export type SignEvmMessageWithEndUserAccountResult = NonNullable< + Awaited> +>; +export type SignEvmTypedDataWithEndUserAccountResult = NonNullable< + Awaited> +>; +export type RevokeDelegationForEndUserResult = NonNullable< + Awaited> +>; +export type CreateEvmEip7702DelegationWithEndUserAccountResult = NonNullable< + Awaited> +>; +export type SendUserOperationWithEndUserAccountResult = NonNullable< + Awaited> +>; +export type RevokeSpendPermissionWithEndUserAccountResult = NonNullable< + Awaited> +>; +export type SignSolanaHashWithEndUserAccountResult = NonNullable< + Awaited> +>; +export type SignSolanaMessageWithEndUserAccountResult = NonNullable< + Awaited> +>; +export type SignSolanaTransactionWithEndUserAccountResult = NonNullable< + Awaited> +>; +export type SendSolanaTransactionWithEndUserAccountResult = NonNullable< + Awaited> +>; +export type SendSolanaAssetWithEndUserAccountResult = NonNullable< + Awaited> +>; diff --git a/typescript/src/openapi-client/generated/end-user-accounts/end-user-accounts.ts b/typescript/src/openapi-client/generated/end-user-accounts/end-user-accounts.ts index 55007c8b5..18182c99d 100644 --- a/typescript/src/openapi-client/generated/end-user-accounts/end-user-accounts.ts +++ b/typescript/src/openapi-client/generated/end-user-accounts/end-user-accounts.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v7.6.0 🍺 + * Generated by orval v7.21.0 🍺 * Do not edit manually. * Coinbase Developer Platform APIs * The Coinbase Developer Platform APIs - leading the world's transition onchain. @@ -31,7 +31,7 @@ This API is intended to be used by the developer's own backend, and is authentic */ export const createEndUser = ( createEndUserBody: CreateEndUserBody, - options?: SecondParameter, + options?: SecondParameter>, ) => { return cdpApiClient( { @@ -50,7 +50,7 @@ By default, the response is sorted by creation date in ascending order and pagin */ export const listEndUsers = ( params?: ListEndUsersParams, - options?: SecondParameter, + options?: SecondParameter>, ) => { return cdpApiClient({ url: `/v2/end-users`, method: "GET", params }, options); }; @@ -62,7 +62,7 @@ This API is intended to be used by the developer's own backend, and is authentic */ export const validateEndUserAccessToken = ( validateEndUserAccessTokenBody: ValidateEndUserAccessTokenBody, - options?: SecondParameter, + options?: SecondParameter>, ) => { return cdpApiClient( { @@ -80,7 +80,10 @@ export const validateEndUserAccessToken = ( This API is intended to be used by the developer's own backend, and is authenticated using the developer's CDP API key. * @summary Get an end user */ -export const getEndUser = (userId: string, options?: SecondParameter) => { +export const getEndUser = ( + userId: string, + options?: SecondParameter>, +) => { return cdpApiClient({ url: `/v2/end-users/${userId}`, method: "GET" }, options); }; /** @@ -91,7 +94,7 @@ This API is intended to be used by the developer's own backend, and is authentic export const addEndUserEvmAccount = ( userId: string, addEndUserEvmAccountBody?: AddEndUserEvmAccountBody, - options?: SecondParameter, + options?: SecondParameter>, ) => { return cdpApiClient( { @@ -111,7 +114,7 @@ This API is intended to be used by the developer's own backend, and is authentic export const addEndUserEvmSmartAccount = ( userId: string, addEndUserEvmSmartAccountBody?: AddEndUserEvmSmartAccountBody, - options?: SecondParameter, + options?: SecondParameter>, ) => { return cdpApiClient( { @@ -131,7 +134,7 @@ This API is intended to be used by the developer's own backend, and is authentic export const addEndUserSolanaAccount = ( userId: string, addEndUserSolanaAccountBody?: AddEndUserSolanaAccountBody, - options?: SecondParameter, + options?: SecondParameter>, ) => { return cdpApiClient( { @@ -151,7 +154,7 @@ This endpoint allows developers to import existing keys for their end users, sup */ export const importEndUser = ( importEndUserBody: ImportEndUserBody, - options?: SecondParameter, + options?: SecondParameter>, ) => { return cdpApiClient( { diff --git a/typescript/src/openapi-client/generated/evm-accounts/evm-accounts.ts b/typescript/src/openapi-client/generated/evm-accounts/evm-accounts.ts index 37ab8d8ed..c55af269a 100644 --- a/typescript/src/openapi-client/generated/evm-accounts/evm-accounts.ts +++ b/typescript/src/openapi-client/generated/evm-accounts/evm-accounts.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v7.6.0 🍺 + * Generated by orval v7.21.0 🍺 * Do not edit manually. * Coinbase Developer Platform APIs * The Coinbase Developer Platform APIs - leading the world's transition onchain. @@ -42,7 +42,7 @@ The response is paginated, and by default, returns 20 accounts per page. */ export const listEvmAccounts = ( params?: ListEvmAccountsParams, - options?: SecondParameter, + options?: SecondParameter>, ) => { return cdpApiClient( { url: `/v2/evm/accounts`, method: "GET", params }, @@ -55,7 +55,7 @@ export const listEvmAccounts = ( */ export const createEvmAccount = ( createEvmAccountBody?: CreateEvmAccountBody, - options?: SecondParameter, + options?: SecondParameter>, ) => { return cdpApiClient( { @@ -71,7 +71,10 @@ export const createEvmAccount = ( * Gets an EVM account by its address. * @summary Get an EVM account by address */ -export const getEvmAccount = (address: string, options?: SecondParameter) => { +export const getEvmAccount = ( + address: string, + options?: SecondParameter>, +) => { return cdpApiClient({ url: `/v2/evm/accounts/${address}`, method: "GET" }, options); }; /** @@ -81,7 +84,7 @@ export const getEvmAccount = (address: string, options?: SecondParameter, + options?: SecondParameter>, ) => { return cdpApiClient( { @@ -99,7 +102,7 @@ export const updateEvmAccount = ( */ export const getEvmAccountByName = ( name: string, - options?: SecondParameter, + options?: SecondParameter>, ) => { return cdpApiClient( { url: `/v2/evm/accounts/by-name/${name}`, method: "GET" }, @@ -138,7 +141,7 @@ The transaction must be an [EIP-1559 dynamic fee transaction](https://github.com export const sendEvmTransaction = ( address: string, sendEvmTransactionBody: SendEvmTransactionBody, - options?: SecondParameter, + options?: SecondParameter>, ) => { return cdpApiClient( { @@ -160,7 +163,7 @@ The transaction must be an [EIP-1559 dynamic fee transaction](https://github.com export const signEvmTransaction = ( address: string, signEvmTransactionBody: SignEvmTransactionBody, - options?: SecondParameter, + options?: SecondParameter>, ) => { return cdpApiClient( { @@ -179,7 +182,7 @@ export const signEvmTransaction = ( export const signEvmHash = ( address: string, signEvmHashBody: SignEvmHashBody, - options?: SecondParameter, + options?: SecondParameter>, ) => { return cdpApiClient( { @@ -200,7 +203,7 @@ Per the specification, the message in the request body is prepended with `0x19 < export const signEvmMessage = ( address: string, signEvmMessageBody: SignEvmMessageBody, - options?: SecondParameter, + options?: SecondParameter>, ) => { return cdpApiClient( { @@ -219,7 +222,7 @@ export const signEvmMessage = ( export const signEvmTypedData = ( address: string, eIP712Message: EIP712Message, - options?: SecondParameter, + options?: SecondParameter>, ) => { return cdpApiClient( { @@ -246,7 +249,7 @@ The delegation allows the EVM EOA to be used as a smart account, which enables b export const createEvmEip7702Delegation = ( address: string, createEvmEip7702DelegationBody: CreateEvmEip7702DelegationBody, - options?: SecondParameter, + options?: SecondParameter>, ) => { return cdpApiClient( { @@ -264,7 +267,7 @@ export const createEvmEip7702Delegation = ( */ export const getEvmEip7702DelegationOperationById = ( delegationOperationId: string, - options?: SecondParameter, + options?: SecondParameter>, ) => { return cdpApiClient( { url: `/v2/evm/eip7702/delegation-operations/${delegationOperationId}`, method: "GET" }, @@ -277,7 +280,7 @@ export const getEvmEip7702DelegationOperationById = ( */ export const importEvmAccount = ( importEvmAccountBody: ImportEvmAccountBody, - options?: SecondParameter, + options?: SecondParameter>, ) => { return cdpApiClient( { @@ -296,7 +299,7 @@ export const importEvmAccount = ( export const exportEvmAccount = ( address: string, exportEvmAccountBody: ExportEvmAccountBody, - options?: SecondParameter, + options?: SecondParameter>, ) => { return cdpApiClient( { @@ -315,7 +318,7 @@ export const exportEvmAccount = ( export const exportEvmAccountByName = ( name: string, exportEvmAccountByNameBody: ExportEvmAccountByNameBody, - options?: SecondParameter, + options?: SecondParameter>, ) => { return cdpApiClient( { diff --git a/typescript/src/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.ts b/typescript/src/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.ts index 50659fd4f..bbaf83c1a 100644 --- a/typescript/src/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.ts +++ b/typescript/src/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v7.6.0 🍺 + * Generated by orval v7.21.0 🍺 * Do not edit manually. * Coinbase Developer Platform APIs * The Coinbase Developer Platform APIs - leading the world's transition onchain. @@ -9,6 +9,7 @@ import type { CreateEvmSmartAccountBody, CreateSpendPermissionRequest, EvmSmartAccount, + EvmSpendPermissionsRevokeSpendPermissionRequest, EvmUserOperation, ListEvmSmartAccounts200, ListEvmSmartAccountsParams, @@ -16,7 +17,6 @@ import type { ListSpendPermissionsParams, PrepareAndSendUserOperationBody, PrepareUserOperationBody, - RevokeSpendPermissionRequest, SendUserOperationBody, UpdateEvmSmartAccountBody, } from "../coinbaseDeveloperPlatformAPIs.schemas.js"; @@ -32,7 +32,7 @@ The response is paginated, and by default, returns 20 accounts per page. */ export const listEvmSmartAccounts = ( params?: ListEvmSmartAccountsParams, - options?: SecondParameter, + options?: SecondParameter>, ) => { return cdpApiClient( { url: `/v2/evm/smart-accounts`, method: "GET", params }, @@ -45,7 +45,7 @@ export const listEvmSmartAccounts = ( */ export const createEvmSmartAccount = ( createEvmSmartAccountBody: CreateEvmSmartAccountBody, - options?: SecondParameter, + options?: SecondParameter>, ) => { return cdpApiClient( { @@ -63,7 +63,7 @@ export const createEvmSmartAccount = ( */ export const getEvmSmartAccountByName = ( name: string, - options?: SecondParameter, + options?: SecondParameter>, ) => { return cdpApiClient( { url: `/v2/evm/smart-accounts/by-name/${name}`, method: "GET" }, @@ -76,7 +76,7 @@ export const getEvmSmartAccountByName = ( */ export const getEvmSmartAccount = ( address: string, - options?: SecondParameter, + options?: SecondParameter>, ) => { return cdpApiClient( { url: `/v2/evm/smart-accounts/${address}`, method: "GET" }, @@ -90,7 +90,7 @@ export const getEvmSmartAccount = ( export const updateEvmSmartAccount = ( address: string, updateEvmSmartAccountBody: UpdateEvmSmartAccountBody, - options?: SecondParameter, + options?: SecondParameter>, ) => { return cdpApiClient( { @@ -109,7 +109,7 @@ export const updateEvmSmartAccount = ( export const prepareUserOperation = ( address: string, prepareUserOperationBody: PrepareUserOperationBody, - options?: SecondParameter, + options?: SecondParameter>, ) => { return cdpApiClient( { @@ -128,7 +128,7 @@ export const prepareUserOperation = ( export const prepareAndSendUserOperation = ( address: string, prepareAndSendUserOperationBody: PrepareAndSendUserOperationBody, - options?: SecondParameter, + options?: SecondParameter>, ) => { return cdpApiClient( { @@ -147,7 +147,7 @@ export const prepareAndSendUserOperation = ( export const getUserOperation = ( address: string, userOpHash: string, - options?: SecondParameter, + options?: SecondParameter>, ) => { return cdpApiClient( { url: `/v2/evm/smart-accounts/${address}/user-operations/${userOpHash}`, method: "GET" }, @@ -165,7 +165,7 @@ export const sendUserOperation = ( address: string, userOpHash: string, sendUserOperationBody: SendUserOperationBody, - options?: SecondParameter, + options?: SecondParameter>, ) => { return cdpApiClient( { @@ -184,7 +184,7 @@ export const sendUserOperation = ( export const createSpendPermission = ( address: string, createSpendPermissionRequest: CreateSpendPermissionRequest, - options?: SecondParameter, + options?: SecondParameter>, ) => { return cdpApiClient( { @@ -203,7 +203,7 @@ export const createSpendPermission = ( export const listSpendPermissions = ( address: string, params?: ListSpendPermissionsParams, - options?: SecondParameter, + options?: SecondParameter>, ) => { return cdpApiClient( { url: `/v2/evm/smart-accounts/${address}/spend-permissions/list`, method: "GET", params }, @@ -216,15 +216,15 @@ export const listSpendPermissions = ( */ export const revokeSpendPermission = ( address: string, - revokeSpendPermissionRequest: RevokeSpendPermissionRequest, - options?: SecondParameter, + evmSpendPermissionsRevokeSpendPermissionRequest: EvmSpendPermissionsRevokeSpendPermissionRequest, + options?: SecondParameter>, ) => { return cdpApiClient( { url: `/v2/evm/smart-accounts/${address}/spend-permissions/revoke`, method: "POST", headers: { "Content-Type": "application/json" }, - data: revokeSpendPermissionRequest, + data: evmSpendPermissionsRevokeSpendPermissionRequest, }, options, ); diff --git a/typescript/src/openapi-client/generated/evm-swaps/evm-swaps.ts b/typescript/src/openapi-client/generated/evm-swaps/evm-swaps.ts index 6fdbd22de..0befa1b8a 100644 --- a/typescript/src/openapi-client/generated/evm-swaps/evm-swaps.ts +++ b/typescript/src/openapi-client/generated/evm-swaps/evm-swaps.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v7.6.0 🍺 + * Generated by orval v7.21.0 🍺 * Do not edit manually. * Coinbase Developer Platform APIs * The Coinbase Developer Platform APIs - leading the world's transition onchain. @@ -22,7 +22,7 @@ type SecondParameter unknown> = Parameters[1]; */ export const getEvmSwapPrice = ( params: GetEvmSwapPriceParams, - options?: SecondParameter, + options?: SecondParameter>, ) => { return cdpApiClient( { url: `/v2/evm/swaps/quote`, method: "GET", params }, @@ -35,7 +35,7 @@ export const getEvmSwapPrice = ( */ export const createEvmSwapQuote = ( createEvmSwapQuoteBody: CreateEvmSwapQuoteBody, - options?: SecondParameter, + options?: SecondParameter>, ) => { return cdpApiClient( { diff --git a/typescript/src/openapi-client/generated/evm-token-balances/evm-token-balances.ts b/typescript/src/openapi-client/generated/evm-token-balances/evm-token-balances.ts index 236e8c7cb..9e7bf44a1 100644 --- a/typescript/src/openapi-client/generated/evm-token-balances/evm-token-balances.ts +++ b/typescript/src/openapi-client/generated/evm-token-balances/evm-token-balances.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v7.6.0 🍺 + * Generated by orval v7.21.0 🍺 * Do not edit manually. * Coinbase Developer Platform APIs * The Coinbase Developer Platform APIs - leading the world's transition onchain. @@ -24,7 +24,7 @@ export const listEvmTokenBalances = ( network: ListEvmTokenBalancesNetwork, address: string, params?: ListEvmTokenBalancesParams, - options?: SecondParameter, + options?: SecondParameter>, ) => { return cdpApiClient( { url: `/v2/evm/token-balances/${network}/${address}`, method: "GET", params }, diff --git a/typescript/src/openapi-client/generated/faucets/faucets.ts b/typescript/src/openapi-client/generated/faucets/faucets.ts index 1c8f27321..f475200d7 100644 --- a/typescript/src/openapi-client/generated/faucets/faucets.ts +++ b/typescript/src/openapi-client/generated/faucets/faucets.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v7.6.0 🍺 + * Generated by orval v7.21.0 🍺 * Do not edit manually. * Coinbase Developer Platform APIs * The Coinbase Developer Platform APIs - leading the world's transition onchain. @@ -36,7 +36,7 @@ A single blockchain address cannot exceed the specified limits, even if multiple */ export const requestEvmFaucet = ( requestEvmFaucetBody: RequestEvmFaucetBody, - options?: SecondParameter, + options?: SecondParameter>, ) => { return cdpApiClient( { @@ -51,22 +51,23 @@ export const requestEvmFaucet = ( /** * Request funds from the CDP Faucet on Solana devnet. -Faucets are available for SOL. +Faucets are available for SOL, USDC, and CBTUSD. To prevent abuse, we enforce rate limits within a rolling 24-hour window to control the amount of funds that can be requested. These limits are applied at both the CDP Project level and the blockchain address level. A single blockchain address cannot exceed the specified limits, even if multiple users submit requests to the same address. -| Token | Amount per Faucet Request |Rolling 24-hour window Rate Limits| -|:-----:|:-------------------------:|:--------------------------------:| -| SOL | 0.00125 SOL | 0.0125 SOL | -| USDC | 1 USDC | 10 USDC | +| Token | Amount per Faucet Request |Rolling 24-hour window Rate Limits| +|:-----: |:-------------------------:|:--------------------------------:| +| SOL | 0.00125 SOL | 0.0125 SOL | +| USDC | 1 USDC | 10 USDC | +| CBTUSD | 1 CBTUSD | 10 CBTUSD | * @summary Request funds on Solana devnet */ export const requestSolanaFaucet = ( requestSolanaFaucetBody: RequestSolanaFaucetBody, - options?: SecondParameter, + options?: SecondParameter>, ) => { return cdpApiClient( { diff --git a/typescript/src/openapi-client/generated/onchain-data/onchain-data.ts b/typescript/src/openapi-client/generated/onchain-data/onchain-data.ts index f76acec24..4199ea1a4 100644 --- a/typescript/src/openapi-client/generated/onchain-data/onchain-data.ts +++ b/typescript/src/openapi-client/generated/onchain-data/onchain-data.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v7.6.0 🍺 + * Generated by orval v7.21.0 🍺 * Do not edit manually. * Coinbase Developer Platform APIs * The Coinbase Developer Platform APIs - leading the world's transition onchain. @@ -25,7 +25,7 @@ Analyzes transaction history to discover token interactions. export const listTokensForAccount = ( network: "base" | "base-sepolia", address: string, - options?: SecondParameter, + options?: SecondParameter>, ) => { return cdpApiClient( { url: `/v2/data/evm/token-ownership/${network}/${address}`, method: "GET" }, @@ -42,7 +42,7 @@ export const listDataTokenBalances = ( network: ListEvmTokenBalancesNetwork, address: string, params?: ListDataTokenBalancesParams, - options?: SecondParameter, + options?: SecondParameter>, ) => { return cdpApiClient( { url: `/v2/data/evm/token-balances/${network}/${address}`, method: "GET", params }, diff --git a/typescript/src/openapi-client/generated/onramp/onramp.ts b/typescript/src/openapi-client/generated/onramp/onramp.ts index ebc6cbffd..fba5a80de 100644 --- a/typescript/src/openapi-client/generated/onramp/onramp.ts +++ b/typescript/src/openapi-client/generated/onramp/onramp.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v7.6.0 🍺 + * Generated by orval v7.21.0 🍺 * Do not edit manually. * Coinbase Developer Platform APIs * The Coinbase Developer Platform APIs - leading the world's transition onchain. @@ -29,7 +29,7 @@ For detailed integration instructions and to get access to this API, refer to th */ export const createOnrampOrder = ( createOnrampOrderBody: CreateOnrampOrderBody, - options?: SecondParameter, + options?: SecondParameter>, ) => { return cdpApiClient( { @@ -47,7 +47,7 @@ export const createOnrampOrder = ( */ export const getOnrampOrderById = ( orderId: string, - options?: SecondParameter, + options?: SecondParameter>, ) => { return cdpApiClient( { url: `/v2/onramp/orders/${orderId}`, method: "GET" }, @@ -77,7 +77,7 @@ export const getOnrampOrderById = ( */ export const createOnrampSession = ( createOnrampSessionBody: CreateOnrampSessionBody, - options?: SecondParameter, + options?: SecondParameter>, ) => { return cdpApiClient( { @@ -96,7 +96,7 @@ Currently supports `GUEST_CHECKOUT_APPLE_PAY` payment method with phone number i */ export const getOnrampUserLimits = ( getOnrampUserLimitsBody: GetOnrampUserLimitsBody, - options?: SecondParameter, + options?: SecondParameter>, ) => { return cdpApiClient( { diff --git a/typescript/src/openapi-client/generated/policy-engine/policy-engine.ts b/typescript/src/openapi-client/generated/policy-engine/policy-engine.ts index 0fbff1cfe..220041ddb 100644 --- a/typescript/src/openapi-client/generated/policy-engine/policy-engine.ts +++ b/typescript/src/openapi-client/generated/policy-engine/policy-engine.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v7.6.0 🍺 + * Generated by orval v7.21.0 🍺 * Do not edit manually. * Coinbase Developer Platform APIs * The Coinbase Developer Platform APIs - leading the world's transition onchain. @@ -24,7 +24,7 @@ The response is paginated, and by default, returns 20 policies per page. */ export const listPolicies = ( params?: ListPoliciesParams, - options?: SecondParameter, + options?: SecondParameter>, ) => { return cdpApiClient( { url: `/v2/policy-engine/policies`, method: "GET", params }, @@ -37,7 +37,7 @@ export const listPolicies = ( */ export const createPolicy = ( createPolicyBody: CreatePolicyBody, - options?: SecondParameter, + options?: SecondParameter>, ) => { return cdpApiClient( { @@ -53,7 +53,10 @@ export const createPolicy = ( * Get a policy by its ID. * @summary Get a policy by ID */ -export const getPolicyById = (policyId: string, options?: SecondParameter) => { +export const getPolicyById = ( + policyId: string, + options?: SecondParameter>, +) => { return cdpApiClient( { url: `/v2/policy-engine/policies/${policyId}`, method: "GET" }, options, @@ -63,7 +66,10 @@ export const getPolicyById = (policyId: string, options?: SecondParameter) => { +export const deletePolicy = ( + policyId: string, + options?: SecondParameter>, +) => { return cdpApiClient( { url: `/v2/policy-engine/policies/${policyId}`, method: "DELETE" }, options, @@ -76,7 +82,7 @@ export const deletePolicy = (policyId: string, options?: SecondParameter, + options?: SecondParameter>, ) => { return cdpApiClient( { diff --git a/typescript/src/openapi-client/generated/solana-accounts/solana-accounts.ts b/typescript/src/openapi-client/generated/solana-accounts/solana-accounts.ts index 03f88e648..efdb5cadc 100644 --- a/typescript/src/openapi-client/generated/solana-accounts/solana-accounts.ts +++ b/typescript/src/openapi-client/generated/solana-accounts/solana-accounts.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v7.6.0 🍺 + * Generated by orval v7.21.0 🍺 * Do not edit manually. * Coinbase Developer Platform APIs * The Coinbase Developer Platform APIs - leading the world's transition onchain. @@ -37,7 +37,7 @@ If a name is provided, the response will contain only the account with that name */ export const listSolanaAccounts = ( params?: ListSolanaAccountsParams, - options?: SecondParameter, + options?: SecondParameter>, ) => { return cdpApiClient( { url: `/v2/solana/accounts`, method: "GET", params }, @@ -50,7 +50,7 @@ export const listSolanaAccounts = ( */ export const createSolanaAccount = ( createSolanaAccountBody?: CreateSolanaAccountBody, - options?: SecondParameter, + options?: SecondParameter>, ) => { return cdpApiClient( { @@ -68,7 +68,7 @@ export const createSolanaAccount = ( */ export const getSolanaAccount = ( address: string, - options?: SecondParameter, + options?: SecondParameter>, ) => { return cdpApiClient( { url: `/v2/solana/accounts/${address}`, method: "GET" }, @@ -82,7 +82,7 @@ export const getSolanaAccount = ( export const updateSolanaAccount = ( address: string, updateSolanaAccountBody: UpdateSolanaAccountBody, - options?: SecondParameter, + options?: SecondParameter>, ) => { return cdpApiClient( { @@ -100,7 +100,7 @@ export const updateSolanaAccount = ( */ export const getSolanaAccountByName = ( name: string, - options?: SecondParameter, + options?: SecondParameter>, ) => { return cdpApiClient( { url: `/v2/solana/accounts/by-name/${name}`, method: "GET" }, @@ -113,7 +113,7 @@ export const getSolanaAccountByName = ( */ export const importSolanaAccount = ( importSolanaAccountBody: ImportSolanaAccountBody, - options?: SecondParameter, + options?: SecondParameter>, ) => { return cdpApiClient( { @@ -132,7 +132,7 @@ export const importSolanaAccount = ( export const exportSolanaAccount = ( address: string, exportSolanaAccountBody: ExportSolanaAccountBody, - options?: SecondParameter, + options?: SecondParameter>, ) => { return cdpApiClient( { @@ -151,7 +151,7 @@ export const exportSolanaAccount = ( export const exportSolanaAccountByName = ( name: string, exportSolanaAccountByNameBody: ExportSolanaAccountByNameBody, - options?: SecondParameter, + options?: SecondParameter>, ) => { return cdpApiClient( { @@ -179,7 +179,7 @@ The developer is responsible for ensuring that the unsigned transaction is valid export const signSolanaTransaction = ( address: string, signSolanaTransactionBody: SignSolanaTransactionBody, - options?: SecondParameter, + options?: SecondParameter>, ) => { return cdpApiClient( { @@ -200,7 +200,7 @@ export const signSolanaTransaction = ( export const signSolanaMessage = ( address: string, signSolanaMessageBody: SignSolanaMessageBody, - options?: SecondParameter, + options?: SecondParameter>, ) => { return cdpApiClient( { @@ -238,7 +238,7 @@ The developer is responsible for ensuring that the unsigned transaction is valid */ export const sendSolanaTransaction = ( sendSolanaTransactionBody: SendSolanaTransactionBody, - options?: SecondParameter, + options?: SecondParameter>, ) => { return cdpApiClient( { diff --git a/typescript/src/openapi-client/generated/solana-token-balances/solana-token-balances.ts b/typescript/src/openapi-client/generated/solana-token-balances/solana-token-balances.ts index 982779fdc..ef62955fe 100644 --- a/typescript/src/openapi-client/generated/solana-token-balances/solana-token-balances.ts +++ b/typescript/src/openapi-client/generated/solana-token-balances/solana-token-balances.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v7.6.0 🍺 + * Generated by orval v7.21.0 🍺 * Do not edit manually. * Coinbase Developer Platform APIs * The Coinbase Developer Platform APIs - leading the world's transition onchain. @@ -25,7 +25,7 @@ export const listSolanaTokenBalances = ( network: ListSolanaTokenBalancesNetwork, address: string, params?: ListSolanaTokenBalancesParams, - options?: SecondParameter, + options?: SecondParameter>, ) => { return cdpApiClient( { url: `/v2/solana/token-balances/${network}/${address}`, method: "GET", params }, diff --git a/typescript/src/openapi-client/generated/sql-api-alpha/sql-api-alpha.ts b/typescript/src/openapi-client/generated/sql-api-alpha/sql-api-alpha.ts deleted file mode 100644 index a724ccf90..000000000 --- a/typescript/src/openapi-client/generated/sql-api-alpha/sql-api-alpha.ts +++ /dev/null @@ -1,72 +0,0 @@ -/** - * Generated by orval v7.6.0 🍺 - * Do not edit manually. - * Coinbase Developer Platform APIs - * The Coinbase Developer Platform APIs - leading the world's transition onchain. - * OpenAPI spec version: 2.0.0 - */ -import type { - OnchainDataQuery, - OnchainDataResult, -} from "../coinbaseDeveloperPlatformAPIs.schemas.js"; - -import { cdpApiClient } from "../../cdpApiClient.js"; - -type SecondParameter unknown> = Parameters[1]; - -/** - * Run a read-only SQL query against indexed blockchain data including transactions, events, and decoded logs. - -This endpoint provides direct SQL access to comprehensive blockchain data across supported networks. -Queries are executed against optimized data structures for high-performance analytics. - -### Allowed Queries - - - Standard SQL syntax (ClickHouse dialect) - - Read-only queries (SELECT statements) - - No DDL or DML operations - - No cartesian products - -### Supported Tables - - - `base.events` - Base mainnet decoded event logs with parameters, event signature, topics, and more. - - `base.transactions` - Base mainnet transaction data including hash, block number, gas usage. - - `base.blocks` - Base mainnet block information. - - `base.encoded_logs` - Encoded log data of event logs that aren't able to be decoded by our event decoder (ex: log0 opcode). - - `base.transfers` - All event logs with event signature `Transfer(address,address,uint256)`. ERC-20, ERC-721, and ERC-1155 transfers are all included. - -### Query Limits - - - Maximum result set: 100,000 rows - - Query timeout: 30 seconds - - * @summary Run SQL Query - */ -export const runSQLQuery = ( - onchainDataQuery: OnchainDataQuery, - options?: SecondParameter, -) => { - return cdpApiClient( - { - url: `/v2/data/query/run`, - method: "POST", - headers: { "Content-Type": "application/json" }, - data: onchainDataQuery, - }, - options, - ); -}; -/** - * Retrieve the SQL grammar for the SQL API. - -The SQL queries that are supported by the SQL API are defined via an ANTLR4 grammar which is evaluated by server before executing the query. This ensures the safety and soundness of the SQL API. - -This endpoint returns the ANTLR4 grammar that is used to evaluate the SQL queries so that developers can understand the SQL API and build SQL queries with high confidence and correctness. LLMs interact well with ANTLR4 grammar as well. - - * @summary Get SQL grammar - */ -export const getSQLGrammar = (options?: SecondParameter) => { - return cdpApiClient({ url: `/v2/data/query/grammar`, method: "GET" }, options); -}; -export type RunSQLQueryResult = NonNullable>>; -export type GetSQLGrammarResult = NonNullable>>; diff --git a/typescript/src/openapi-client/generated/sql-api/sql-api.ts b/typescript/src/openapi-client/generated/sql-api/sql-api.ts new file mode 100644 index 000000000..5c5b1d5cb --- /dev/null +++ b/typescript/src/openapi-client/generated/sql-api/sql-api.ts @@ -0,0 +1,92 @@ +/** + * Generated by orval v7.21.0 🍺 + * Do not edit manually. + * Coinbase Developer Platform APIs + * The Coinbase Developer Platform APIs - leading the world's transition onchain. + * OpenAPI spec version: 2.0.0 + */ +import type { + OnchainDataQuery, + OnchainDataResult, +} from "../coinbaseDeveloperPlatformAPIs.schemas.js"; + +import { cdpApiClient } from "../../cdpApiClient.js"; + +type SecondParameter unknown> = Parameters[1]; + +/** + * Run a read-only SQL query against indexed blockchain data including transactions, events, and decoded logs. + +This endpoint provides direct SQL access to comprehensive blockchain data across supported networks. + +Queries are executed against optimized data structures for high-performance analytics. + +### Allowed Queries + + - Standard SQL syntax (CoinbaSeQL dialect, based on ClickHouse dialect) + - Read-only queries (SELECT statements) + - No DDL or DML operations + - Query that follow limits (defined below) + +### Supported Tables + + - `.events` - Base mainnet decoded event logs with parameters, event signature, topics, and more. + - `.transactions` - Base mainnet transaction data including hash, block number, gas usage. + - `.blocks` - Base mainnet block information. + - `.encoded_logs` - Encoded log data of event logs that aren't able to be decoded by our event decoder (ex: log0 opcode). + - `.decoded_user_operations` - Decoded user operations data including hash, block number, gas usage, builder codes, entrypoint version, and more. + - `.transaction_attributions` - Information about the attributions of a transaction to a builder and associated builder codes. + +### Supported Networks + + - Base Mainnet: `base` + - Base Sepolia: `base_sepolia` + + So for example, valid tables are: `base.events`, `base_sepolia.events`, `base.transactions`, etc. + +### Query Limits + + - Maximum result set: 50,000 rows + - Maximum query length: 10,000 characters + - Maximum on-disk data to read: 100GB + - Maximum memory usage: 15GB + - Query timeout: 30 seconds + - Maximum JOINs: 12 + +### Query Caching + +By default, each query result is returned from cache so long as the result is from an identical query and less than 750ms old. This freshness tolerance can be modified upwards, to a maximum of 900000ms (i.e. 900s, 15m). +This can be helpful for users who wish to reduce expensive calls to the SQL API by reusing cached results. + + * @summary Run SQL Query + */ +export const runSQLQuery = ( + onchainDataQuery: OnchainDataQuery, + options?: SecondParameter>, +) => { + return cdpApiClient( + { + url: `/v2/data/query/run`, + method: "POST", + headers: { "Content-Type": "application/json" }, + data: onchainDataQuery, + }, + options, + ); +}; +/** + * Retrieve the SQL grammar for the SQL API. + +The SQL queries that are supported by the SQL API are defined in ANTLR4 grammar which is evaluated by server before executing the query. This ensures the safety and soundness of the SQL query before execution. + +This endpoint returns the ANTLR4 grammar that is used to evaluate the SQL queries so that developers can understand the SQL API and build SQL queries with high confidence and correctness. + +LLMs interact well with ANTLR4 grammar. You can feed the grammar directly into the LLMs to help generate SQL queries. + + * @summary Get SQL grammar + */ +export const getSQLGrammar = (options?: SecondParameter>) => { + return cdpApiClient({ url: `/v2/data/query/grammar`, method: "GET" }, options); +}; +export type RunSQLQueryResult = NonNullable>>; +export type GetSQLGrammarResult = NonNullable>>; diff --git a/typescript/src/openapi-client/generated/webhooks/webhooks.ts b/typescript/src/openapi-client/generated/webhooks/webhooks.ts index f18ee8e5b..8d294326c 100644 --- a/typescript/src/openapi-client/generated/webhooks/webhooks.ts +++ b/typescript/src/openapi-client/generated/webhooks/webhooks.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v7.6.0 🍺 + * Generated by orval v7.21.0 🍺 * Do not edit manually. * Coinbase Developer Platform APIs * The Coinbase Developer Platform APIs - leading the world's transition onchain. @@ -31,7 +31,7 @@ in descending order by creation time. */ export const listWebhookSubscriptions = ( params?: ListWebhookSubscriptionsParams, - options?: SecondParameter, + options?: SecondParameter>, ) => { return cdpApiClient( { url: `/v2/data/webhooks/subscriptions`, method: "GET", params }, @@ -94,7 +94,7 @@ For `onchain.activity.detected` events, use `labels` for precise filtering with */ export const createWebhookSubscription = ( webhookSubscriptionRequest: WebhookSubscriptionRequest, - options?: SecondParameter, + options?: SecondParameter>, ) => { return cdpApiClient( { @@ -120,7 +120,7 @@ configuration, status, creation timestamp, and webhook signature secret. */ export const getWebhookSubscription = ( subscriptionId: string, - options?: SecondParameter, + options?: SecondParameter>, ) => { return cdpApiClient( { url: `/v2/data/webhooks/subscriptions/${subscriptionId}`, method: "GET" }, @@ -143,7 +143,7 @@ All required fields must be provided, even if they are not being changed. export const updateWebhookSubscription = ( subscriptionId: string, webhookSubscriptionUpdateRequest: WebhookSubscriptionUpdateRequest, - options?: SecondParameter, + options?: SecondParameter>, ) => { return cdpApiClient( { @@ -168,7 +168,7 @@ This action cannot be undone. */ export const deleteWebhookSubscription = ( subscriptionId: string, - options?: SecondParameter, + options?: SecondParameter>, ) => { return cdpApiClient( { url: `/v2/data/webhooks/subscriptions/${subscriptionId}`, method: "DELETE" }, diff --git a/typescript/src/openapi-client/generated/x402-facilitator/x402-facilitator.ts b/typescript/src/openapi-client/generated/x402-facilitator/x402-facilitator.ts index 96174ad70..bb6189d8e 100644 --- a/typescript/src/openapi-client/generated/x402-facilitator/x402-facilitator.ts +++ b/typescript/src/openapi-client/generated/x402-facilitator/x402-facilitator.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v7.6.0 🍺 + * Generated by orval v7.21.0 🍺 * Do not edit manually. * Coinbase Developer Platform APIs * The Coinbase Developer Platform APIs - leading the world's transition onchain. @@ -23,7 +23,7 @@ type SecondParameter unknown> = Parameters[1]; */ export const verifyX402Payment = ( verifyX402PaymentBody: VerifyX402PaymentBody, - options?: SecondParameter, + options?: SecondParameter>, ) => { return cdpApiClient( { @@ -41,7 +41,7 @@ export const verifyX402Payment = ( */ export const settleX402Payment = ( settleX402PaymentBody: SettleX402PaymentBody, - options?: SecondParameter, + options?: SecondParameter>, ) => { return cdpApiClient( { @@ -57,7 +57,9 @@ export const settleX402Payment = ( * Get the supported x402 protocol payment schemes and networks that the facilitator is able to verify and settle payments for. * @summary Get supported payment schemes and networks */ -export const supportedX402PaymentKinds = (options?: SecondParameter) => { +export const supportedX402PaymentKinds = ( + options?: SecondParameter>, +) => { return cdpApiClient( { url: `/v2/x402/supported`, method: "GET" }, options, diff --git a/typescript/src/openapi-client/index.ts b/typescript/src/openapi-client/index.ts index 61348cbdb..c05ab95a4 100644 --- a/typescript/src/openapi-client/index.ts +++ b/typescript/src/openapi-client/index.ts @@ -10,10 +10,11 @@ export * from "./generated/policy-engine/policy-engine.js"; export * from "./generated/onramp/onramp.js"; export * from "./generated/onchain-data/onchain-data.js"; export * from "./generated/end-user-accounts/end-user-accounts.js"; +export * from "./generated/embedded-wallets-core-functionality/embedded-wallets-core-functionality.js"; export * from "./generated/x402-facilitator/x402-facilitator.js"; -export * from "./generated/sql-api-alpha/sql-api-alpha.js"; import { configure } from "./cdpApiClient.js"; +import * as embeddedWallets from "./generated/embedded-wallets-core-functionality/embedded-wallets-core-functionality.js"; import * as endUserAccounts from "./generated/end-user-accounts/end-user-accounts.js"; import * as evm from "./generated/evm-accounts/evm-accounts.js"; import * as evmSmartAccounts from "./generated/evm-smart-accounts/evm-smart-accounts.js"; @@ -38,6 +39,7 @@ export const CdpOpenApiClient = { ...onchainData, ...policies, ...endUserAccounts, + ...embeddedWallets, configure, }; @@ -59,3 +61,4 @@ export const OpenApiPoliciesMethods = { }; export type CdpOpenApiClientType = typeof CdpOpenApiClient; +export * from "./generated/sql-api/sql-api.js";