diff --git a/examples/java/.gitignore b/examples/java/.gitignore index 899e10fd2..90849692e 100644 --- a/examples/java/.gitignore +++ b/examples/java/.gitignore @@ -1,6 +1,7 @@ # Gradle .gradle/ build/ +.settings !gradle/wrapper/gradle-wrapper.jar # IDE diff --git a/examples/java/.settings/org.eclipse.buildship.core.prefs b/examples/java/.settings/org.eclipse.buildship.core.prefs deleted file mode 100644 index e3e47a303..000000000 --- a/examples/java/.settings/org.eclipse.buildship.core.prefs +++ /dev/null @@ -1,13 +0,0 @@ -arguments=--init-script /var/folders/3z/vwxdlgcn1qzg0v8z0f88qzx00000gn/T/db3b08fc4a9ef609cb16b96b200fa13e563f396e9bb1ed0905fdab7bc3bc513b.gradle -auto.sync=false -build.scans.enabled=false -connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER) -connection.project.dir= -eclipse.preferences.version=1 -gradle.user.home= -java.home=/Library/Java/JavaVirtualMachines/zulu-21.jdk/Contents/Home -jvm.arguments= -offline.mode=false -override.workspace.settings=true -show.console.view=true -show.executions.view=true diff --git a/examples/java/build.gradle.kts b/examples/java/build.gradle.kts index 484df517e..4e5414578 100644 --- a/examples/java/build.gradle.kts +++ b/examples/java/build.gradle.kts @@ -129,6 +129,119 @@ tasks.register("runRetryConfiguration") { classpath = sourceSets["main"].runtimeClasspath } +// End User examples +tasks.register("runCreateEndUser") { + group = "examples" + description = "Run the create end user example" + mainClass.set("com.coinbase.cdp.examples.enduser.CreateEndUser") + classpath = sourceSets["main"].runtimeClasspath +} + +tasks.register("runGetEndUser") { + group = "examples" + description = "Run the get end user example" + mainClass.set("com.coinbase.cdp.examples.enduser.GetEndUser") + classpath = sourceSets["main"].runtimeClasspath +} + +tasks.register("runListEndUsers") { + group = "examples" + description = "Run the list end users example" + mainClass.set("com.coinbase.cdp.examples.enduser.ListEndUsers") + classpath = sourceSets["main"].runtimeClasspath +} + +tasks.register("runImportEndUser") { + group = "examples" + description = "Run the import end user example" + mainClass.set("com.coinbase.cdp.examples.enduser.ImportEndUser") + classpath = sourceSets["main"].runtimeClasspath +} + +tasks.register("runAddEndUserEvmAccount") { + group = "examples" + description = "Run the add EVM account to end user example" + mainClass.set("com.coinbase.cdp.examples.enduser.AddEndUserEvmAccount") + classpath = sourceSets["main"].runtimeClasspath +} + +tasks.register("runAddEndUserEvmSmartAccount") { + group = "examples" + description = "Run the add EVM smart account to end user example" + mainClass.set("com.coinbase.cdp.examples.enduser.AddEndUserEvmSmartAccount") + classpath = sourceSets["main"].runtimeClasspath +} + +tasks.register("runAddEndUserSolanaAccount") { + group = "examples" + description = "Run the add Solana account to end user example" + mainClass.set("com.coinbase.cdp.examples.enduser.AddEndUserSolanaAccount") + classpath = sourceSets["main"].runtimeClasspath +} + +tasks.register("runValidateAccessToken") { + group = "examples" + description = "Run the validate access token example" + mainClass.set("com.coinbase.cdp.examples.enduser.ValidateAccessToken") + classpath = sourceSets["main"].runtimeClasspath +} + +tasks.register("runCreateEvmEip7702Delegation") { + group = "examples" + description = "Run the create EIP-7702 delegation example" + mainClass.set("com.coinbase.cdp.examples.enduser.CreateEvmEip7702Delegation") + classpath = sourceSets["main"].runtimeClasspath +} + +tasks.register("runRevokeDelegation") { + group = "examples" + description = "Run the revoke delegation example" + mainClass.set("com.coinbase.cdp.examples.enduser.RevokeDelegation") + classpath = sourceSets["main"].runtimeClasspath +} + +tasks.register("runSignEvmHash") { + group = "examples" + description = "Run the sign EVM hash example" + mainClass.set("com.coinbase.cdp.examples.enduser.SignEvmHash") + classpath = sourceSets["main"].runtimeClasspath +} + +tasks.register("runSendEvmTransaction") { + group = "examples" + description = "Run the send EVM transaction example" + mainClass.set("com.coinbase.cdp.examples.enduser.SendEvmTransaction") + classpath = sourceSets["main"].runtimeClasspath +} + +tasks.register("runSendEvmAsset") { + group = "examples" + description = "Run the send EVM asset example" + mainClass.set("com.coinbase.cdp.examples.enduser.SendEvmAsset") + classpath = sourceSets["main"].runtimeClasspath +} + +tasks.register("runSendUserOperation") { + group = "examples" + description = "Run the send user operation example" + mainClass.set("com.coinbase.cdp.examples.enduser.SendUserOperation") + classpath = sourceSets["main"].runtimeClasspath +} + +tasks.register("runSignSolanaMessage") { + group = "examples" + description = "Run the sign Solana message example" + mainClass.set("com.coinbase.cdp.examples.enduser.SignSolanaMessage") + classpath = sourceSets["main"].runtimeClasspath +} + +tasks.register("runCreateEndUserPolicy") { + group = "examples" + description = "Run the create end user policy example" + mainClass.set("com.coinbase.cdp.examples.enduser.CreateEndUserPolicy") + classpath = sourceSets["main"].runtimeClasspath +} + // Task to list all available example tasks tasks.register("listExamples") { group = "examples" @@ -148,6 +261,24 @@ tasks.register("listExamples") { println(" ./gradlew runListSolanaAccounts - List Solana accounts") println(" ./gradlew runSolanaTransfer - Transfer SOL between accounts") println(" ./gradlew runRetryConfiguration - Configure HTTP retry behavior") + println("") + println("End User examples:") + println(" ./gradlew runCreateEndUser - Create end users with email auth") + println(" ./gradlew runGetEndUser - Get an end user by ID") + println(" ./gradlew runListEndUsers - List end users") + println(" ./gradlew runImportEndUser - Import an end user with a private key") + println(" ./gradlew runAddEndUserEvmAccount - Add an EVM account to an end user") + println(" ./gradlew runAddEndUserEvmSmartAccount - Add an EVM smart account to an end user") + println(" ./gradlew runAddEndUserSolanaAccount - Add a Solana account to an end user") + println(" ./gradlew runValidateAccessToken - Validate an end user access token") + println(" ./gradlew runCreateEvmEip7702Delegation - Create an EIP-7702 delegation") + println(" ./gradlew runRevokeDelegation - Revoke delegation for an end user") + println(" ./gradlew runSignEvmHash - Sign an EVM hash (delegated)") + println(" ./gradlew runSendEvmTransaction - Send an EVM transaction (delegated)") + println(" ./gradlew runSendEvmAsset - Send USDC on EVM (delegated)") + println(" ./gradlew runSendUserOperation - Send a user operation (delegated)") + println(" ./gradlew runSignSolanaMessage - Sign a Solana message (delegated)") + println(" ./gradlew runCreateEndUserPolicy - Create an end user policy") println("\nOr run any example directly:") println(" ./gradlew run -PmainClass=com.coinbase.cdp.examples.evm.CreateAccount") } diff --git a/examples/java/src/main/java/com/coinbase/cdp/examples/enduser/AddEndUserEvmAccount.java b/examples/java/src/main/java/com/coinbase/cdp/examples/enduser/AddEndUserEvmAccount.java new file mode 100644 index 000000000..1e943995d --- /dev/null +++ b/examples/java/src/main/java/com/coinbase/cdp/examples/enduser/AddEndUserEvmAccount.java @@ -0,0 +1,63 @@ +package com.coinbase.cdp.examples.enduser; + +import com.coinbase.cdp.CdpClient; +import com.coinbase.cdp.examples.utils.EnvLoader; +import com.coinbase.cdp.openapi.model.AuthenticationMethod; +import com.coinbase.cdp.openapi.model.AuthenticationMethods; +import com.coinbase.cdp.openapi.model.CreateEndUserRequest; +import com.coinbase.cdp.openapi.model.EmailAuthentication; + +/** + * Example: Add an additional EVM account to an end user. + * + *

This example creates an end user and then adds a second EVM EOA account. End users can have + * up to 10 EVM accounts. + * + *

Usage: ./gradlew runAddEndUserEvmAccount + */ +public class AddEndUserEvmAccount { + + public static void main(String[] args) throws Exception { + EnvLoader.load(); + + try (CdpClient cdp = CdpClient.create()) { + // Build authentication methods with email + var authMethods = new AuthenticationMethods(); + authMethods.add( + new AuthenticationMethod( + new EmailAuthentication() + .type(EmailAuthentication.TypeEnum.EMAIL) + .email("user@example.com"))); + + // Step 1: Create an end user + System.out.println("Step 1: Creating end user..."); + var endUser = + cdp.endUser() + .createEndUser(new CreateEndUserRequest().authenticationMethods(authMethods)); + + System.out.println(" User ID: " + endUser.getUserId()); + System.out.println(" EVM accounts: " + endUser.getEvmAccountObjects().size()); + for (var account : endUser.getEvmAccountObjects()) { + System.out.println(" Address: " + account.getAddress()); + } + System.out.println(); + + // Step 2: Add another EVM account + System.out.println("Step 2: Adding another EVM account..."); + var newAccount = cdp.endUser().addEvmAccount(endUser.getUserId()); + + System.out.println( + " New EVM account address: " + newAccount.getEvmAccount().getAddress()); + System.out.println(); + + // Step 3: Verify by retrieving the end user + System.out.println("Step 3: Verifying..."); + var updatedUser = cdp.endUser().getEndUser(endUser.getUserId()); + System.out.println( + " Total EVM accounts: " + updatedUser.getEvmAccountObjects().size()); + for (var account : updatedUser.getEvmAccountObjects()) { + System.out.println(" Address: " + account.getAddress()); + } + } + } +} diff --git a/examples/java/src/main/java/com/coinbase/cdp/examples/enduser/AddEndUserEvmSmartAccount.java b/examples/java/src/main/java/com/coinbase/cdp/examples/enduser/AddEndUserEvmSmartAccount.java new file mode 100644 index 000000000..618a08a7a --- /dev/null +++ b/examples/java/src/main/java/com/coinbase/cdp/examples/enduser/AddEndUserEvmSmartAccount.java @@ -0,0 +1,76 @@ +package com.coinbase.cdp.examples.enduser; + +import com.coinbase.cdp.CdpClient; +import com.coinbase.cdp.examples.utils.EnvLoader; +import com.coinbase.cdp.openapi.model.AddEndUserEvmSmartAccountRequest; +import com.coinbase.cdp.openapi.model.AuthenticationMethod; +import com.coinbase.cdp.openapi.model.AuthenticationMethods; +import com.coinbase.cdp.openapi.model.CreateEndUserRequest; +import com.coinbase.cdp.openapi.model.CreateEndUserRequestEvmAccount; +import com.coinbase.cdp.openapi.model.EmailAuthentication; + +/** + * Example: Add an additional EVM smart account to an end user. + * + *

This example creates an end user with a smart account, then adds another smart account. + * + *

Usage: ./gradlew runAddEndUserEvmSmartAccount + */ +public class AddEndUserEvmSmartAccount { + + public static void main(String[] args) throws Exception { + EnvLoader.load(); + + try (CdpClient cdp = CdpClient.create()) { + // Build authentication methods with email + var authMethods = new AuthenticationMethods(); + authMethods.add( + new AuthenticationMethod( + new EmailAuthentication() + .type(EmailAuthentication.TypeEnum.EMAIL) + .email("user@example.com"))); + + // Step 1: Create an end user with a smart account + System.out.println("Step 1: Creating end user with smart account..."); + var endUser = + cdp.endUser() + .createEndUser( + new CreateEndUserRequest() + .authenticationMethods(authMethods) + .evmAccount( + new CreateEndUserRequestEvmAccount().createSmartAccount(true))); + + System.out.println(" User ID: " + endUser.getUserId()); + System.out.println( + " EVM smart accounts: " + endUser.getEvmSmartAccountObjects().size()); + for (var smartAccount : endUser.getEvmSmartAccountObjects()) { + System.out.println(" Address: " + smartAccount.getAddress()); + System.out.println(" Owners: " + smartAccount.getOwnerAddresses()); + } + System.out.println(); + + // Step 2: Add another smart account + System.out.println("Step 2: Adding another smart account..."); + var newSmartAccount = + cdp.endUser() + .addEvmSmartAccount( + endUser.getUserId(), new AddEndUserEvmSmartAccountRequest()); + + System.out.println( + " New smart account address: " + + newSmartAccount.getEvmSmartAccount().getAddress()); + System.out.println(); + + // Step 3: Verify by retrieving the end user + System.out.println("Step 3: Verifying..."); + var updatedUser = cdp.endUser().getEndUser(endUser.getUserId()); + System.out.println( + " Total EVM smart accounts: " + + updatedUser.getEvmSmartAccountObjects().size()); + for (var smartAccount : updatedUser.getEvmSmartAccountObjects()) { + System.out.println(" Address: " + smartAccount.getAddress()); + System.out.println(" Owners: " + smartAccount.getOwnerAddresses()); + } + } + } +} diff --git a/examples/java/src/main/java/com/coinbase/cdp/examples/enduser/AddEndUserSolanaAccount.java b/examples/java/src/main/java/com/coinbase/cdp/examples/enduser/AddEndUserSolanaAccount.java new file mode 100644 index 000000000..6e0c80796 --- /dev/null +++ b/examples/java/src/main/java/com/coinbase/cdp/examples/enduser/AddEndUserSolanaAccount.java @@ -0,0 +1,68 @@ +package com.coinbase.cdp.examples.enduser; + +import com.coinbase.cdp.CdpClient; +import com.coinbase.cdp.examples.utils.EnvLoader; +import com.coinbase.cdp.openapi.model.AuthenticationMethod; +import com.coinbase.cdp.openapi.model.AuthenticationMethods; +import com.coinbase.cdp.openapi.model.CreateEndUserRequest; +import com.coinbase.cdp.openapi.model.CreateEndUserRequestSolanaAccount; +import com.coinbase.cdp.openapi.model.EmailAuthentication; + +/** + * Example: Add an additional Solana account to an end user. + * + *

This example creates an end user with a Solana account, then adds another Solana account. End + * users can have up to 10 Solana accounts. + * + *

Usage: ./gradlew runAddEndUserSolanaAccount + */ +public class AddEndUserSolanaAccount { + + public static void main(String[] args) throws Exception { + EnvLoader.load(); + + try (CdpClient cdp = CdpClient.create()) { + // Build authentication methods with email + var authMethods = new AuthenticationMethods(); + authMethods.add( + new AuthenticationMethod( + new EmailAuthentication() + .type(EmailAuthentication.TypeEnum.EMAIL) + .email("user@example.com"))); + + // Step 1: Create an end user with a Solana account + System.out.println("Step 1: Creating end user with Solana account..."); + var endUser = + cdp.endUser() + .createEndUser( + new CreateEndUserRequest() + .authenticationMethods(authMethods) + .solanaAccount(new CreateEndUserRequestSolanaAccount())); + + System.out.println(" User ID: " + endUser.getUserId()); + System.out.println( + " Solana accounts: " + endUser.getSolanaAccountObjects().size()); + for (var account : endUser.getSolanaAccountObjects()) { + System.out.println(" Address: " + account.getAddress()); + } + System.out.println(); + + // Step 2: Add another Solana account + System.out.println("Step 2: Adding another Solana account..."); + var newAccount = cdp.endUser().addSolanaAccount(endUser.getUserId()); + + System.out.println( + " New Solana account address: " + newAccount.getSolanaAccount().getAddress()); + System.out.println(); + + // Step 3: Verify by retrieving the end user + System.out.println("Step 3: Verifying..."); + var updatedUser = cdp.endUser().getEndUser(endUser.getUserId()); + System.out.println( + " Total Solana accounts: " + updatedUser.getSolanaAccountObjects().size()); + for (var account : updatedUser.getSolanaAccountObjects()) { + System.out.println(" Address: " + account.getAddress()); + } + } + } +} diff --git a/examples/java/src/main/java/com/coinbase/cdp/examples/enduser/CreateEndUser.java b/examples/java/src/main/java/com/coinbase/cdp/examples/enduser/CreateEndUser.java new file mode 100644 index 000000000..722a71570 --- /dev/null +++ b/examples/java/src/main/java/com/coinbase/cdp/examples/enduser/CreateEndUser.java @@ -0,0 +1,99 @@ +package com.coinbase.cdp.examples.enduser; + +import com.coinbase.cdp.CdpClient; +import com.coinbase.cdp.examples.utils.EnvLoader; +import com.coinbase.cdp.openapi.model.AuthenticationMethod; +import com.coinbase.cdp.openapi.model.AuthenticationMethods; +import com.coinbase.cdp.openapi.model.CreateEndUserRequest; +import com.coinbase.cdp.openapi.model.CreateEndUserRequestEvmAccount; +import com.coinbase.cdp.openapi.model.EmailAuthentication; + +/** + * Example: Create end users with email authentication. + * + *

This example demonstrates three ways to create end users: + * + *

    + *
  1. Basic end user with an EVM EOA account + *
  2. End user with a smart account + *
  3. End user with a smart account and spend permissions enabled + *
+ * + *

Usage: ./gradlew runCreateEndUser + */ +public class CreateEndUser { + + public static void main(String[] args) throws Exception { + EnvLoader.load(); + + try (CdpClient cdp = CdpClient.create()) { + // Build authentication methods with email + var authMethods = new AuthenticationMethods(); + authMethods.add( + new AuthenticationMethod( + new EmailAuthentication() + .type(EmailAuthentication.TypeEnum.EMAIL) + .email("user@example.com"))); + + // 1. Create a basic end user with an EVM EOA account + System.out.println("1. Creating basic end user..."); + var basicUser = + cdp.endUser() + .createEndUser( + new CreateEndUserRequest().authenticationMethods(authMethods)); + + System.out.println(" User ID: " + basicUser.getUserId()); + System.out.println(" EVM accounts: " + basicUser.getEvmAccountObjects().size()); + for (var account : basicUser.getEvmAccountObjects()) { + System.out.println(" Address: " + account.getAddress()); + } + System.out.println(); + + // 2. Create an end user with a smart account + System.out.println("2. Creating end user with smart account..."); + var smartUser = + cdp.endUser() + .createEndUser( + new CreateEndUserRequest() + .authenticationMethods(authMethods) + .evmAccount( + new CreateEndUserRequestEvmAccount().createSmartAccount(true))); + + System.out.println(" User ID: " + smartUser.getUserId()); + System.out.println(" EVM accounts: " + smartUser.getEvmAccountObjects().size()); + for (var account : smartUser.getEvmAccountObjects()) { + System.out.println(" EOA Address: " + account.getAddress()); + } + System.out.println( + " EVM smart accounts: " + smartUser.getEvmSmartAccountObjects().size()); + for (var smartAccount : smartUser.getEvmSmartAccountObjects()) { + System.out.println(" Smart Account Address: " + smartAccount.getAddress()); + System.out.println(" Owners: " + smartAccount.getOwnerAddresses()); + } + System.out.println(); + + // 3. Create an end user with a smart account and spend permissions + System.out.println("3. Creating end user with smart account + spend permissions..."); + var spendUser = + cdp.endUser() + .createEndUser( + new CreateEndUserRequest() + .authenticationMethods(authMethods) + .evmAccount( + new CreateEndUserRequestEvmAccount() + .createSmartAccount(true) + .enableSpendPermissions(true))); + + System.out.println(" User ID: " + spendUser.getUserId()); + System.out.println(" EVM accounts: " + spendUser.getEvmAccountObjects().size()); + System.out.println( + " EVM smart accounts: " + spendUser.getEvmSmartAccountObjects().size()); + for (var smartAccount : spendUser.getEvmSmartAccountObjects()) { + System.out.println(" Smart Account Address: " + smartAccount.getAddress()); + } + + System.out.println(); + System.out.println("All end users created successfully!"); + } + } +} diff --git a/examples/java/src/main/java/com/coinbase/cdp/examples/enduser/CreateEndUserPolicy.java b/examples/java/src/main/java/com/coinbase/cdp/examples/enduser/CreateEndUserPolicy.java new file mode 100644 index 000000000..1d032e8ed --- /dev/null +++ b/examples/java/src/main/java/com/coinbase/cdp/examples/enduser/CreateEndUserPolicy.java @@ -0,0 +1,134 @@ +package com.coinbase.cdp.examples.enduser; + +import com.coinbase.cdp.CdpClient; +import com.coinbase.cdp.examples.utils.EnvLoader; +import com.coinbase.cdp.openapi.model.CreatePolicyRequest; +import com.coinbase.cdp.openapi.model.Rule; +import com.coinbase.cdp.openapi.model.SendEndUserEvmTransactionCriteria; +import com.coinbase.cdp.openapi.model.SendEndUserEvmTransactionRule; +import com.coinbase.cdp.openapi.model.SendEndUserSolTransactionCriteria; +import com.coinbase.cdp.openapi.model.SendEndUserSolTransactionRule; +import com.coinbase.cdp.openapi.model.SignEndUserEvmMessageCriteria; +import com.coinbase.cdp.openapi.model.SignEndUserEvmMessageRule; +import com.coinbase.cdp.openapi.model.SignEndUserEvmTransactionCriteria; +import com.coinbase.cdp.openapi.model.SignEndUserEvmTransactionRule; +import com.coinbase.cdp.openapi.model.SignEndUserEvmTypedDataCriteria; +import com.coinbase.cdp.openapi.model.SignEndUserEvmTypedDataRule; +import com.coinbase.cdp.openapi.model.SignEndUserSolMessageCriteria; +import com.coinbase.cdp.openapi.model.SignEndUserSolMessageRule; +import com.coinbase.cdp.openapi.model.SignEndUserSolTransactionCriteria; +import com.coinbase.cdp.openapi.model.SignEndUserSolTransactionRule; +import java.util.List; + +/** + * Example: Create a comprehensive end-user policy with all 7 rule types. + * + *

This example demonstrates how to create a project-scoped policy that covers all end-user + * delegated operations across EVM and Solana chains. + * + *

The policy includes rules for: + * + *

    + *
  1. Sign end-user EVM transactions + *
  2. Send end-user EVM transactions + *
  3. Sign end-user EVM messages + *
  4. Sign end-user EVM typed data + *
  5. Sign end-user Solana transactions + *
  6. Send end-user Solana transactions + *
  7. Sign end-user Solana messages + *
+ * + *

Usage: ./gradlew runCreateEndUserPolicy + */ +public class CreateEndUserPolicy { + + public static void main(String[] args) throws Exception { + EnvLoader.load(); + + try (CdpClient cdp = CdpClient.create()) { + System.out.println("Creating comprehensive end-user policy..."); + System.out.println(); + + // 1. Sign end-user EVM transaction rule + var signEvmTxRule = + new SignEndUserEvmTransactionRule() + .action(SignEndUserEvmTransactionRule.ActionEnum.ACCEPT) + .operation( + SignEndUserEvmTransactionRule.OperationEnum.SIGN_END_USER_EVM_TRANSACTION) + .criteria(new SignEndUserEvmTransactionCriteria()); + + // 2. Send end-user EVM transaction rule + var sendEvmTxRule = + new SendEndUserEvmTransactionRule() + .action(SendEndUserEvmTransactionRule.ActionEnum.ACCEPT) + .operation( + SendEndUserEvmTransactionRule.OperationEnum.SEND_END_USER_EVM_TRANSACTION) + .criteria(new SendEndUserEvmTransactionCriteria()); + + // 3. Sign end-user EVM message rule + var signEvmMsgRule = + new SignEndUserEvmMessageRule() + .action(SignEndUserEvmMessageRule.ActionEnum.ACCEPT) + .operation( + SignEndUserEvmMessageRule.OperationEnum.SIGN_END_USER_EVM_MESSAGE) + .criteria(new SignEndUserEvmMessageCriteria()); + + // 4. Sign end-user EVM typed data rule + var signEvmTypedDataRule = + new SignEndUserEvmTypedDataRule() + .action(SignEndUserEvmTypedDataRule.ActionEnum.ACCEPT) + .operation( + SignEndUserEvmTypedDataRule.OperationEnum.SIGN_END_USER_EVM_TYPED_DATA) + .criteria(new SignEndUserEvmTypedDataCriteria()); + + // 5. Sign end-user Solana transaction rule + var signSolTxRule = + new SignEndUserSolTransactionRule() + .action(SignEndUserSolTransactionRule.ActionEnum.ACCEPT) + .operation( + SignEndUserSolTransactionRule.OperationEnum + .SIGN_END_USER_SOL_TRANSACTION) + .criteria(new SignEndUserSolTransactionCriteria()); + + // 6. Send end-user Solana transaction rule + var sendSolTxRule = + new SendEndUserSolTransactionRule() + .action(SendEndUserSolTransactionRule.ActionEnum.ACCEPT) + .operation( + SendEndUserSolTransactionRule.OperationEnum + .SEND_END_USER_SOL_TRANSACTION) + .criteria(new SendEndUserSolTransactionCriteria()); + + // 7. Sign end-user Solana message rule + var signSolMsgRule = + new SignEndUserSolMessageRule() + .action(SignEndUserSolMessageRule.ActionEnum.ACCEPT) + .operation( + SignEndUserSolMessageRule.OperationEnum.SIGN_END_USER_SOL_MESSAGE) + .criteria(new SignEndUserSolMessageCriteria()); + + // Create the policy with all 7 rules + var policy = + cdp.policies() + .createPolicy( + new CreatePolicyRequest() + .scope(CreatePolicyRequest.ScopeEnum.PROJECT) + .description("End user delegated operations policy") + .rules( + List.of( + new Rule(signEvmTxRule), + new Rule(sendEvmTxRule), + new Rule(signEvmMsgRule), + new Rule(signEvmTypedDataRule), + new Rule(signSolTxRule), + new Rule(sendSolTxRule), + new Rule(signSolMsgRule)))); + + System.out.println("Policy created successfully!"); + System.out.println(" Policy ID: " + policy.getId()); + System.out.println(" Scope: " + policy.getScope()); + System.out.println(" Description: " + policy.getDescription()); + System.out.println(" Rules: " + policy.getRules().size()); + } + } +} diff --git a/examples/java/src/main/java/com/coinbase/cdp/examples/enduser/CreateEvmEip7702Delegation.java b/examples/java/src/main/java/com/coinbase/cdp/examples/enduser/CreateEvmEip7702Delegation.java new file mode 100644 index 000000000..a18fe7240 --- /dev/null +++ b/examples/java/src/main/java/com/coinbase/cdp/examples/enduser/CreateEvmEip7702Delegation.java @@ -0,0 +1,57 @@ +package com.coinbase.cdp.examples.enduser; + +import com.coinbase.cdp.CdpClient; +import com.coinbase.cdp.examples.utils.EnvLoader; +import com.coinbase.cdp.openapi.model.CreateEvmEip7702DelegationWithEndUserAccountRequest; +import com.coinbase.cdp.openapi.model.EvmEip7702DelegationNetwork; + +/** + * Example: Create an EIP-7702 delegation for an end user. + * + *

This example requires the end user to have an active delegation on their account that allows + * the developer to sign on their behalf. + * + *

EIP-7702 delegations allow an EOA to temporarily delegate control to a smart contract + * implementation, enabling smart account features like batched transactions and paymasters. + * + *

Usage: ./gradlew runCreateEvmEip7702Delegation --args="<userId>" + */ +public class CreateEvmEip7702Delegation { + + public static void main(String[] args) throws Exception { + if (args.length < 1) { + System.err.println("Usage: CreateEvmEip7702Delegation "); + System.exit(1); + } + + String userId = args[0]; + EnvLoader.load(); + + try (CdpClient cdp = CdpClient.create()) { + // First, get the end user to find their EVM address + var endUser = cdp.endUser().getEndUser(userId); + + if (endUser.getEvmAccountObjects().isEmpty()) { + System.err.println("End user has no EVM accounts."); + System.exit(1); + } + + String address = endUser.getEvmAccountObjects().get(0).getAddress(); + System.out.println("Creating EIP-7702 delegation for user: " + userId); + System.out.println(" Address: " + address); + System.out.println(); + + var response = + cdp.endUser() + .createEvmEip7702Delegation( + userId, + new CreateEvmEip7702DelegationWithEndUserAccountRequest() + .address(address) + .network(EvmEip7702DelegationNetwork.BASE_SEPOLIA) + .enableSpendPermissions(true)); + + System.out.println("EIP-7702 delegation created!"); + System.out.println(" Response: " + response); + } + } +} diff --git a/examples/java/src/main/java/com/coinbase/cdp/examples/enduser/GetEndUser.java b/examples/java/src/main/java/com/coinbase/cdp/examples/enduser/GetEndUser.java new file mode 100644 index 000000000..ae2fa1ce3 --- /dev/null +++ b/examples/java/src/main/java/com/coinbase/cdp/examples/enduser/GetEndUser.java @@ -0,0 +1,55 @@ +package com.coinbase.cdp.examples.enduser; + +import com.coinbase.cdp.CdpClient; +import com.coinbase.cdp.examples.utils.EnvLoader; + +/** + * Example: Get an end user by userId. + * + *

This example demonstrates how to retrieve a specific end user by their unique identifier. + * + *

Usage: ./gradlew runGetEndUser --args="<userId>" + */ +public class GetEndUser { + + public static void main(String[] args) throws Exception { + if (args.length < 1) { + System.err.println("Usage: GetEndUser "); + System.exit(1); + } + + String userId = args[0]; + EnvLoader.load(); + + try (CdpClient cdp = CdpClient.create()) { + System.out.println("Looking up end user: " + userId); + System.out.println(); + + var endUser = cdp.endUser().getEndUser(userId); + + System.out.println("End user details:"); + System.out.println(" User ID: " + endUser.getUserId()); + System.out.println(" Created at: " + endUser.getCreatedAt()); + + System.out.println(" EVM accounts (" + endUser.getEvmAccountObjects().size() + "):"); + for (var account : endUser.getEvmAccountObjects()) { + System.out.println(" Address: " + account.getAddress()); + System.out.println(" Created at: " + account.getCreatedAt()); + } + + System.out.println( + " EVM smart accounts (" + endUser.getEvmSmartAccountObjects().size() + "):"); + for (var smartAccount : endUser.getEvmSmartAccountObjects()) { + System.out.println(" Address: " + smartAccount.getAddress()); + System.out.println(" Owners: " + smartAccount.getOwnerAddresses()); + System.out.println(" Created at: " + smartAccount.getCreatedAt()); + } + + System.out.println( + " Solana accounts (" + endUser.getSolanaAccountObjects().size() + "):"); + for (var solAccount : endUser.getSolanaAccountObjects()) { + System.out.println(" Address: " + solAccount.getAddress()); + } + } + } +} diff --git a/examples/java/src/main/java/com/coinbase/cdp/examples/enduser/ImportEndUser.java b/examples/java/src/main/java/com/coinbase/cdp/examples/enduser/ImportEndUser.java new file mode 100644 index 000000000..3f8a5785d --- /dev/null +++ b/examples/java/src/main/java/com/coinbase/cdp/examples/enduser/ImportEndUser.java @@ -0,0 +1,67 @@ +package com.coinbase.cdp.examples.enduser; + +import com.coinbase.cdp.CdpClient; +import com.coinbase.cdp.client.enduser.EndUserClientOptions.ImportEndUserOptions; +import com.coinbase.cdp.examples.utils.EnvLoader; +import com.coinbase.cdp.openapi.model.AuthenticationMethod; +import com.coinbase.cdp.openapi.model.AuthenticationMethods; +import com.coinbase.cdp.openapi.model.EmailAuthentication; +import com.coinbase.cdp.openapi.model.RequestEvmFaucetRequest; + +/** + * Example: Import an end user with a private key and request faucet funds. + * + *

This example demonstrates how to import an existing EVM private key as an end user. After + * import, it requests testnet ETH from the faucet for the imported account. + * + *

Note: The private key is encrypted client-side before being sent to the API. + * + *

Usage: ./gradlew runImportEndUser + */ +public class ImportEndUser { + + public static void main(String[] args) throws Exception { + EnvLoader.load(); + + try (CdpClient cdp = CdpClient.create()) { + // Build authentication methods with email + var authMethods = new AuthenticationMethods(); + authMethods.add( + new AuthenticationMethod( + new EmailAuthentication() + .type(EmailAuthentication.TypeEnum.EMAIL) + .email("imported-user@example.com"))); + + // Import an end user with an EVM private key + System.out.println("Importing end user with EVM private key..."); + var importedUser = + cdp.endUser() + .importEndUser( + ImportEndUserOptions.builder() + .privateKey( + "0x0000000000000000000000000000000000000000000000000000000000000001") + .keyType("evm") + .authenticationMethods(authMethods) + .build()); + + System.out.println("Imported end user:"); + System.out.println(" User ID: " + importedUser.getUserId()); + for (var account : importedUser.getEvmAccountObjects()) { + System.out.println(" EVM Address: " + account.getAddress()); + + // Request testnet ETH for the imported account + System.out.println("\nRequesting testnet ETH from faucet..."); + var faucetResponse = + cdp.evm() + .requestFaucet( + new RequestEvmFaucetRequest() + .address(account.getAddress()) + .network(RequestEvmFaucetRequest.NetworkEnum.BASE_SEPOLIA) + .token(RequestEvmFaucetRequest.TokenEnum.ETH)); + + System.out.println("Faucet request successful!"); + System.out.println("Transaction hash: " + faucetResponse.getTransactionHash()); + } + } + } +} diff --git a/examples/java/src/main/java/com/coinbase/cdp/examples/enduser/ListEndUsers.java b/examples/java/src/main/java/com/coinbase/cdp/examples/enduser/ListEndUsers.java new file mode 100644 index 000000000..144435a70 --- /dev/null +++ b/examples/java/src/main/java/com/coinbase/cdp/examples/enduser/ListEndUsers.java @@ -0,0 +1,52 @@ +package com.coinbase.cdp.examples.enduser; + +import com.coinbase.cdp.CdpClient; +import com.coinbase.cdp.client.enduser.EndUserClientOptions.ListEndUsersOptions; +import com.coinbase.cdp.examples.utils.EnvLoader; +import java.util.List; + +/** + * Example: List end users with pagination. + * + *

This example demonstrates how to list end users sorted by creation date in descending order, + * with a page size of 10. + * + *

Usage: ./gradlew runListEndUsers + */ +public class ListEndUsers { + + public static void main(String[] args) throws Exception { + EnvLoader.load(); + + try (CdpClient cdp = CdpClient.create()) { + System.out.println("Listing end users (page size: 10, sorted by createdAt desc)..."); + System.out.println(); + + var response = + cdp.endUser() + .listEndUsers( + ListEndUsersOptions.builder() + .pageSize(10) + .sort(List.of("createdAt=desc")) + .build()); + + var endUsers = response.getEndUsers(); + System.out.println("End Users (" + endUsers.size() + " returned):"); + System.out.println(); + + for (var endUser : endUsers) { + System.out.println(" User ID: " + endUser.getUserId()); + System.out.println(" EVM accounts: " + endUser.getEvmAccountObjects().size()); + System.out.println( + " EVM smart accounts: " + endUser.getEvmSmartAccountObjects().size()); + System.out.println( + " Solana accounts: " + endUser.getSolanaAccountObjects().size()); + System.out.println(); + } + + if (endUsers.isEmpty()) { + System.out.println(" No end users found. Run CreateEndUser first."); + } + } + } +} diff --git a/examples/java/src/main/java/com/coinbase/cdp/examples/enduser/RevokeDelegation.java b/examples/java/src/main/java/com/coinbase/cdp/examples/enduser/RevokeDelegation.java new file mode 100644 index 000000000..d6879b2e4 --- /dev/null +++ b/examples/java/src/main/java/com/coinbase/cdp/examples/enduser/RevokeDelegation.java @@ -0,0 +1,34 @@ +package com.coinbase.cdp.examples.enduser; + +import com.coinbase.cdp.CdpClient; +import com.coinbase.cdp.examples.utils.EnvLoader; + +/** + * Example: Revoke all active delegations for an end user. + * + *

This example demonstrates how to revoke all active delegations for a specified end user. After + * revocation, the developer will no longer be able to perform delegated signing or sending + * operations on behalf of the end user. + * + *

Usage: ./gradlew runRevokeDelegation --args="<userId>" + */ +public class RevokeDelegation { + + public static void main(String[] args) throws Exception { + if (args.length < 1) { + System.err.println("Usage: RevokeDelegation "); + System.exit(1); + } + + String userId = args[0]; + EnvLoader.load(); + + try (CdpClient cdp = CdpClient.create()) { + System.out.println("Revoking all delegations for user: " + userId); + + cdp.endUser().revokeDelegation(userId); + + System.out.println("All delegations revoked successfully!"); + } + } +} diff --git a/examples/java/src/main/java/com/coinbase/cdp/examples/enduser/SendEvmAsset.java b/examples/java/src/main/java/com/coinbase/cdp/examples/enduser/SendEvmAsset.java new file mode 100644 index 000000000..1f99c5e81 --- /dev/null +++ b/examples/java/src/main/java/com/coinbase/cdp/examples/enduser/SendEvmAsset.java @@ -0,0 +1,57 @@ +package com.coinbase.cdp.examples.enduser; + +import com.coinbase.cdp.CdpClient; +import com.coinbase.cdp.examples.utils.EnvLoader; +import com.coinbase.cdp.openapi.model.SendEvmAssetWithEndUserAccountRequest; + +/** + * Example: Send an EVM asset (USDC) on behalf of an end user. + * + *

This example requires the end user to have an active delegation on their account that allows + * the developer to sign on their behalf. + * + *

Usage: ./gradlew runSendEvmAsset --args="<userId>" + */ +public class SendEvmAsset { + + public static void main(String[] args) throws Exception { + if (args.length < 1) { + System.err.println("Usage: SendEvmAsset "); + System.exit(1); + } + + String userId = args[0]; + EnvLoader.load(); + + try (CdpClient cdp = CdpClient.create()) { + // Get the end user to find their EVM address + var endUser = cdp.endUser().getEndUser(userId); + + if (endUser.getEvmAccountObjects().isEmpty()) { + System.err.println("End user has no EVM accounts."); + System.exit(1); + } + + String address = endUser.getEvmAccountObjects().get(0).getAddress(); + System.out.println("Sending USDC for user: " + userId); + System.out.println(" From address: " + address); + System.out.println(); + + var response = + cdp.endUser() + .sendEvmAsset( + userId, + address, + "usdc", + new SendEvmAssetWithEndUserAccountRequest() + .to("0x0000000000000000000000000000000000000000") + .amount("1000000") + .network( + SendEvmAssetWithEndUserAccountRequest.NetworkEnum + .BASE_SEPOLIA)); + + System.out.println("Asset sent successfully!"); + System.out.println(" Transaction hash: " + response.getTransactionHash()); + } + } +} diff --git a/examples/java/src/main/java/com/coinbase/cdp/examples/enduser/SendEvmTransaction.java b/examples/java/src/main/java/com/coinbase/cdp/examples/enduser/SendEvmTransaction.java new file mode 100644 index 000000000..96d3123a7 --- /dev/null +++ b/examples/java/src/main/java/com/coinbase/cdp/examples/enduser/SendEvmTransaction.java @@ -0,0 +1,55 @@ +package com.coinbase.cdp.examples.enduser; + +import com.coinbase.cdp.CdpClient; +import com.coinbase.cdp.examples.utils.EnvLoader; +import com.coinbase.cdp.openapi.model.SendEvmTransactionWithEndUserAccountRequest; + +/** + * Example: Send an EVM transaction on behalf of an end user. + * + *

This example requires the end user to have an active delegation on their account that allows + * the developer to sign on their behalf. + * + *

Usage: ./gradlew runSendEvmTransaction --args="<userId>" + */ +public class SendEvmTransaction { + + public static void main(String[] args) throws Exception { + if (args.length < 1) { + System.err.println("Usage: SendEvmTransaction "); + System.exit(1); + } + + String userId = args[0]; + EnvLoader.load(); + + try (CdpClient cdp = CdpClient.create()) { + // Get the end user to find their EVM address + var endUser = cdp.endUser().getEndUser(userId); + + if (endUser.getEvmAccountObjects().isEmpty()) { + System.err.println("End user has no EVM accounts."); + System.exit(1); + } + + String address = endUser.getEvmAccountObjects().get(0).getAddress(); + System.out.println("Sending EVM transaction for user: " + userId); + System.out.println(" Address: " + address); + System.out.println(); + + var response = + cdp.endUser() + .sendEvmTransaction( + userId, + new SendEvmTransactionWithEndUserAccountRequest() + .transaction("0x02f86c84014a34008203e8830186a09400000000000000000000000000000000000000008080c0808080") + .address(address) + .network( + SendEvmTransactionWithEndUserAccountRequest.NetworkEnum + .BASE_SEPOLIA)); + + System.out.println("Transaction sent successfully!"); + System.out.println(" Transaction hash: " + response.getTransactionHash()); + } + } +} diff --git a/examples/java/src/main/java/com/coinbase/cdp/examples/enduser/SendUserOperation.java b/examples/java/src/main/java/com/coinbase/cdp/examples/enduser/SendUserOperation.java new file mode 100644 index 000000000..027432ae0 --- /dev/null +++ b/examples/java/src/main/java/com/coinbase/cdp/examples/enduser/SendUserOperation.java @@ -0,0 +1,67 @@ +package com.coinbase.cdp.examples.enduser; + +import com.coinbase.cdp.CdpClient; +import com.coinbase.cdp.examples.utils.EnvLoader; +import com.coinbase.cdp.openapi.model.EvmCall; +import com.coinbase.cdp.openapi.model.EvmUserOperationNetwork; +import com.coinbase.cdp.openapi.model.SendUserOperationWithEndUserAccountRequest; +import java.util.List; + +/** + * Example: Send a user operation on behalf of an end user. + * + *

This example requires the end user to have an active delegation on their account that allows + * the developer to sign on their behalf. + * + *

User operations are sent through a smart account and can batch multiple calls together. This + * example uses the CDP paymaster to sponsor gas fees. + * + *

Usage: ./gradlew runSendUserOperation --args="<userId>" + */ +public class SendUserOperation { + + public static void main(String[] args) throws Exception { + if (args.length < 1) { + System.err.println("Usage: SendUserOperation "); + System.exit(1); + } + + String userId = args[0]; + EnvLoader.load(); + + try (CdpClient cdp = CdpClient.create()) { + // Get the end user to find their smart account address + var endUser = cdp.endUser().getEndUser(userId); + + if (endUser.getEvmSmartAccountObjects().isEmpty()) { + System.err.println("End user has no EVM smart accounts."); + System.exit(1); + } + + String address = endUser.getEvmSmartAccountObjects().get(0).getAddress(); + System.out.println("Sending user operation for user: " + userId); + System.out.println(" Smart account address: " + address); + System.out.println(); + + var response = + cdp.endUser() + .sendUserOperation( + userId, + address, + new SendUserOperationWithEndUserAccountRequest() + .network(EvmUserOperationNetwork.BASE_SEPOLIA) + .calls( + List.of( + new EvmCall() + .to( + "0x0000000000000000000000000000000000000000") + .value("0") + .data("0x"))) + .useCdpPaymaster(true)); + + System.out.println("User operation sent successfully!"); + System.out.println(" User operation hash: " + response.getUserOpHash()); + System.out.println(" Status: " + response.getStatus()); + } + } +} diff --git a/examples/java/src/main/java/com/coinbase/cdp/examples/enduser/SignEvmHash.java b/examples/java/src/main/java/com/coinbase/cdp/examples/enduser/SignEvmHash.java new file mode 100644 index 000000000..c066b9f02 --- /dev/null +++ b/examples/java/src/main/java/com/coinbase/cdp/examples/enduser/SignEvmHash.java @@ -0,0 +1,53 @@ +package com.coinbase.cdp.examples.enduser; + +import com.coinbase.cdp.CdpClient; +import com.coinbase.cdp.examples.utils.EnvLoader; +import com.coinbase.cdp.openapi.model.SignEvmHashWithEndUserAccountRequest; + +/** + * Example: Sign an EVM hash on behalf of an end user. + * + *

This example requires the end user to have an active delegation on their account that allows + * the developer to sign on their behalf. + * + *

Usage: ./gradlew runSignEvmHash --args="<userId>" + */ +public class SignEvmHash { + + public static void main(String[] args) throws Exception { + if (args.length < 1) { + System.err.println("Usage: SignEvmHash "); + System.exit(1); + } + + String userId = args[0]; + EnvLoader.load(); + + try (CdpClient cdp = CdpClient.create()) { + // Get the end user to find their EVM address + var endUser = cdp.endUser().getEndUser(userId); + + if (endUser.getEvmAccountObjects().isEmpty()) { + System.err.println("End user has no EVM accounts."); + System.exit(1); + } + + String address = endUser.getEvmAccountObjects().get(0).getAddress(); + System.out.println("Signing hash for user: " + userId); + System.out.println(" Address: " + address); + System.out.println(); + + var response = + cdp.endUser() + .signEvmHash( + userId, + new SignEvmHashWithEndUserAccountRequest() + .hash( + "0x0000000000000000000000000000000000000000000000000000000000000001") + .address(address)); + + System.out.println("Hash signed successfully!"); + System.out.println(" Signature: " + response.getSignature()); + } + } +} diff --git a/examples/java/src/main/java/com/coinbase/cdp/examples/enduser/SignSolanaMessage.java b/examples/java/src/main/java/com/coinbase/cdp/examples/enduser/SignSolanaMessage.java new file mode 100644 index 000000000..3f80d126a --- /dev/null +++ b/examples/java/src/main/java/com/coinbase/cdp/examples/enduser/SignSolanaMessage.java @@ -0,0 +1,57 @@ +package com.coinbase.cdp.examples.enduser; + +import com.coinbase.cdp.CdpClient; +import com.coinbase.cdp.examples.utils.EnvLoader; +import com.coinbase.cdp.openapi.model.SignSolanaMessageWithEndUserAccountRequest; +import java.util.Base64; + +/** + * Example: Sign a Solana message on behalf of an end user. + * + *

This example requires the end user to have an active delegation on their account that allows + * the developer to sign on their behalf. + * + *

Usage: ./gradlew runSignSolanaMessage --args="<userId>" + */ +public class SignSolanaMessage { + + public static void main(String[] args) throws Exception { + if (args.length < 1) { + System.err.println("Usage: SignSolanaMessage "); + System.exit(1); + } + + String userId = args[0]; + EnvLoader.load(); + + try (CdpClient cdp = CdpClient.create()) { + // Get the end user to find their Solana address + var endUser = cdp.endUser().getEndUser(userId); + + if (endUser.getSolanaAccountObjects().isEmpty()) { + System.err.println("End user has no Solana accounts."); + System.exit(1); + } + + String address = endUser.getSolanaAccountObjects().get(0).getAddress(); + String message = "Hello, World!"; + String encodedMessage = Base64.getEncoder().encodeToString(message.getBytes()); + + System.out.println("Signing Solana message for user: " + userId); + System.out.println(" Address: " + address); + System.out.println(" Message: \"" + message + "\""); + System.out.println(); + + var response = + cdp.endUser() + .signSolanaMessage( + userId, + new SignSolanaMessageWithEndUserAccountRequest() + .message(encodedMessage) + .address(address)); + + System.out.println("Message signed successfully!"); + System.out.println(" Signature: " + response.getSignature()); + } + } +} diff --git a/examples/java/src/main/java/com/coinbase/cdp/examples/enduser/ValidateAccessToken.java b/examples/java/src/main/java/com/coinbase/cdp/examples/enduser/ValidateAccessToken.java new file mode 100644 index 000000000..763e04bbf --- /dev/null +++ b/examples/java/src/main/java/com/coinbase/cdp/examples/enduser/ValidateAccessToken.java @@ -0,0 +1,44 @@ +package com.coinbase.cdp.examples.enduser; + +import com.coinbase.cdp.CdpClient; +import com.coinbase.cdp.examples.utils.EnvLoader; +import com.coinbase.cdp.openapi.model.ValidateEndUserAccessTokenRequest; + +/** + * Example: Validate an end user's access token. + * + *

This example demonstrates how to validate a CDP access token. The token should be provided via + * the {@code CDP_ACCESS_TOKEN} environment variable. + * + *

Usage: ./gradlew runValidateAccessToken + */ +public class ValidateAccessToken { + + public static void main(String[] args) throws Exception { + EnvLoader.load(); + + String accessToken = System.getenv("CDP_ACCESS_TOKEN"); + if (accessToken == null || accessToken.isBlank()) { + System.err.println("Error: CDP_ACCESS_TOKEN environment variable is not set."); + System.err.println("Set it to a valid end user access token and try again."); + System.exit(1); + } + + try (CdpClient cdp = CdpClient.create()) { + System.out.println("Validating access token..."); + + var endUser = + cdp.endUser() + .validateAccessToken( + new ValidateEndUserAccessTokenRequest().accessToken(accessToken)); + + System.out.println("Access token is valid!"); + System.out.println(" User ID: " + endUser.getUserId()); + System.out.println(" EVM accounts: " + endUser.getEvmAccountObjects().size()); + System.out.println( + " EVM smart accounts: " + endUser.getEvmSmartAccountObjects().size()); + System.out.println( + " Solana accounts: " + endUser.getSolanaAccountObjects().size()); + } + } +} diff --git a/examples/python/end_user/create_evm_eip7702_delegation.py b/examples/python/end_user/create_evm_eip7702_delegation.py new file mode 100644 index 000000000..6679b76f2 --- /dev/null +++ b/examples/python/end_user/create_evm_eip7702_delegation.py @@ -0,0 +1,45 @@ +# Usage: uv run python end_user/create_evm_eip7702_delegation.py +# Note: This example requires the end user to have an active delegation on their account +# that allows the developer to sign on their behalf. + +import asyncio +import sys + +from cdp import CdpClient +from dotenv import load_dotenv + +load_dotenv() + + +async def main(): + if len(sys.argv) < 2: + print("Usage: uv run python end_user/create_evm_eip7702_delegation.py ") + sys.exit(1) + + user_id = sys.argv[1] + + async with CdpClient() as cdp: + try: + # Create an EIP-7702 delegation using the client method. + result = await cdp.end_user.create_evm_eip7702_delegation( + user_id=user_id, + network="base-sepolia", + ) + + print("Delegation operation ID (client method):", result.delegation_operation_id) + + # Alternatively, create an EIP-7702 delegation using the account method. + # end_user = await cdp.end_user.get_end_user(user_id=user_id) + + # result = await end_user.create_evm_eip7702_delegation( + # network="base-sepolia", + # ) + + # print("Delegation operation ID (account method):", result.delegation_operation_id) + + except Exception as e: + print(f"Error creating EIP-7702 delegation: {e}") + raise e + + +asyncio.run(main()) diff --git a/examples/python/end_user/get_end_user.py b/examples/python/end_user/get_end_user.py new file mode 100644 index 000000000..b24b28be0 --- /dev/null +++ b/examples/python/end_user/get_end_user.py @@ -0,0 +1,33 @@ +# Usage: uv run python end_user/get_end_user.py + +import asyncio +import sys + +from cdp import CdpClient +from dotenv import load_dotenv + +load_dotenv() + + +async def main(): + if len(sys.argv) < 2: + print("Usage: uv run python end_user/get_end_user.py ") + sys.exit(1) + + user_id = sys.argv[1] + + async with CdpClient() as cdp: + try: + # Get the end user by user ID. + end_user = await cdp.end_user.get_end_user(user_id=user_id) + + print("End user ID:", end_user.user_id) + print("EVM accounts:", end_user.evm_accounts) + print("Solana accounts:", end_user.solana_accounts) + + except Exception as e: + print(f"Error getting end user: {e}") + raise e + + +asyncio.run(main()) diff --git a/examples/python/end_user/revoke_delegation.py b/examples/python/end_user/revoke_delegation.py new file mode 100644 index 000000000..2379c938a --- /dev/null +++ b/examples/python/end_user/revoke_delegation.py @@ -0,0 +1,40 @@ +# Usage: uv run python end_user/revoke_delegation.py +# Note: This example requires the end user to have an active delegation on their account +# that allows the developer to sign on their behalf. + +import asyncio +import sys + +from cdp import CdpClient +from dotenv import load_dotenv + +load_dotenv() + + +async def main(): + if len(sys.argv) < 2: + print("Usage: uv run python end_user/revoke_delegation.py ") + sys.exit(1) + + user_id = sys.argv[1] + + async with CdpClient() as cdp: + try: + # Revoke delegation using the client method. + await cdp.end_user.revoke_delegation(user_id=user_id) + + print("Revoked delegation (client method) for user:", user_id) + + # Alternatively, revoke delegation using the account method. + # end_user = await cdp.end_user.get_end_user(user_id=user_id) + + # await end_user.revoke_delegation() + + # print("Revoked delegation (account method) for user:", user_id) + + except Exception as e: + print(f"Error revoking delegation: {e}") + raise e + + +asyncio.run(main()) diff --git a/examples/python/end_user/send_evm_asset.py b/examples/python/end_user/send_evm_asset.py new file mode 100644 index 000000000..b42afab8b --- /dev/null +++ b/examples/python/end_user/send_evm_asset.py @@ -0,0 +1,60 @@ +# Usage: uv run python end_user/send_evm_asset.py +# Note: This example requires the end user to have an active delegation on their account +# that allows the developer to sign on their behalf. + +import asyncio +import sys + +from cdp import CdpClient +from dotenv import load_dotenv + +load_dotenv() + + +async def main(): + if len(sys.argv) < 2: + print("Usage: uv run python end_user/send_evm_asset.py ") + sys.exit(1) + + user_id = sys.argv[1] + network = "base-sepolia" + to_address = "0x0000000000000000000000000000000000000000" + amount = "1000000" # 1 USDC (6 decimals) + + async with CdpClient() as cdp: + try: + # Get the end user to retrieve their EVM account address. + end_user = await cdp.end_user.get_end_user(user_id=user_id) + address = end_user.evm_accounts[0].address + + # Send USDC using the client method. + result = await cdp.end_user.send_evm_asset( + user_id=user_id, + address=address, + to=to_address, + amount=amount, + network=network, + asset="usdc", + ) + + print("Transaction hash (client method):", result.transaction_hash) + print("User op hash (client method):", result.user_op_hash) + + # Alternatively, send USDC using the account method. + # result = await end_user.send_evm_asset( + # to=to_address, + # amount=amount, + # network=network, + # address=address, + # asset="usdc", + # ) + + # print("Transaction hash (account method):", result.transaction_hash) + # print("User op hash (account method):", result.user_op_hash) + + except Exception as e: + print(f"Error sending EVM asset: {e}") + raise e + + +asyncio.run(main()) diff --git a/examples/python/end_user/send_evm_transaction.py b/examples/python/end_user/send_evm_transaction.py new file mode 100644 index 000000000..614be1510 --- /dev/null +++ b/examples/python/end_user/send_evm_transaction.py @@ -0,0 +1,55 @@ +# Usage: uv run python end_user/send_evm_transaction.py +# Note: This example requires the end user to have an active delegation on their account +# that allows the developer to sign on their behalf. + +import asyncio +import sys + +from cdp import CdpClient +from dotenv import load_dotenv + +load_dotenv() + + +async def main(): + if len(sys.argv) < 2: + print("Usage: uv run python end_user/send_evm_transaction.py ") + sys.exit(1) + + user_id = sys.argv[1] + network = "base-sepolia" + + # Example raw transaction hex (a simple 0 ETH transfer to self). + transaction = "0x02f86c84014a534008082520894000000000000000000000000000000000000000080c0" + + async with CdpClient() as cdp: + try: + # Get the end user to retrieve their EVM account address. + end_user = await cdp.end_user.get_end_user(user_id=user_id) + address = end_user.evm_accounts[0].address + + # Send an EVM transaction using the client method. + result = await cdp.end_user.send_evm_transaction( + user_id=user_id, + address=address, + transaction=transaction, + network=network, + ) + + print("Transaction hash (client method):", result.transaction_hash) + + # Alternatively, send an EVM transaction using the account method. + # result = await end_user.send_evm_transaction( + # transaction=transaction, + # network=network, + # address=address, + # ) + + # print("Transaction hash (account method):", result.transaction_hash) + + except Exception as e: + print(f"Error sending EVM transaction: {e}") + raise e + + +asyncio.run(main()) diff --git a/examples/python/end_user/send_user_operation.py b/examples/python/end_user/send_user_operation.py new file mode 100644 index 000000000..4b071b021 --- /dev/null +++ b/examples/python/end_user/send_user_operation.py @@ -0,0 +1,63 @@ +# Usage: uv run python end_user/send_user_operation.py +# Note: This example requires the end user to have an active delegation on their account +# that allows the developer to sign on their behalf. + +import asyncio +import sys + +from cdp import CdpClient +from dotenv import load_dotenv + +load_dotenv() + + +async def main(): + if len(sys.argv) < 2: + print("Usage: uv run python end_user/send_user_operation.py ") + sys.exit(1) + + user_id = sys.argv[1] + network = "base-sepolia" + + # Example calls for a user operation (a simple 0 ETH transfer). + calls = [ + { + "to": "0x0000000000000000000000000000000000000000", + "value": "0", + "data": "0x", + } + ] + + async with CdpClient() as cdp: + try: + # Get the end user to retrieve their EVM account address. + end_user = await cdp.end_user.get_end_user(user_id=user_id) + address = end_user.evm_accounts[0].address + + # Send a user operation using the client method. + result = await cdp.end_user.send_user_operation( + user_id=user_id, + address=address, + network=network, + calls=calls, + use_cdp_paymaster=True, + ) + + print("User op hash (client method):", result.user_op_hash) + + # Alternatively, send a user operation using the account method. + # result = await end_user.send_user_operation( + # network=network, + # calls=calls, + # address=address, + # use_cdp_paymaster=True, + # ) + + # print("User op hash (account method):", result.user_op_hash) + + except Exception as e: + print(f"Error sending user operation: {e}") + raise e + + +asyncio.run(main()) diff --git a/examples/python/end_user/sign_evm_hash.py b/examples/python/end_user/sign_evm_hash.py new file mode 100644 index 000000000..889812aac --- /dev/null +++ b/examples/python/end_user/sign_evm_hash.py @@ -0,0 +1,50 @@ +# Usage: uv run python end_user/sign_evm_hash.py +# Note: This example requires the end user to have an active delegation on their account +# that allows the developer to sign on their behalf. + +import asyncio +import sys + +from cdp import CdpClient +from dotenv import load_dotenv + +load_dotenv() + + +async def main(): + if len(sys.argv) < 2: + print("Usage: uv run python end_user/sign_evm_hash.py ") + sys.exit(1) + + user_id = sys.argv[1] + hash_to_sign = "0x" + "ab" * 32 + + async with CdpClient() as cdp: + try: + # Get the end user to retrieve their EVM account address. + end_user = await cdp.end_user.get_end_user(user_id=user_id) + address = end_user.evm_accounts[0].address + + # Sign an EVM hash using the client method. + result = await cdp.end_user.sign_evm_hash( + user_id=user_id, + hash=hash_to_sign, + address=address, + ) + + print("Signature (client method):", result.signature) + + # Alternatively, sign an EVM hash using the account method. + # result = await end_user.sign_evm_hash( + # hash=hash_to_sign, + # address=address, + # ) + + # print("Signature (account method):", result.signature) + + except Exception as e: + print(f"Error signing EVM hash: {e}") + raise e + + +asyncio.run(main()) diff --git a/examples/python/end_user/sign_solana_message.py b/examples/python/end_user/sign_solana_message.py new file mode 100644 index 000000000..a27f9470c --- /dev/null +++ b/examples/python/end_user/sign_solana_message.py @@ -0,0 +1,51 @@ +# Usage: uv run python end_user/sign_solana_message.py +# Note: This example requires the end user to have an active delegation on their account +# that allows the developer to sign on their behalf. + +import asyncio +import base64 +import sys + +from cdp import CdpClient +from dotenv import load_dotenv + +load_dotenv() + + +async def main(): + if len(sys.argv) < 2: + print("Usage: uv run python end_user/sign_solana_message.py ") + sys.exit(1) + + user_id = sys.argv[1] + message = base64.b64encode(b"Hello, World!").decode("utf-8") + + async with CdpClient() as cdp: + try: + # Get the end user to retrieve their Solana account address. + end_user = await cdp.end_user.get_end_user(user_id=user_id) + address = end_user.solana_accounts[0].address + + # Sign a Solana message using the client method. + result = await cdp.end_user.sign_solana_message( + user_id=user_id, + address=address, + message=message, + ) + + print("Signature (client method):", result.signature) + + # Alternatively, sign a Solana message using the account method. + # result = await end_user.sign_solana_message( + # message=message, + # address=address, + # ) + + # print("Signature (account method):", result.signature) + + except Exception as e: + print(f"Error signing Solana message: {e}") + raise e + + +asyncio.run(main()) diff --git a/examples/typescript/README.md b/examples/typescript/README.md index d10d10c0a..9d8b285db 100644 --- a/examples/typescript/README.md +++ b/examples/typescript/README.md @@ -16,3 +16,106 @@ To run an example, use `pnpm tsx` followed by the path to the example file, for ```bash pnpm tsx evm/createAccount.ts ``` + +## Available Examples + +### EVM + +| Example | Description | +|---------|-------------| +| `evm/accounts/` | Create, list, and get EVM accounts | +| `evm/transactions/` | Send EVM transactions | +| `evm/smart-accounts/` | Create and manage EVM smart accounts (ERC-4337) | +| `evm/eip7702/` | Create EIP-7702 delegations for EOA accounts | +| `evm/swaps/` | Swap tokens on EVM networks | +| `evm/spend-permissions/` | Create and manage spend permissions | +| `evm/policies/` | Create and manage transaction policies | +| `evm/token-balances/` | List token balances | +| `evm/fund/` | Request testnet faucet funds | +| `evm/account.signTypedData.ts` | Sign EIP-712 typed data | + +### Solana + +| Example | Description | +|---------|-------------| +| `solana/accounts/` | Create and list Solana accounts | +| `solana/transactions/` | Send Solana transactions | +| `solana/tokens/` | List Solana token balances | +| `solana/funding/` | Request testnet SOL from faucet | +| `solana/policies/` | Create and manage Solana policies | + +### End Users + +End-user operations allow you to manage embedded wallet users and perform delegated signing/sending on their behalf. + +> **Important:** Delegated sign and send operations (marked with \*) require the end user to have first created a **delegation** granting the developer permission to sign on their behalf. Without an active delegation, these operations will fail. + +#### User Management + +| Example | Command | +|---------|---------| +| Create end users | `pnpm tsx end-users/createEndUser.ts` | +| Get an end user | `pnpm tsx end-users/getEndUser.ts` | +| List end users | `pnpm tsx end-users/listEndUsers.ts` | +| Import end user with private key | `pnpm tsx end-users/importEndUser.ts` | +| Validate access token | `pnpm tsx end-users/validateAccessToken.ts` | + +#### Account Management + +| Example | Command | +|---------|---------| +| Add EVM EOA account | `pnpm tsx end-users/addEndUserEvmAccount.ts` | +| Add EVM smart account | `pnpm tsx end-users/addEndUserEvmSmartAccount.ts` | +| Add Solana account | `pnpm tsx end-users/addEndUserSolanaAccount.ts` | + +#### Delegation Lifecycle + +| Example | Command | +|---------|---------| +| Create EIP-7702 delegation\* | `pnpm tsx end-users/createEvmEip7702Delegation.ts ` | +| Revoke delegation\* | `pnpm tsx end-users/revokeDelegation.ts ` | + +#### Delegated EVM Operations + +| Example | Command | +|---------|---------| +| Sign EVM hash\* | `pnpm tsx end-users/signEvmHash.ts ` | +| Send EVM transaction\* | `pnpm tsx end-users/sendEvmTransaction.ts ` | +| Send EVM asset (USDC)\* | `pnpm tsx end-users/sendEvmAsset.ts ` | +| Send user operation (smart account)\* | `pnpm tsx end-users/sendUserOperation.ts ` | + +#### Delegated Solana Operations + +| Example | Command | +|---------|---------| +| Sign Solana message\* | `pnpm tsx end-users/signSolanaMessage.ts ` | + +#### Policies + +| Example | Command | +|---------|---------| +| Create end-user policy | `pnpm tsx end-users/createEndUserPolicy.ts` | + +End-user operations support two invocation patterns: + +1. **Client method** -- explicitly provide `userId` and `address`: + ```typescript + const result = await cdp.endUser.signEvmHash({ + userId: endUser.userId, + address: endUser.evmAccountObjects[0].address, + hash: "0x...", + }); + ``` + +2. **Account method** -- called directly on the `EndUserAccount` object, which auto-binds `userId` and defaults `address` to the first account: + ```typescript + const result = await endUser.signEvmHash({ + hash: "0x...", + }); + ``` + +### Quickstart + +| Example | Command | +|---------|---------| +| Full quickstart workflow | `pnpm tsx quickstart/quickstart.ts` | diff --git a/examples/typescript/end-users/createEvmEip7702Delegation.ts b/examples/typescript/end-users/createEvmEip7702Delegation.ts index 6e48aef5a..613e4d874 100644 --- a/examples/typescript/end-users/createEvmEip7702Delegation.ts +++ b/examples/typescript/end-users/createEvmEip7702Delegation.ts @@ -32,15 +32,15 @@ try { ); // 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 - ); + // 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 index 12cf5fc89..69be6775c 100644 --- a/examples/typescript/end-users/revokeDelegation.ts +++ b/examples/typescript/end-users/revokeDelegation.ts @@ -22,9 +22,9 @@ try { console.log("Revoked delegation for end user via client method"); // Alternatively, revoke delegation directly on the EndUserAccount object - await endUser.revokeDelegation(); + // await endUser.revokeDelegation(); - console.log("Revoked delegation for end user via account method"); + // 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 index 34a5d5655..03a643da5 100644 --- a/examples/typescript/end-users/sendEvmAsset.ts +++ b/examples/typescript/end-users/sendEvmAsset.ts @@ -31,14 +31,14 @@ try { 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); + // 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 index 188c6fb80..875e622b3 100644 --- a/examples/typescript/end-users/sendEvmTransaction.ts +++ b/examples/typescript/end-users/sendEvmTransaction.ts @@ -29,12 +29,12 @@ try { 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", - }); + // const result2 = await endUser.sendEvmTransaction({ + // transaction: "0x02...", + // network: "base-sepolia", + // }); - console.log("Transaction hash (via account):", result2.transactionHash); + // 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 index 2dc74f861..ff28f9ce5 100644 --- a/examples/typescript/end-users/sendUserOperation.ts +++ b/examples/typescript/end-users/sendUserOperation.ts @@ -42,19 +42,19 @@ try { 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); + // 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 index b438e7c95..1e4efe6fd 100644 --- a/examples/typescript/end-users/signEvmHash.ts +++ b/examples/typescript/end-users/signEvmHash.ts @@ -28,11 +28,11 @@ try { 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", - }); + // const result2 = await endUser.signEvmHash({ + // hash: "0x0000000000000000000000000000000000000000000000000000000000000002", + // }); - console.log("Signature (via account):", result2.signature); + // 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 index ebffe1020..5ea55f63c 100644 --- a/examples/typescript/end-users/signSolanaMessage.ts +++ b/examples/typescript/end-users/signSolanaMessage.ts @@ -28,11 +28,11 @@ try { 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"), - }); + // const result2 = await endUser.signSolanaMessage({ + // message: Buffer.from("Hello again!").toString("base64"), + // }); - console.log("Signature (via account):", result2.signature); + // 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..a4dd194ab 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 @@ -1119,6 +1164,12 @@ type CommonSwapResponse struct { // CommonSwapResponseLiquidityAvailable Whether sufficient liquidity is available to settle the swap. All other fields in the response will be empty if this is false. type CommonSwapResponseLiquidityAvailable bool +// CreateEvmEip7702Delegation201Response defines model for CreateEvmEip7702Delegation201Response. +type CreateEvmEip7702Delegation201Response struct { + // DelegationOperationId The unique identifier for the delegation operation. Use this to poll the operation status. + DelegationOperationId openapi_types.UUID `json:"delegationOperationId"` +} + // CreateSpendPermissionRequest Request parameters for creating a Spend Permission. type CreateSpendPermissionRequest struct { // Allowance Maximum allowed value to spend, in atomic units for the specified token, within each period. @@ -2197,6 +2248,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,omitempty"` + + // WalletSecretId The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header. + WalletSecretId *string `json:"walletSecretId,omitempty"` } // Rule A rule that limits the behavior of an account. @@ -2256,6 +2313,12 @@ type SendEndUserSolTransactionRuleAction string // SendEndUserSolTransactionRuleOperation The operation to which the rule applies. Every element of the `criteria` array must match the specified operation. type SendEndUserSolTransactionRuleOperation string +// SendEvmTransaction200Response defines model for SendEvmTransaction200Response. +type SendEvmTransaction200Response struct { + // TransactionHash The hash of the transaction, as a 0x-prefixed hex string. + TransactionHash string `json:"transactionHash"` +} + // SendEvmTransactionCriteria A schema for specifying criteria for the SignEvmTransaction operation. type SendEvmTransactionCriteria = []SendEvmTransactionCriteria_Item @@ -2308,6 +2371,12 @@ type SendSolTransactionRuleAction string // SendSolTransactionRuleOperation The operation to which the rule applies. Every element of the `criteria` array must match the specified operation. type SendSolTransactionRuleOperation string +// SendSolanaTransaction200Response defines model for SendSolanaTransaction200Response. +type SendSolanaTransaction200Response struct { + // TransactionSignature The base58 encoded transaction signature. + TransactionSignature string `json:"transactionSignature"` +} + // SendUserOperationCriteria A schema for specifying criteria for the SendUserOperation operation. type SendUserOperationCriteria = []SendUserOperationCriteria_Item @@ -2464,6 +2533,12 @@ type SignEndUserSolTransactionRuleAction string // SignEndUserSolTransactionRuleOperation The operation to which the rule applies. Every element of the `criteria` array must match the specified operation. type SignEndUserSolTransactionRuleOperation string +// SignEvmHash200Response defines model for SignEvmHash200Response. +type SignEvmHash200Response struct { + // Signature The signature of the hash, as a 0x-prefixed hex string. + Signature string `json:"signature"` +} + // SignEvmHashRule defines model for SignEvmHashRule. type SignEvmHashRule struct { // Action Whether any attempts to sign a hash will be accepted or rejected. This rule does not accept any criteria. @@ -2479,6 +2554,12 @@ type SignEvmHashRuleAction string // SignEvmHashRuleOperation The operation to which the rule applies. type SignEvmHashRuleOperation string +// SignEvmMessage200Response defines model for SignEvmMessage200Response. +type SignEvmMessage200Response struct { + // Signature The signature of the message, as a 0x-prefixed hex string. + Signature string `json:"signature"` +} + // SignEvmMessageCriteria A schema for specifying the rejection criteria for the SignEvmMessage operation. type SignEvmMessageCriteria = []SignEvmMessageCriteria_Item @@ -2505,6 +2586,12 @@ type SignEvmMessageRuleAction string // SignEvmMessageRuleOperation The operation to which the rule applies. Every element of the `criteria` array must match the specified operation. type SignEvmMessageRuleOperation string +// SignEvmTransaction200Response defines model for SignEvmTransaction200Response. +type SignEvmTransaction200Response struct { + // SignedTransaction The RLP-encoded signed transaction, as a 0x-prefixed hex string. + SignedTransaction string `json:"signedTransaction"` +} + // SignEvmTransactionCriteria A schema for specifying criteria for the SignEvmTransaction operation. type SignEvmTransactionCriteria = []SignEvmTransactionCriteria_Item @@ -2531,6 +2618,12 @@ type SignEvmTransactionRuleAction string // SignEvmTransactionRuleOperation The operation to which the rule applies. Every element of the `criteria` array must match the specified operation. type SignEvmTransactionRuleOperation string +// SignEvmTypedData200Response defines model for SignEvmTypedData200Response. +type SignEvmTypedData200Response struct { + // Signature The signature of the typed data, as a 0x-prefixed hex string. + Signature string `json:"signature"` +} + // SignEvmTypedDataCriteria A schema for specifying criteria for the SignEvmTypedData operation. type SignEvmTypedDataCriteria = []SignEvmTypedDataCriteria_Item @@ -2659,6 +2752,18 @@ type SignSolTransactionRuleAction string // SignSolTransactionRuleOperation The operation to which the rule applies. Every element of the `criteria` array must match the specified operation. type SignSolTransactionRuleOperation string +// SignSolanaMessage200Response defines model for SignSolanaMessage200Response. +type SignSolanaMessage200Response struct { + // Signature The signature of the message, as a base58 encoded string. + Signature string `json:"signature"` +} + +// SignSolanaTransaction200Response defines model for SignSolanaTransaction200Response. +type SignSolanaTransaction200Response struct { + // SignedTransaction The base64 encoded signed transaction. + SignedTransaction string `json:"signedTransaction"` +} + // SmsAuthentication Information about an end user who authenticates using a one-time password sent to their phone number via SMS. type SmsAuthentication struct { // PhoneNumber The phone number of the end user in E.164 format. @@ -3142,6 +3247,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. @@ -3528,9 +3636,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,49 +3763,47 @@ 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"` +// 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"` } -// ListEndUsersParamsSort defines parameters for ListEndUsers. -type ListEndUsersParamsSort string +// 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 *XWalletAuthOptional `json:"X-Wallet-Auth,omitempty"` -// CreateEndUserJSONBody defines parameters for CreateEndUser. -type CreateEndUserJSONBody struct { - // AuthenticationMethods The list of valid authentication methods linked to the end user. - AuthenticationMethods AuthenticationMethods `json:"authenticationMethods"` + // 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"` - // 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"` + // 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"` +} - // EnableSpendPermissions If true, enables spend permissions for the EVM smart account. - EnableSpendPermissions *bool `json:"enableSpendPermissions,omitempty"` - } `json:"evmAccount,omitempty"` +// CreateEvmEip7702DelegationWithEndUserAccountJSONBody defines parameters for CreateEvmEip7702DelegationWithEndUserAccount. +type CreateEvmEip7702DelegationWithEndUserAccountJSONBody struct { + // Address The 0x-prefixed address of the EVM account to delegate. + Address string `json:"address"` - // 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"` + // 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"` - // 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"` + // Network The network for the EIP-7702 delegation. + Network EvmEip7702DelegationNetwork `json:"network"` + + // 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"` } -// CreateEndUserParams defines parameters for CreateEndUser. -type CreateEndUserParams 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. @@ -3701,31 +3813,30 @@ type CreateEndUserParams 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"` -} -// ValidateEndUserAccessTokenJSONBody defines parameters for ValidateEndUserAccessToken. -type ValidateEndUserAccessTokenJSONBody struct { - // AccessToken The access token in JWT format to verify. - AccessToken string `json:"accessToken"` + // 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"` } -// ImportEndUserJSONBody defines parameters for ImportEndUser. -type ImportEndUserJSONBody struct { - // AuthenticationMethods The list of valid authentication methods linked to the end user. - AuthenticationMethods AuthenticationMethods `json:"authenticationMethods"` +// 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"` - // 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"` + // Network The network to send the transaction to. + Network SendEvmTransactionWithEndUserAccountJSONBodyNetwork `json:"network"` - // KeyType The type of key being imported. Determines what type of account will be associated for the end user. - KeyType ImportEndUserJSONBodyKeyType `json:"keyType"` + // Transaction The RLP-encoded transaction to sign and send, as a 0x-prefixed hex string. + Transaction string `json:"transaction"` - // 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 { +// 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. @@ -3735,16 +3846,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 +// SendEvmTransactionWithEndUserAccountJSONBodyNetwork defines parameters for SendEvmTransactionWithEndUserAccount. +type SendEvmTransactionWithEndUserAccountJSONBodyNetwork string -// AddEndUserEvmAccountJSONBody defines parameters for AddEndUserEvmAccount. -type AddEndUserEvmAccountJSONBody = map[string]interface{} +// 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"` -// AddEndUserEvmAccountParams defines parameters for AddEndUserEvmAccount. -type AddEndUserEvmAccountParams struct { + // 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"` +} + +// 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. @@ -3754,16 +3879,27 @@ 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"` +// 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"` + + // Message The 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"` } -// AddEndUserEvmSmartAccountParams defines parameters for AddEndUserEvmSmartAccount. -type AddEndUserEvmSmartAccountParams 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. @@ -3773,13 +3909,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"` + + // 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"` } -// AddEndUserSolanaAccountJSONBody defines parameters for AddEndUserSolanaAccount. -type AddEndUserSolanaAccountJSONBody = map[string]interface{} +// 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"` -// AddEndUserSolanaAccountParams defines parameters for AddEndUserSolanaAccount. -type AddEndUserSolanaAccountParams struct { + // 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"` +} + +// 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. @@ -3789,30 +3939,27 @@ type AddEndUserSolanaAccountParams 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"` -} - -// 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"` + // 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"` } -// 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"` +// 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"` - // 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"` + // TypedData The message to sign using EIP-712. + TypedData EIP712Message `json:"typedData"` + + // 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 { +// 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. @@ -3822,43 +3969,54 @@ 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"` -} - -// 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"` -} -// ExportEvmAccountByNameParams defines parameters for ExportEvmAccountByName. -type ExportEvmAccountByNameParams 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"` + XDeveloperAuth *XDeveloperAuth `json:"X-Developer-Auth,omitempty"` +} + +// SendUserOperationWithEndUserAccountJSONBody defines parameters for SendUserOperationWithEndUserAccount. +type SendUserOperationWithEndUserAccountJSONBody 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. 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"` +} + +// 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"` -} - -// 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"` - // 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"` + // 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"` - // 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"` + // 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"` } -// ImportEvmAccountParams defines parameters for ImportEvmAccount. -type ImportEvmAccountParams 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. @@ -3870,36 +4028,29 @@ type ImportEvmAccountParams struct { XIdempotencyKey *IdempotencyKey `json:"X-Idempotency-Key,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"` +// 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"` - // 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"` -} + // Network The EVM network to send USDC on. + Network SendEvmAssetWithEndUserAccountJSONBodyNetwork `json:"network"` -// 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"` -} + // 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"` -// 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"` + // To The 0x-prefixed address of the recipient. + To BlockchainAddress `json:"to"` - // Network The network for the EIP-7702 delegation. - Network EvmEip7702DelegationNetwork `json:"network"` + // 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"` } -// CreateEvmEip7702DelegationParams defines parameters for CreateEvmEip7702Delegation. -type CreateEvmEip7702DelegationParams 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. @@ -3909,38 +4060,36 @@ type CreateEvmEip7702DelegationParams 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"` } -// 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"` +// SendEvmAssetWithEndUserAccountJSONBodyNetwork defines parameters for SendEvmAssetWithEndUserAccount. +type SendEvmAssetWithEndUserAccountJSONBodyNetwork string - // 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"` -} +// 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"` -// SendEvmTransactionJSONBody defines parameters for SendEvmTransaction. -type SendEvmTransactionJSONBody struct { - // Network The network to send the transaction to. - Network SendEvmTransactionJSONBodyNetwork `json:"network"` + // Network The Solana network to send the transaction to. + Network SendSolanaTransactionWithEndUserAccountJSONBodyNetwork `json:"network"` - // Transaction The RLP-encoded transaction to sign and send, as a 0x-prefixed hex string. + // 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"` } -// SendEvmTransactionParams defines parameters for SendEvmTransaction. -type SendEvmTransactionParams struct { +// 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. @@ -3950,19 +4099,30 @@ 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 +// SendSolanaTransactionWithEndUserAccountJSONBodyNetwork defines parameters for SendSolanaTransactionWithEndUserAccount. +type SendSolanaTransactionWithEndUserAccountJSONBodyNetwork string -// SignEvmHashJSONBody defines parameters for SignEvmHash. -type SignEvmHashJSONBody struct { - // Hash The arbitrary 32 byte hash to sign. +// 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 +4132,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 +4162,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 +4192,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 +4231,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 +4329,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,292 +4348,295 @@ 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"` +// 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"` - // FromToken The 0x-prefixed contract address of the token to send. - FromToken string `json:"fromToken"` + // PageToken The token for the next page of resources, if any. + PageToken *PageToken `form:"pageToken,omitempty" json:"pageToken,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"` - - // 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"` +// 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"` - // ClientIp The IP address of the end user requesting the onramp transaction. - ClientIp *string `json:"clientIp,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"` +} - // DestinationAddress The address the purchased crypto will be sent to. - DestinationAddress BlockchainAddress `json:"destinationAddress"` +// 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"` - // 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"` + // 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"` +} - // 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"` +// 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"` +} - // 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"` +// 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"` - // IsQuote If true, this API will return a quote without creating any transaction. - IsQuote *bool `json:"isQuote,omitempty"` + // Network The network for the EIP-7702 delegation. + Network EvmEip7702DelegationNetwork `json:"network"` +} - // PartnerOrderRef Optional partner order reference ID. - PartnerOrderRef *string `json:"partnerOrderRef,omitempty"` +// 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"` - // 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"` + // 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"` +} - // 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"` +// 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"` +} - // PaymentCurrency The fiat currency to be converted to crypto. - PaymentCurrency string `json:"paymentCurrency"` +// 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"` - // PaymentMethod The type of payment method to be used to complete an onramp order. - PaymentMethod OnrampOrderPaymentMethodTypeId `json:"paymentMethod"` + // 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"` +} - // 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"` +// SendEvmTransactionJSONBody defines parameters for SendEvmTransaction. +type SendEvmTransactionJSONBody struct { + // Network The network to send the transaction to. + Network SendEvmTransactionJSONBodyNetwork `json:"network"` - // 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"` + // Transaction The RLP-encoded transaction to sign and send, as a 0x-prefixed hex string. + Transaction string `json:"transaction"` +} - // 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"` +// 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"` - // 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"` +// SendEvmTransactionJSONBodyNetwork defines parameters for SendEvmTransaction. +type SendEvmTransactionJSONBodyNetwork string - // Country The ISO 3166-1 two letter country code (e.g. US). - Country *string `json:"country,omitempty"` +// SignEvmHashJSONBody defines parameters for SignEvmHash. +type SignEvmHashJSONBody struct { + // Hash The arbitrary 32 byte hash to sign. + Hash string `json:"hash"` +} - // DestinationAddress The address the purchased crypto will be sent to. - DestinationAddress BlockchainAddress `json:"destinationAddress"` +// 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. + XWalletAuth *XWalletAuth `json:"X-Wallet-Auth,omitempty"` - // 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"` + // 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"` +} - // 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"` +// SignEvmMessageJSONBody defines parameters for SignEvmMessage. +type SignEvmMessageJSONBody struct { + // Message The message to sign. + Message string `json:"message"` +} - // 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"` +// 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. + XWalletAuth *XWalletAuth `json:"X-Wallet-Auth,omitempty"` - // PaymentCurrency The fiat currency to be converted to crypto. - PaymentCurrency *string `json:"paymentCurrency,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"` +} - // 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"` - - // Subdivision The ISO 3166-2 two letter state code (e.g. NY). Only required for US. - Subdivision *string `json:"subdivision,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"` +// 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"` } -// 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"` - - // Scope The scope of the policy. - Scope CreatePolicyJSONBodyScope `json:"scope"` -} +// 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. + XWalletAuth *XWalletAuth `json:"X-Wallet-Auth,omitempty"` -// 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"` } -// CreatePolicyJSONBodyScope defines parameters for CreatePolicy. -type CreatePolicyJSONBodyScope string +// 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. + 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"` +// 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"` - // Rules A list of rules that comprise the policy. There is a limit of 10 rules per policy. - Rules []Rule `json:"rules"` -} + // Network The network to request funds from. + Network RequestEvmFaucetJSONBodyNetwork `json:"network"` -// 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"` + // Token The token to request funds for. + Token RequestEvmFaucetJSONBodyToken `json:"token"` } -// ListSolanaAccountsParams defines parameters for ListSolanaAccounts. -type ListSolanaAccountsParams struct { +// RequestEvmFaucetJSONBodyNetwork defines parameters for RequestEvmFaucet. +type RequestEvmFaucetJSONBodyNetwork string + +// 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"` @@ -4407,38 +4644,35 @@ type ListSolanaAccountsParams struct { 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"` - +// 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 Solana accounts in the developer's CDP Project. + // Account names must be unique across all EVM accounts in the developer's CDP Project. Name *string `json:"name,omitempty"` -} -// 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"` + // 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"` } -// 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"` +// 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"` } -// ExportSolanaAccountByNameParams defines parameters for ExportSolanaAccountByName. -type ExportSolanaAccountByNameParams 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. @@ -4450,19 +4684,17 @@ 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"` +// 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"` - // 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"` + // 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"` } -// ImportSolanaAccountParams defines parameters for ImportSolanaAccount. -type ImportSolanaAccountParams 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. @@ -4474,698 +4706,777 @@ 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"` +// PrepareUserOperationJSONBody defines parameters for PrepareUserOperation. +type PrepareUserOperationJSONBody struct { + // Calls The list of calls to make from the Smart Account. + Calls []EvmCall `json:"calls"` - // Transaction The base64 encoded transaction to sign and send. This transaction can contain multiple instructions for native Solana batching. - Transaction string `json:"transaction"` -} + // DataSuffix The EIP-8021 data suffix (hex-encoded) that enables transaction attribution for the user operation. + DataSuffix *string `json:"dataSuffix,omitempty"` -// 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"` + // Network The network the user operation is for. + Network EvmUserOperationNetwork `json:"network"` - // 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"` + // PaymasterUrl The URL of the paymaster to use for the user operation. + PaymasterUrl *Url `json:"paymasterUrl,omitempty"` } -// SendSolanaTransactionJSONBodyNetwork defines parameters for SendSolanaTransaction. -type SendSolanaTransactionJSONBodyNetwork string +// PrepareAndSendUserOperationJSONBody defines parameters for PrepareAndSendUserOperation. +type PrepareAndSendUserOperationJSONBody struct { + // Calls The list of calls to make from the Smart Account. + Calls []EvmCall `json:"calls"` -// 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 the user operation is for. + Network EvmUserOperationNetwork `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"` + // PaymasterUrl The URL of the paymaster to use for the user operation. + PaymasterUrl *Url `json:"paymasterUrl,omitempty"` } -// UpdateSolanaAccountParams defines parameters for UpdateSolanaAccount. -type UpdateSolanaAccountParams struct { +// 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"` -} - -// 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"` -} -// 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"` } -// SignSolanaMessageJSONBody defines parameters for SignSolanaMessage. -type SignSolanaMessageJSONBody struct { - // Message The arbitrary message to sign. - Message string `json:"message"` +// 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"` } -// 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"` +// 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"` + + // 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"` + + // 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"` + + // ToToken The 0x-prefixed contract address of the token to receive. + ToToken string `json:"toToken"` +} +// 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"` } -// SignSolanaTransactionJSONBody defines parameters for SignSolanaTransaction. -type SignSolanaTransactionJSONBody struct { - // Transaction The base64 encoded transaction to sign. - Transaction string `json:"transaction"` +// 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"` } -// 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"` +// 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"` - // 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"` + // PageToken The token for the next page of resources, if any. + PageToken *PageToken `form:"pageToken,omitempty" json:"pageToken,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"` +// 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"` - // Token The token to request funds for. - Token RequestSolanaFaucetJSONBodyToken `json:"token"` + // UserId The user identifier value. For `phone_number` type, this must be in E.164 format. + UserId string `json:"userId"` + + // UserIdType The type of user identifier: + // - `phone_number`: A phone number in E.164 format associated with an onramp user. + UserIdType OnrampUserIdType `json:"userIdType"` } -// RequestSolanaFaucetJSONBodyToken defines parameters for RequestSolanaFaucet. -type RequestSolanaFaucetJSONBodyToken string +// 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"` -// 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"` + // ClientIp The IP address of the end user requesting the onramp transaction. + ClientIp *string `json:"clientIp,omitempty"` - // 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"` -} + // DestinationAddress The address the purchased crypto will be sent to. + DestinationAddress BlockchainAddress `json:"destinationAddress"` -// 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"` + // 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"` - // PaymentRequirements The x402 protocol payment requirements that the resource server expects the client's payment payload to meet. - PaymentRequirements X402PaymentRequirements `json:"paymentRequirements"` + // 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"` - // X402Version The version of the x402 protocol. - X402Version X402Version `json:"x402Version"` -} + // 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"` -// 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"` + // IsQuote If true, this API will return a quote without creating any transaction. + IsQuote *bool `json:"isQuote,omitempty"` - // PaymentRequirements The x402 protocol payment requirements that the resource server expects the client's payment payload to meet. - PaymentRequirements X402PaymentRequirements `json:"paymentRequirements"` + // PartnerOrderRef Optional partner order reference ID. + PartnerOrderRef *string `json:"partnerOrderRef,omitempty"` - // X402Version The version of the x402 protocol. - X402Version X402Version `json:"x402Version"` -} + // 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"` -// RunSQLQueryJSONRequestBody defines body for RunSQLQuery for application/json ContentType. -type RunSQLQueryJSONRequestBody = OnchainDataQuery + // 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"` -// CreateWebhookSubscriptionJSONRequestBody defines body for CreateWebhookSubscription for application/json ContentType. -type CreateWebhookSubscriptionJSONRequestBody = WebhookSubscriptionRequest + // PaymentCurrency The fiat currency to be converted to crypto. + PaymentCurrency string `json:"paymentCurrency"` -// UpdateWebhookSubscriptionJSONRequestBody defines body for UpdateWebhookSubscription for application/json ContentType. -type UpdateWebhookSubscriptionJSONRequestBody = WebhookSubscriptionUpdateRequest + // PaymentMethod The type of payment method to be used to complete an onramp order. + PaymentMethod OnrampOrderPaymentMethodTypeId `json:"paymentMethod"` -// CreateEndUserJSONRequestBody defines body for CreateEndUser for application/json ContentType. -type CreateEndUserJSONRequestBody CreateEndUserJSONBody + // 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"` -// ValidateEndUserAccessTokenJSONRequestBody defines body for ValidateEndUserAccessToken for application/json ContentType. -type ValidateEndUserAccessTokenJSONRequestBody ValidateEndUserAccessTokenJSONBody + // 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"` -// ImportEndUserJSONRequestBody defines body for ImportEndUser for application/json ContentType. -type ImportEndUserJSONRequestBody ImportEndUserJSONBody + // 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"` -// AddEndUserEvmAccountJSONRequestBody defines body for AddEndUserEvmAccount for application/json ContentType. -type AddEndUserEvmAccountJSONRequestBody = AddEndUserEvmAccountJSONBody + // 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"` +} -// AddEndUserEvmSmartAccountJSONRequestBody defines body for AddEndUserEvmSmartAccount for application/json ContentType. -type AddEndUserEvmSmartAccountJSONRequestBody AddEndUserEvmSmartAccountJSONBody +// 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"` -// AddEndUserSolanaAccountJSONRequestBody defines body for AddEndUserSolanaAccount for application/json ContentType. -type AddEndUserSolanaAccountJSONRequestBody = AddEndUserSolanaAccountJSONBody + // Country The ISO 3166-1 two letter country code (e.g. US). + Country *string `json:"country,omitempty"` -// CreateEvmAccountJSONRequestBody defines body for CreateEvmAccount for application/json ContentType. -type CreateEvmAccountJSONRequestBody CreateEvmAccountJSONBody + // DestinationAddress The address the purchased crypto will be sent to. + DestinationAddress BlockchainAddress `json:"destinationAddress"` -// ExportEvmAccountByNameJSONRequestBody defines body for ExportEvmAccountByName for application/json ContentType. -type ExportEvmAccountByNameJSONRequestBody ExportEvmAccountByNameJSONBody + // 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"` -// ImportEvmAccountJSONRequestBody defines body for ImportEvmAccount for application/json ContentType. -type ImportEvmAccountJSONRequestBody ImportEvmAccountJSONBody + // 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"` -// UpdateEvmAccountJSONRequestBody defines body for UpdateEvmAccount for application/json ContentType. -type UpdateEvmAccountJSONRequestBody UpdateEvmAccountJSONBody + // 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"` -// CreateEvmEip7702DelegationJSONRequestBody defines body for CreateEvmEip7702Delegation for application/json ContentType. -type CreateEvmEip7702DelegationJSONRequestBody CreateEvmEip7702DelegationJSONBody + // PaymentCurrency The fiat currency to be converted to crypto. + PaymentCurrency *string `json:"paymentCurrency,omitempty"` -// ExportEvmAccountJSONRequestBody defines body for ExportEvmAccount for application/json ContentType. -type ExportEvmAccountJSONRequestBody ExportEvmAccountJSONBody + // PaymentMethod The type of payment method used to generate the onramp quote. + PaymentMethod *OnrampQuotePaymentMethodTypeId `json:"paymentMethod,omitempty"` -// SendEvmTransactionJSONRequestBody defines body for SendEvmTransaction for application/json ContentType. -type SendEvmTransactionJSONRequestBody SendEvmTransactionJSONBody + // 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"` -// SignEvmHashJSONRequestBody defines body for SignEvmHash for application/json ContentType. -type SignEvmHashJSONRequestBody SignEvmHashJSONBody + // 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"` -// SignEvmMessageJSONRequestBody defines body for SignEvmMessage for application/json ContentType. -type SignEvmMessageJSONRequestBody SignEvmMessageJSONBody + // 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"` -// SignEvmTransactionJSONRequestBody defines body for SignEvmTransaction for application/json ContentType. -type SignEvmTransactionJSONRequestBody SignEvmTransactionJSONBody + // Subdivision The ISO 3166-2 two letter state code (e.g. NY). Only required for US. + Subdivision *string `json:"subdivision,omitempty"` +} -// SignEvmTypedDataJSONRequestBody defines body for SignEvmTypedData for application/json ContentType. -type SignEvmTypedDataJSONRequestBody = EIP712Message +// 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"` -// RequestEvmFaucetJSONRequestBody defines body for RequestEvmFaucet for application/json ContentType. -type RequestEvmFaucetJSONRequestBody RequestEvmFaucetJSONBody + // PageToken The token for the next page of resources, if any. + PageToken *PageToken `form:"pageToken,omitempty" json:"pageToken,omitempty"` -// CreateEvmSmartAccountJSONRequestBody defines body for CreateEvmSmartAccount for application/json ContentType. -type CreateEvmSmartAccountJSONRequestBody CreateEvmSmartAccountJSONBody + // 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"` +} -// UpdateEvmSmartAccountJSONRequestBody defines body for UpdateEvmSmartAccount for application/json ContentType. -type UpdateEvmSmartAccountJSONRequestBody UpdateEvmSmartAccountJSONBody +// ListPoliciesParamsScope defines parameters for ListPolicies. +type ListPoliciesParamsScope string -// CreateSpendPermissionJSONRequestBody defines body for CreateSpendPermission for application/json ContentType. -type CreateSpendPermissionJSONRequestBody = CreateSpendPermissionRequest +// 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"` -// RevokeSpendPermissionJSONRequestBody defines body for RevokeSpendPermission for application/json ContentType. -type RevokeSpendPermissionJSONRequestBody = RevokeSpendPermissionRequest + // Rules A list of rules that comprise the policy. There is a limit of 10 rules per policy. + Rules []Rule `json:"rules"` -// PrepareUserOperationJSONRequestBody defines body for PrepareUserOperation for application/json ContentType. -type PrepareUserOperationJSONRequestBody PrepareUserOperationJSONBody + // Scope The scope of the policy. + Scope CreatePolicyJSONBodyScope `json:"scope"` +} -// PrepareAndSendUserOperationJSONRequestBody defines body for PrepareAndSendUserOperation for application/json ContentType. -type PrepareAndSendUserOperationJSONRequestBody PrepareAndSendUserOperationJSONBody +// 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"` +} -// SendUserOperationJSONRequestBody defines body for SendUserOperation for application/json ContentType. -type SendUserOperationJSONRequestBody SendUserOperationJSONBody +// CreatePolicyJSONBodyScope defines parameters for CreatePolicy. +type CreatePolicyJSONBodyScope string -// CreateEvmSwapQuoteJSONRequestBody defines body for CreateEvmSwapQuote for application/json ContentType. -type CreateEvmSwapQuoteJSONRequestBody CreateEvmSwapQuoteJSONBody +// 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"` +} -// GetOnrampUserLimitsJSONRequestBody defines body for GetOnrampUserLimits for application/json ContentType. -type GetOnrampUserLimitsJSONRequestBody GetOnrampUserLimitsJSONBody +// 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"` -// CreateOnrampOrderJSONRequestBody defines body for CreateOnrampOrder for application/json ContentType. -type CreateOnrampOrderJSONRequestBody CreateOnrampOrderJSONBody + // Rules A list of rules that comprise the policy. There is a limit of 10 rules per policy. + Rules []Rule `json:"rules"` +} -// CreateOnrampSessionJSONRequestBody defines body for CreateOnrampSession for application/json ContentType. -type CreateOnrampSessionJSONRequestBody CreateOnrampSessionJSONBody - -// CreatePolicyJSONRequestBody defines body for CreatePolicy for application/json ContentType. -type CreatePolicyJSONRequestBody CreatePolicyJSONBody +// 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"` +} -// UpdatePolicyJSONRequestBody defines body for UpdatePolicy for application/json ContentType. -type UpdatePolicyJSONRequestBody UpdatePolicyJSONBody +// 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"` -// CreateSolanaAccountJSONRequestBody defines body for CreateSolanaAccount for application/json ContentType. -type CreateSolanaAccountJSONRequestBody CreateSolanaAccountJSONBody + // PageToken The token for the next page of resources, if any. + PageToken *PageToken `form:"pageToken,omitempty" json:"pageToken,omitempty"` +} -// ExportSolanaAccountByNameJSONRequestBody defines body for ExportSolanaAccountByName for application/json ContentType. -type ExportSolanaAccountByNameJSONRequestBody ExportSolanaAccountByNameJSONBody +// 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"` -// ImportSolanaAccountJSONRequestBody defines body for ImportSolanaAccount for application/json ContentType. -type ImportSolanaAccountJSONRequestBody ImportSolanaAccountJSONBody + // 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"` +} -// SendSolanaTransactionJSONRequestBody defines body for SendSolanaTransaction for application/json ContentType. -type SendSolanaTransactionJSONRequestBody SendSolanaTransactionJSONBody +// 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"` -// UpdateSolanaAccountJSONRequestBody defines body for UpdateSolanaAccount for application/json ContentType. -type UpdateSolanaAccountJSONRequestBody UpdateSolanaAccountJSONBody + // 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"` +} -// ExportSolanaAccountJSONRequestBody defines body for ExportSolanaAccount for application/json ContentType. -type ExportSolanaAccountJSONRequestBody ExportSolanaAccountJSONBody +// 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"` +} -// SignSolanaMessageJSONRequestBody defines body for SignSolanaMessage for application/json ContentType. -type SignSolanaMessageJSONRequestBody SignSolanaMessageJSONBody +// 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"` -// SignSolanaTransactionJSONRequestBody defines body for SignSolanaTransaction for application/json ContentType. -type SignSolanaTransactionJSONRequestBody SignSolanaTransactionJSONBody + // 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"` +} -// RequestSolanaFaucetJSONRequestBody defines body for RequestSolanaFaucet for application/json ContentType. -type RequestSolanaFaucetJSONRequestBody RequestSolanaFaucetJSONBody +// 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"` -// SettleX402PaymentJSONRequestBody defines body for SettleX402Payment for application/json ContentType. -type SettleX402PaymentJSONRequestBody SettleX402PaymentJSONBody + // 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"` +} -// VerifyX402PaymentJSONRequestBody defines body for VerifyX402Payment for application/json ContentType. -type VerifyX402PaymentJSONRequestBody VerifyX402PaymentJSONBody +// 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"` -// 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 + // 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"` } -// 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 -} +// SendSolanaTransactionJSONBody defines parameters for SendSolanaTransaction. +type SendSolanaTransactionJSONBody struct { + // Network The Solana network to send the transaction to. + Network SendSolanaTransactionJSONBodyNetwork `json:"network"` -// 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 - } + // Transaction The base64 encoded transaction to sign and send. This transaction can contain multiple instructions for native Solana batching. + Transaction string `json:"transaction"` +} - 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") - } +// 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"` - 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 + // 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"` } -// 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) +// SendSolanaTransactionJSONBodyNetwork defines parameters for SendSolanaTransaction. +type SendSolanaTransactionJSONBodyNetwork string - if a.Secret != nil { - object["secret"], err = json.Marshal(a.Secret) - if err != nil { - return nil, fmt.Errorf("error marshaling 'secret': %w", 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"` - 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) + // 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"` } -// 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 +// 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"` } -// 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 +// 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"` } -// 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 - } - - merged, err := runtime.JsonMerge(t.union, b) - t.union = merged - return 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"` -// 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 + // 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"` } -// 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 +// SignSolanaMessageJSONBody defines parameters for SignSolanaMessage. +type SignSolanaMessageJSONBody struct { + // Message The arbitrary message to sign. + Message string `json:"message"` } -// 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 - } +// 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"` } -func (t Abi_Item) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err +// SignSolanaTransactionJSONBody defines parameters for SignSolanaTransaction. +type SignSolanaTransactionJSONBody struct { + // Transaction The base64 encoded transaction to sign. + Transaction string `json:"transaction"` } -func (t *Abi_Item) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(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"` -// 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 +// 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"` } -// 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 - } +// RequestSolanaFaucetJSONBodyToken defines parameters for RequestSolanaFaucet. +type RequestSolanaFaucetJSONBodyToken string - merged, err := runtime.JsonMerge(t.union, b) - t.union = merged - 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"` -// 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 + // 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"` } -// 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 -} +// 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"` -// 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 - } + // 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"` } -// 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 -} +// 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"` -// 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 + // 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"` } -// 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 - } +// 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 -// 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 -} +// UpdateWebhookSubscriptionJSONRequestBody defines body for UpdateWebhookSubscription for application/json ContentType. +type UpdateWebhookSubscriptionJSONRequestBody = WebhookSubscriptionUpdateRequest -// 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 -} +// RevokeDelegationForEndUserJSONRequestBody defines body for RevokeDelegationForEndUser for application/json ContentType. +type RevokeDelegationForEndUserJSONRequestBody RevokeDelegationForEndUserJSONBody -// 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 - } +// CreateEvmEip7702DelegationWithEndUserAccountJSONRequestBody defines body for CreateEvmEip7702DelegationWithEndUserAccount for application/json ContentType. +type CreateEvmEip7702DelegationWithEndUserAccountJSONRequestBody CreateEvmEip7702DelegationWithEndUserAccountJSONBody - merged, err := runtime.JsonMerge(t.union, b) - t.union = merged - return err -} +// SendEvmTransactionWithEndUserAccountJSONRequestBody defines body for SendEvmTransactionWithEndUserAccount for application/json ContentType. +type SendEvmTransactionWithEndUserAccountJSONRequestBody SendEvmTransactionWithEndUserAccountJSONBody -// 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 -} +// SignEvmHashWithEndUserAccountJSONRequestBody defines body for SignEvmHashWithEndUserAccount for application/json ContentType. +type SignEvmHashWithEndUserAccountJSONRequestBody SignEvmHashWithEndUserAccountJSONBody -// 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 -} +// SignEvmMessageWithEndUserAccountJSONRequestBody defines body for SignEvmMessageWithEndUserAccount for application/json ContentType. +type SignEvmMessageWithEndUserAccountJSONRequestBody SignEvmMessageWithEndUserAccountJSONBody -// 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 - } +// SignEvmTransactionWithEndUserAccountJSONRequestBody defines body for SignEvmTransactionWithEndUserAccount for application/json ContentType. +type SignEvmTransactionWithEndUserAccountJSONRequestBody SignEvmTransactionWithEndUserAccountJSONBody - merged, err := runtime.JsonMerge(t.union, b) - t.union = merged - return err -} +// SignEvmTypedDataWithEndUserAccountJSONRequestBody defines body for SignEvmTypedDataWithEndUserAccount for application/json ContentType. +type SignEvmTypedDataWithEndUserAccountJSONRequestBody SignEvmTypedDataWithEndUserAccountJSONBody -func (t AuthenticationMethod) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} +// SendUserOperationWithEndUserAccountJSONRequestBody defines body for SendUserOperationWithEndUserAccount for application/json ContentType. +type SendUserOperationWithEndUserAccountJSONRequestBody SendUserOperationWithEndUserAccountJSONBody -func (t *AuthenticationMethod) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} +// RevokeSpendPermissionWithEndUserAccountJSONRequestBody defines body for RevokeSpendPermissionWithEndUserAccount for application/json ContentType. +type RevokeSpendPermissionWithEndUserAccountJSONRequestBody = RevokeSpendPermissionRequest -// 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 -} +// SendEvmAssetWithEndUserAccountJSONRequestBody defines body for SendEvmAssetWithEndUserAccount for application/json ContentType. +type SendEvmAssetWithEndUserAccountJSONRequestBody SendEvmAssetWithEndUserAccountJSONBody -// 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 -} +// SendSolanaTransactionWithEndUserAccountJSONRequestBody defines body for SendSolanaTransactionWithEndUserAccount for application/json ContentType. +type SendSolanaTransactionWithEndUserAccountJSONRequestBody SendSolanaTransactionWithEndUserAccountJSONBody -// 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 - } +// SignSolanaHashWithEndUserAccountJSONRequestBody defines body for SignSolanaHashWithEndUserAccount for application/json ContentType. +type SignSolanaHashWithEndUserAccountJSONRequestBody SignSolanaHashWithEndUserAccountJSONBody - merged, err := runtime.JsonMerge(t.union, b) - t.union = merged - return err -} +// SignSolanaMessageWithEndUserAccountJSONRequestBody defines body for SignSolanaMessageWithEndUserAccount for application/json ContentType. +type SignSolanaMessageWithEndUserAccountJSONRequestBody SignSolanaMessageWithEndUserAccountJSONBody -// 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 -} +// SignSolanaTransactionWithEndUserAccountJSONRequestBody defines body for SignSolanaTransactionWithEndUserAccount for application/json ContentType. +type SignSolanaTransactionWithEndUserAccountJSONRequestBody SignSolanaTransactionWithEndUserAccountJSONBody -// 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 -} +// SendSolanaAssetWithEndUserAccountJSONRequestBody defines body for SendSolanaAssetWithEndUserAccount for application/json ContentType. +type SendSolanaAssetWithEndUserAccountJSONRequestBody SendSolanaAssetWithEndUserAccountJSONBody -// 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 - } +// CreateEndUserJSONRequestBody defines body for CreateEndUser for application/json ContentType. +type CreateEndUserJSONRequestBody CreateEndUserJSONBody - merged, err := runtime.JsonMerge(t.union, b) - t.union = merged - return err -} +// ValidateEndUserAccessTokenJSONRequestBody defines body for ValidateEndUserAccessToken for application/json ContentType. +type ValidateEndUserAccessTokenJSONRequestBody ValidateEndUserAccessTokenJSONBody -func (t CreateSwapQuoteResponseWrapper) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} +// ImportEndUserJSONRequestBody defines body for ImportEndUser for application/json ContentType. +type ImportEndUserJSONRequestBody ImportEndUserJSONBody -func (t *CreateSwapQuoteResponseWrapper) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} +// AddEndUserEvmAccountJSONRequestBody defines body for AddEndUserEvmAccount for application/json ContentType. +type AddEndUserEvmAccountJSONRequestBody = AddEndUserEvmAccountJSONBody -// 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 -} +// AddEndUserEvmSmartAccountJSONRequestBody defines body for AddEndUserEvmSmartAccount for application/json ContentType. +type AddEndUserEvmSmartAccountJSONRequestBody AddEndUserEvmSmartAccountJSONBody -// 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 -} +// AddEndUserSolanaAccountJSONRequestBody defines body for AddEndUserSolanaAccount for application/json ContentType. +type AddEndUserSolanaAccountJSONRequestBody = AddEndUserSolanaAccountJSONBody -// 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 - } +// CreateEvmAccountJSONRequestBody defines body for CreateEvmAccount for application/json ContentType. +type CreateEvmAccountJSONRequestBody CreateEvmAccountJSONBody - merged, err := runtime.JsonMerge(t.union, b) - t.union = merged - return err -} +// ExportEvmAccountByNameJSONRequestBody defines body for ExportEvmAccountByName for application/json ContentType. +type ExportEvmAccountByNameJSONRequestBody ExportEvmAccountByNameJSONBody -// 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 +// 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 = RevokeSpendPermissionRequest + +// 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 } -// 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 +// 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 } -// 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) +// 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 EvmDataCondition_Params_Item) 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 *EvmDataCondition_Params_Item) 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) } -// AsKnownAbiType returns the union data inside the EvmDataCriterion_Abi as a KnownAbiType -func (t EvmDataCriterion_Abi) AsKnownAbiType() (KnownAbiType, error) { - var body KnownAbiType +// 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 } -// FromKnownAbiType overwrites any union data inside the EvmDataCriterion_Abi as the provided KnownAbiType -func (t *EvmDataCriterion_Abi) FromKnownAbiType(v KnownAbiType) 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 } -// MergeKnownAbiType performs a merge with any union data inside the EvmDataCriterion_Abi, using the provided KnownAbiType -func (t *EvmDataCriterion_Abi) MergeKnownAbiType(v KnownAbiType) 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 @@ -5176,22 +5487,22 @@ func (t *EvmDataCriterion_Abi) MergeKnownAbiType(v KnownAbiType) error { return err } -// AsAbi returns the union data inside the EvmDataCriterion_Abi as a Abi -func (t EvmDataCriterion_Abi) AsAbi() (Abi, error) { - var body Abi +// 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 } -// FromAbi overwrites any union data inside the EvmDataCriterion_Abi as the provided Abi -func (t *EvmDataCriterion_Abi) FromAbi(v Abi) 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 } -// MergeAbi performs a merge with any union data inside the EvmDataCriterion_Abi, using the provided Abi -func (t *EvmDataCriterion_Abi) MergeAbi(v Abi) 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 @@ -5202,32 +5513,32 @@ func (t *EvmDataCriterion_Abi) MergeAbi(v Abi) error { return err } -func (t EvmDataCriterion_Abi) MarshalJSON() ([]byte, error) { +func (t Abi_Item) MarshalJSON() ([]byte, error) { b, err := t.union.MarshalJSON() return b, err } -func (t *EvmDataCriterion_Abi) UnmarshalJSON(b []byte) error { +func (t *Abi_Item) 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 +// 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 } -// FromGetSwapPriceResponse overwrites any union data inside the GetSwapPriceResponseWrapper as the provided GetSwapPriceResponse -func (t *GetSwapPriceResponseWrapper) FromGetSwapPriceResponse(v GetSwapPriceResponse) 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 } -// MergeGetSwapPriceResponse performs a merge with any union data inside the GetSwapPriceResponseWrapper, using the provided GetSwapPriceResponse -func (t *GetSwapPriceResponseWrapper) MergeGetSwapPriceResponse(v GetSwapPriceResponse) 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 @@ -5238,22 +5549,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 +// 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 } -// FromSwapUnavailableResponse overwrites any union data inside the GetSwapPriceResponseWrapper as the provided SwapUnavailableResponse -func (t *GetSwapPriceResponseWrapper) FromSwapUnavailableResponse(v SwapUnavailableResponse) 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 } -// MergeSwapUnavailableResponse performs a merge with any union data inside the GetSwapPriceResponseWrapper, using the provided SwapUnavailableResponse -func (t *GetSwapPriceResponseWrapper) MergeSwapUnavailableResponse(v SwapUnavailableResponse) error { +// 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 @@ -5264,32 +5575,22 @@ func (t *GetSwapPriceResponseWrapper) MergeSwapUnavailableResponse(v SwapUnavail return err } -func (t GetSwapPriceResponseWrapper) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err +// 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 } -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 -} - -// FromEthValueCriterion overwrites any union data inside the PrepareUserOperationCriteria_Item as the provided EthValueCriterion -func (t *PrepareUserOperationCriteria_Item) FromEthValueCriterion(v EthValueCriterion) 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 } -// MergeEthValueCriterion performs a merge with any union data inside the PrepareUserOperationCriteria_Item, using the provided EthValueCriterion -func (t *PrepareUserOperationCriteria_Item) MergeEthValueCriterion(v EthValueCriterion) 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 @@ -5300,22 +5601,22 @@ 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 +// 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 } -// FromEvmAddressCriterion overwrites any union data inside the PrepareUserOperationCriteria_Item as the provided EvmAddressCriterion -func (t *PrepareUserOperationCriteria_Item) FromEvmAddressCriterion(v EvmAddressCriterion) 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 } -// MergeEvmAddressCriterion performs a merge with any union data inside the PrepareUserOperationCriteria_Item, using the provided EvmAddressCriterion -func (t *PrepareUserOperationCriteria_Item) MergeEvmAddressCriterion(v EvmAddressCriterion) 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 @@ -5326,22 +5627,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 +// 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 } -// FromEvmNetworkCriterion overwrites any union data inside the PrepareUserOperationCriteria_Item as the provided EvmNetworkCriterion -func (t *PrepareUserOperationCriteria_Item) FromEvmNetworkCriterion(v EvmNetworkCriterion) 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 } -// MergeEvmNetworkCriterion performs a merge with any union data inside the PrepareUserOperationCriteria_Item, using the provided EvmNetworkCriterion -func (t *PrepareUserOperationCriteria_Item) MergeEvmNetworkCriterion(v EvmNetworkCriterion) 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 @@ -5352,22 +5653,32 @@ 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 +func (t AuthenticationMethod) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *AuthenticationMethod) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// 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 } -// FromEvmDataCriterion overwrites any union data inside the PrepareUserOperationCriteria_Item as the provided EvmDataCriterion -func (t *PrepareUserOperationCriteria_Item) FromEvmDataCriterion(v EvmDataCriterion) 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 } -// MergeEvmDataCriterion performs a merge with any union data inside the PrepareUserOperationCriteria_Item, using the provided EvmDataCriterion -func (t *PrepareUserOperationCriteria_Item) MergeEvmDataCriterion(v EvmDataCriterion) 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 @@ -5378,22 +5689,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 +// 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 } -// FromNetUSDChangeCriterion overwrites any union data inside the PrepareUserOperationCriteria_Item as the provided NetUSDChangeCriterion -func (t *PrepareUserOperationCriteria_Item) FromNetUSDChangeCriterion(v NetUSDChangeCriterion) 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 } -// MergeNetUSDChangeCriterion performs a merge with any union data inside the PrepareUserOperationCriteria_Item, using the provided NetUSDChangeCriterion -func (t *PrepareUserOperationCriteria_Item) MergeNetUSDChangeCriterion(v NetUSDChangeCriterion) 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 @@ -5404,32 +5715,32 @@ func (t *PrepareUserOperationCriteria_Item) MergeNetUSDChangeCriterion(v NetUSDC return err } -func (t PrepareUserOperationCriteria_Item) MarshalJSON() ([]byte, error) { +func (t CreateSwapQuoteResponseWrapper) MarshalJSON() ([]byte, error) { b, err := t.union.MarshalJSON() return b, err } -func (t *PrepareUserOperationCriteria_Item) UnmarshalJSON(b []byte) error { +func (t *CreateSwapQuoteResponseWrapper) 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 +// 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 } -// FromSignEvmTransactionRule overwrites any union data inside the Rule as the provided SignEvmTransactionRule -func (t *Rule) FromSignEvmTransactionRule(v SignEvmTransactionRule) 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 } -// MergeSignEvmTransactionRule performs a merge with any union data inside the Rule, using the provided SignEvmTransactionRule -func (t *Rule) MergeSignEvmTransactionRule(v SignEvmTransactionRule) 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 @@ -5440,22 +5751,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 +// 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 } -// FromSendEvmTransactionRule overwrites any union data inside the Rule as the provided SendEvmTransactionRule -func (t *Rule) FromSendEvmTransactionRule(v SendEvmTransactionRule) 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 } -// MergeSendEvmTransactionRule performs a merge with any union data inside the Rule, using the provided SendEvmTransactionRule -func (t *Rule) MergeSendEvmTransactionRule(v SendEvmTransactionRule) 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 @@ -5466,22 +5777,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 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 } -// FromSignEvmMessageRule overwrites any union data inside the Rule as the provided SignEvmMessageRule -func (t *Rule) FromSignEvmMessageRule(v SignEvmMessageRule) 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 } -// MergeSignEvmMessageRule performs a merge with any union data inside the Rule, using the provided SignEvmMessageRule -func (t *Rule) MergeSignEvmMessageRule(v SignEvmMessageRule) 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 @@ -5492,22 +5813,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 +// 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 } -// FromSignEvmTypedDataRule overwrites any union data inside the Rule as the provided SignEvmTypedDataRule -func (t *Rule) FromSignEvmTypedDataRule(v SignEvmTypedDataRule) 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 } -// MergeSignEvmTypedDataRule performs a merge with any union data inside the Rule, using the provided SignEvmTypedDataRule -func (t *Rule) MergeSignEvmTypedDataRule(v SignEvmTypedDataRule) 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 @@ -5518,22 +5839,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 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 } -// FromSignSolTransactionRule overwrites any union data inside the Rule as the provided SignSolTransactionRule -func (t *Rule) FromSignSolTransactionRule(v SignSolTransactionRule) 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 } -// MergeSignSolTransactionRule performs a merge with any union data inside the Rule, using the provided SignSolTransactionRule -func (t *Rule) MergeSignSolTransactionRule(v SignSolTransactionRule) 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 @@ -5544,22 +5875,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 +// 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 } -// FromSendSolTransactionRule overwrites any union data inside the Rule as the provided SendSolTransactionRule -func (t *Rule) FromSendSolTransactionRule(v SendSolTransactionRule) 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 } -// MergeSendSolTransactionRule performs a merge with any union data inside the Rule, using the provided SendSolTransactionRule -func (t *Rule) MergeSendSolTransactionRule(v SendSolTransactionRule) 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 @@ -5570,22 +5901,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 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 } -// FromSignSolMessageRule overwrites any union data inside the Rule as the provided SignSolMessageRule -func (t *Rule) FromSignSolMessageRule(v SignSolMessageRule) 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 } -// MergeSignSolMessageRule performs a merge with any union data inside the Rule, using the provided SignSolMessageRule -func (t *Rule) MergeSignSolMessageRule(v SignSolMessageRule) 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 @@ -5596,22 +5937,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 +// 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 } -// FromSignEvmHashRule overwrites any union data inside the Rule as the provided SignEvmHashRule -func (t *Rule) FromSignEvmHashRule(v SignEvmHashRule) 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 } -// MergeSignEvmHashRule performs a merge with any union data inside the Rule, using the provided SignEvmHashRule -func (t *Rule) MergeSignEvmHashRule(v SignEvmHashRule) 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 @@ -5622,22 +5963,22 @@ 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 +// 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 } -// FromPrepareUserOperationRule overwrites any union data inside the Rule as the provided PrepareUserOperationRule -func (t *Rule) FromPrepareUserOperationRule(v PrepareUserOperationRule) 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 } -// MergePrepareUserOperationRule performs a merge with any union data inside the Rule, using the provided PrepareUserOperationRule -func (t *Rule) MergePrepareUserOperationRule(v PrepareUserOperationRule) 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 @@ -5648,22 +5989,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 +// 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 } -// FromSendUserOperationRule overwrites any union data inside the Rule as the provided SendUserOperationRule -func (t *Rule) FromSendUserOperationRule(v SendUserOperationRule) 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 } -// MergeSendUserOperationRule performs a merge with any union data inside the Rule, using the provided SendUserOperationRule -func (t *Rule) MergeSendUserOperationRule(v SendUserOperationRule) error { +// 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 @@ -5674,22 +6015,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 +// 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 } -// FromSignEndUserEvmTransactionRule overwrites any union data inside the Rule as the provided SignEndUserEvmTransactionRule -func (t *Rule) FromSignEndUserEvmTransactionRule(v SignEndUserEvmTransactionRule) 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 } -// MergeSignEndUserEvmTransactionRule performs a merge with any union data inside the Rule, using the provided SignEndUserEvmTransactionRule -func (t *Rule) MergeSignEndUserEvmTransactionRule(v SignEndUserEvmTransactionRule) 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 @@ -5700,22 +6041,32 @@ 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 +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 } -// FromSendEndUserEvmTransactionRule overwrites any union data inside the Rule as the provided SendEndUserEvmTransactionRule -func (t *Rule) FromSendEndUserEvmTransactionRule(v SendEndUserEvmTransactionRule) 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 } -// MergeSendEndUserEvmTransactionRule performs a merge with any union data inside the Rule, using the provided SendEndUserEvmTransactionRule -func (t *Rule) MergeSendEndUserEvmTransactionRule(v SendEndUserEvmTransactionRule) 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 @@ -5726,22 +6077,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 +// 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 } -// FromSignEndUserEvmMessageRule overwrites any union data inside the Rule as the provided SignEndUserEvmMessageRule -func (t *Rule) FromSignEndUserEvmMessageRule(v SignEndUserEvmMessageRule) 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 } -// MergeSignEndUserEvmMessageRule performs a merge with any union data inside the Rule, using the provided SignEndUserEvmMessageRule -func (t *Rule) MergeSignEndUserEvmMessageRule(v SignEndUserEvmMessageRule) 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 @@ -5752,22 +6103,22 @@ 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 +// 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 } -// FromSignEndUserEvmTypedDataRule overwrites any union data inside the Rule as the provided SignEndUserEvmTypedDataRule -func (t *Rule) FromSignEndUserEvmTypedDataRule(v SignEndUserEvmTypedDataRule) 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 } -// MergeSignEndUserEvmTypedDataRule performs a merge with any union data inside the Rule, using the provided SignEndUserEvmTypedDataRule -func (t *Rule) MergeSignEndUserEvmTypedDataRule(v SignEndUserEvmTypedDataRule) 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 @@ -5778,22 +6129,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 +// 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 } -// FromSignEndUserSolTransactionRule overwrites any union data inside the Rule as the provided SignEndUserSolTransactionRule -func (t *Rule) FromSignEndUserSolTransactionRule(v SignEndUserSolTransactionRule) 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 } -// MergeSignEndUserSolTransactionRule performs a merge with any union data inside the Rule, using the provided SignEndUserSolTransactionRule -func (t *Rule) MergeSignEndUserSolTransactionRule(v SignEndUserSolTransactionRule) 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 @@ -5804,22 +6155,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 +// 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 } -// FromSendEndUserSolTransactionRule overwrites any union data inside the Rule as the provided SendEndUserSolTransactionRule -func (t *Rule) FromSendEndUserSolTransactionRule(v SendEndUserSolTransactionRule) 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 } -// MergeSendEndUserSolTransactionRule performs a merge with any union data inside the Rule, using the provided SendEndUserSolTransactionRule -func (t *Rule) MergeSendEndUserSolTransactionRule(v SendEndUserSolTransactionRule) 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 @@ -5830,22 +6181,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 +// 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 } -// FromSignEndUserSolMessageRule overwrites any union data inside the Rule as the provided SignEndUserSolMessageRule -func (t *Rule) FromSignEndUserSolMessageRule(v SignEndUserSolMessageRule) 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 } -// MergeSignEndUserSolMessageRule performs a merge with any union data inside the Rule, using the provided SignEndUserSolMessageRule -func (t *Rule) MergeSignEndUserSolMessageRule(v SignEndUserSolMessageRule) 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 @@ -5856,32 +6207,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 +// 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 } -// FromEthValueCriterion overwrites any union data inside the SendEndUserEvmTransactionCriteria_Item as the provided EthValueCriterion -func (t *SendEndUserEvmTransactionCriteria_Item) FromEthValueCriterion(v EthValueCriterion) 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 } -// MergeEthValueCriterion performs a merge with any union data inside the SendEndUserEvmTransactionCriteria_Item, using the provided EthValueCriterion -func (t *SendEndUserEvmTransactionCriteria_Item) MergeEthValueCriterion(v EthValueCriterion) 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 @@ -5892,22 +6233,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 +// 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 } -// FromEvmAddressCriterion overwrites any union data inside the SendEndUserEvmTransactionCriteria_Item as the provided EvmAddressCriterion -func (t *SendEndUserEvmTransactionCriteria_Item) FromEvmAddressCriterion(v EvmAddressCriterion) 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 } -// MergeEvmAddressCriterion performs a merge with any union data inside the SendEndUserEvmTransactionCriteria_Item, using the provided EvmAddressCriterion -func (t *SendEndUserEvmTransactionCriteria_Item) MergeEvmAddressCriterion(v EvmAddressCriterion) 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 @@ -5918,22 +6259,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 +// 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 } -// FromEvmNetworkCriterion overwrites any union data inside the SendEndUserEvmTransactionCriteria_Item as the provided EvmNetworkCriterion -func (t *SendEndUserEvmTransactionCriteria_Item) FromEvmNetworkCriterion(v EvmNetworkCriterion) 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 } -// MergeEvmNetworkCriterion performs a merge with any union data inside the SendEndUserEvmTransactionCriteria_Item, using the provided EvmNetworkCriterion -func (t *SendEndUserEvmTransactionCriteria_Item) MergeEvmNetworkCriterion(v EvmNetworkCriterion) 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 @@ -5944,22 +6285,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 +// 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 } -// FromEvmDataCriterion overwrites any union data inside the SendEndUserEvmTransactionCriteria_Item as the provided EvmDataCriterion -func (t *SendEndUserEvmTransactionCriteria_Item) FromEvmDataCriterion(v EvmDataCriterion) 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 } -// MergeEvmDataCriterion performs a merge with any union data inside the SendEndUserEvmTransactionCriteria_Item, using the provided EvmDataCriterion -func (t *SendEndUserEvmTransactionCriteria_Item) MergeEvmDataCriterion(v EvmDataCriterion) 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 @@ -5970,22 +6311,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 +// 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 } -// FromNetUSDChangeCriterion overwrites any union data inside the SendEndUserEvmTransactionCriteria_Item as the provided NetUSDChangeCriterion -func (t *SendEndUserEvmTransactionCriteria_Item) FromNetUSDChangeCriterion(v NetUSDChangeCriterion) 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 } -// MergeNetUSDChangeCriterion performs a merge with any union data inside the SendEndUserEvmTransactionCriteria_Item, using the provided NetUSDChangeCriterion -func (t *SendEndUserEvmTransactionCriteria_Item) MergeNetUSDChangeCriterion(v NetUSDChangeCriterion) 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 @@ -5996,32 +6337,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 +// 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 } -// FromSolAddressCriterion overwrites any union data inside the SendEndUserSolTransactionCriteria_Item as the provided SolAddressCriterion -func (t *SendEndUserSolTransactionCriteria_Item) FromSolAddressCriterion(v SolAddressCriterion) 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 } -// MergeSolAddressCriterion performs a merge with any union data inside the SendEndUserSolTransactionCriteria_Item, using the provided SolAddressCriterion -func (t *SendEndUserSolTransactionCriteria_Item) MergeSolAddressCriterion(v SolAddressCriterion) 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 @@ -6032,22 +6363,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 +// 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 } -// FromSolValueCriterion overwrites any union data inside the SendEndUserSolTransactionCriteria_Item as the provided SolValueCriterion -func (t *SendEndUserSolTransactionCriteria_Item) FromSolValueCriterion(v SolValueCriterion) 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 } -// MergeSolValueCriterion performs a merge with any union data inside the SendEndUserSolTransactionCriteria_Item, using the provided SolValueCriterion -func (t *SendEndUserSolTransactionCriteria_Item) MergeSolValueCriterion(v SolValueCriterion) 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 @@ -6058,22 +6389,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 +// 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 } -// FromSplAddressCriterion overwrites any union data inside the SendEndUserSolTransactionCriteria_Item as the provided SplAddressCriterion -func (t *SendEndUserSolTransactionCriteria_Item) FromSplAddressCriterion(v SplAddressCriterion) 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 } -// MergeSplAddressCriterion performs a merge with any union data inside the SendEndUserSolTransactionCriteria_Item, using the provided SplAddressCriterion -func (t *SendEndUserSolTransactionCriteria_Item) MergeSplAddressCriterion(v SplAddressCriterion) 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 @@ -6084,22 +6415,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 +// 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 } -// FromSplValueCriterion overwrites any union data inside the SendEndUserSolTransactionCriteria_Item as the provided SplValueCriterion -func (t *SendEndUserSolTransactionCriteria_Item) FromSplValueCriterion(v SplValueCriterion) 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 } -// MergeSplValueCriterion performs a merge with any union data inside the SendEndUserSolTransactionCriteria_Item, using the provided SplValueCriterion -func (t *SendEndUserSolTransactionCriteria_Item) MergeSplValueCriterion(v SplValueCriterion) error { +// 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 @@ -6110,74 +6441,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 - 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 { - 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 { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JsonMerge(t.union, b) - t.union = merged - return err -} - -// 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 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 SendEndUserSolTransactionCriteria_Item, using the provided SolDataCriterion -func (t *SendEndUserSolTransactionCriteria_Item) MergeSolDataCriterion(v SolDataCriterion) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JsonMerge(t.union, b) - t.union = merged - 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 +6467,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 +6493,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 +6529,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 +6555,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 +6581,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 +6607,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 +6633,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 +6669,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 +6695,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 +6721,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 +6747,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 +6773,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 +6799,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 +6825,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 +6851,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 +6887,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 +6913,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 +6939,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 +6965,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 +6991,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 +7027,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 +7053,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 +7079,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 +7105,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 +7131,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 +7157,48 @@ func (t *SignEndUserEvmTypedDataCriteria_Item) MergeSignEvmTypedDataVerifyingCon return err } -func (t SignEndUserEvmTypedDataCriteria_Item) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err +// 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 } -func (t *SignEndUserEvmTypedDataCriteria_Item) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) +// 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 } -// AsSolMessageCriterion returns the union data inside the SignEndUserSolMessageCriteria_Item as a SolMessageCriterion -func (t SignEndUserSolMessageCriteria_Item) AsSolMessageCriterion() (SolMessageCriterion, error) { - var body SolMessageCriterion +// 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 + } + + merged, err := runtime.JsonMerge(t.union, b) + t.union = merged + return err +} + +// 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 } -// FromSolMessageCriterion overwrites any union data inside the SignEndUserSolMessageCriteria_Item as the provided SolMessageCriterion -func (t *SignEndUserSolMessageCriteria_Item) FromSolMessageCriterion(v SolMessageCriterion) 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 } -// MergeSolMessageCriterion performs a merge with any union data inside the SignEndUserSolMessageCriteria_Item, using the provided SolMessageCriterion -func (t *SignEndUserSolMessageCriteria_Item) MergeSolMessageCriterion(v SolMessageCriterion) 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 @@ -6934,32 +7209,32 @@ func (t *SignEndUserSolMessageCriteria_Item) MergeSolMessageCriterion(v SolMessa return err } -func (t SignEndUserSolMessageCriteria_Item) MarshalJSON() ([]byte, error) { +func (t SendSolTransactionCriteria_Item) MarshalJSON() ([]byte, error) { b, err := t.union.MarshalJSON() return b, err } -func (t *SignEndUserSolMessageCriteria_Item) UnmarshalJSON(b []byte) error { +func (t *SendSolTransactionCriteria_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 +// 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 } -// FromSolAddressCriterion overwrites any union data inside the SignEndUserSolTransactionCriteria_Item as the provided SolAddressCriterion -func (t *SignEndUserSolTransactionCriteria_Item) FromSolAddressCriterion(v SolAddressCriterion) 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 } -// MergeSolAddressCriterion performs a merge with any union data inside the SignEndUserSolTransactionCriteria_Item, using the provided SolAddressCriterion -func (t *SignEndUserSolTransactionCriteria_Item) MergeSolAddressCriterion(v SolAddressCriterion) 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 @@ -6970,22 +7245,22 @@ 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 +// 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 } -// FromSolValueCriterion overwrites any union data inside the SignEndUserSolTransactionCriteria_Item as the provided SolValueCriterion -func (t *SignEndUserSolTransactionCriteria_Item) FromSolValueCriterion(v SolValueCriterion) 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 } -// MergeSolValueCriterion performs a merge with any union data inside the SignEndUserSolTransactionCriteria_Item, using the provided SolValueCriterion -func (t *SignEndUserSolTransactionCriteria_Item) MergeSolValueCriterion(v SolValueCriterion) 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 @@ -6996,22 +7271,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 +// 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 } -// FromSplAddressCriterion overwrites any union data inside the SignEndUserSolTransactionCriteria_Item as the provided SplAddressCriterion -func (t *SignEndUserSolTransactionCriteria_Item) FromSplAddressCriterion(v SplAddressCriterion) 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 } -// MergeSplAddressCriterion performs a merge with any union data inside the SignEndUserSolTransactionCriteria_Item, using the provided SplAddressCriterion -func (t *SignEndUserSolTransactionCriteria_Item) MergeSplAddressCriterion(v SplAddressCriterion) 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 @@ -7022,22 +7297,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 - err := json.Unmarshal(t.union, &body) +// 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 } -// FromSplValueCriterion overwrites any union data inside the SignEndUserSolTransactionCriteria_Item as the provided SplValueCriterion -func (t *SignEndUserSolTransactionCriteria_Item) FromSplValueCriterion(v SplValueCriterion) 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 } -// MergeSplValueCriterion performs a merge with any union data inside the SignEndUserSolTransactionCriteria_Item, using the provided SplValueCriterion -func (t *SignEndUserSolTransactionCriteria_Item) MergeSplValueCriterion(v SplValueCriterion) 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 @@ -7048,22 +7323,32 @@ 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 +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 } -// FromMintAddressCriterion overwrites any union data inside the SignEndUserSolTransactionCriteria_Item as the provided MintAddressCriterion -func (t *SignEndUserSolTransactionCriteria_Item) FromMintAddressCriterion(v MintAddressCriterion) 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 } -// MergeMintAddressCriterion performs a merge with any union data inside the SignEndUserSolTransactionCriteria_Item, using the provided MintAddressCriterion -func (t *SignEndUserSolTransactionCriteria_Item) MergeMintAddressCriterion(v MintAddressCriterion) 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 @@ -7074,22 +7359,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 SignEndUserEvmMessageCriteria_Item) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *SignEndUserEvmMessageCriteria_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 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 { +// 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 } -// MergeSolDataCriterion performs a merge with any union data inside the SignEndUserSolTransactionCriteria_Item, using the provided SolDataCriterion -func (t *SignEndUserSolTransactionCriteria_Item) MergeSolDataCriterion(v SolDataCriterion) 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 @@ -7100,22 +7395,22 @@ 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 +// 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 } -// FromProgramIdCriterion overwrites any union data inside the SignEndUserSolTransactionCriteria_Item as the provided ProgramIdCriterion -func (t *SignEndUserSolTransactionCriteria_Item) FromProgramIdCriterion(v ProgramIdCriterion) 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 } -// MergeProgramIdCriterion performs a merge with any union data inside the SignEndUserSolTransactionCriteria_Item, using the provided ProgramIdCriterion -func (t *SignEndUserSolTransactionCriteria_Item) MergeProgramIdCriterion(v ProgramIdCriterion) 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 @@ -7126,32 +7421,22 @@ func (t *SignEndUserSolTransactionCriteria_Item) MergeProgramIdCriterion(v Progr 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 +// 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 } -// FromEvmMessageCriterion overwrites any union data inside the SignEvmMessageCriteria_Item as the provided EvmMessageCriterion -func (t *SignEvmMessageCriteria_Item) FromEvmMessageCriterion(v EvmMessageCriterion) 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 } -// MergeEvmMessageCriterion performs a merge with any union data inside the SignEvmMessageCriteria_Item, using the provided EvmMessageCriterion -func (t *SignEvmMessageCriteria_Item) MergeEvmMessageCriterion(v EvmMessageCriterion) 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 @@ -7162,32 +7447,22 @@ func (t *SignEvmMessageCriteria_Item) MergeEvmMessageCriterion(v EvmMessageCrite return err } -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 +// 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 } -// FromEthValueCriterion overwrites any union data inside the SignEvmTransactionCriteria_Item as the provided EthValueCriterion -func (t *SignEvmTransactionCriteria_Item) FromEthValueCriterion(v EthValueCriterion) 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 } -// MergeEthValueCriterion performs a merge with any union data inside the SignEvmTransactionCriteria_Item, using the provided EthValueCriterion -func (t *SignEvmTransactionCriteria_Item) MergeEthValueCriterion(v EthValueCriterion) 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 @@ -7198,22 +7473,32 @@ 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) { - var body EvmAddressCriterion +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 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 { +// 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 } -// MergeEvmAddressCriterion performs a merge with any union data inside the SignEvmTransactionCriteria_Item, using the provided EvmAddressCriterion -func (t *SignEvmTransactionCriteria_Item) MergeEvmAddressCriterion(v EvmAddressCriterion) 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 @@ -7224,22 +7509,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) { - var body EvmDataCriterion +// 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 } -// FromEvmDataCriterion overwrites any union data inside the SignEvmTransactionCriteria_Item as the provided EvmDataCriterion -func (t *SignEvmTransactionCriteria_Item) FromEvmDataCriterion(v EvmDataCriterion) 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 } -// MergeEvmDataCriterion performs a merge with any union data inside the SignEvmTransactionCriteria_Item, using the provided EvmDataCriterion -func (t *SignEvmTransactionCriteria_Item) MergeEvmDataCriterion(v EvmDataCriterion) 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 @@ -7250,22 +7535,32 @@ 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) { - var body NetUSDChangeCriterion +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 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 { +// 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 } -// MergeNetUSDChangeCriterion performs a merge with any union data inside the SignEvmTransactionCriteria_Item, using the provided NetUSDChangeCriterion -func (t *SignEvmTransactionCriteria_Item) MergeNetUSDChangeCriterion(v NetUSDChangeCriterion) 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 @@ -7276,32 +7571,32 @@ func (t *SignEvmTransactionCriteria_Item) MergeNetUSDChangeCriterion(v NetUSDCha return err } -func (t SignEvmTransactionCriteria_Item) MarshalJSON() ([]byte, error) { +func (t SignEndUserSolMessageCriteria_Item) MarshalJSON() ([]byte, error) { b, err := t.union.MarshalJSON() return b, err } -func (t *SignEvmTransactionCriteria_Item) UnmarshalJSON(b []byte) error { +func (t *SignEndUserSolMessageCriteria_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) { - var body SignEvmTypedDataFieldCriterion +// 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 } -// FromSignEvmTypedDataFieldCriterion overwrites any union data inside the SignEvmTypedDataCriteria_Item as the provided SignEvmTypedDataFieldCriterion -func (t *SignEvmTypedDataCriteria_Item) FromSignEvmTypedDataFieldCriterion(v SignEvmTypedDataFieldCriterion) 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 } -// MergeSignEvmTypedDataFieldCriterion performs a merge with any union data inside the SignEvmTypedDataCriteria_Item, using the provided SignEvmTypedDataFieldCriterion -func (t *SignEvmTypedDataCriteria_Item) MergeSignEvmTypedDataFieldCriterion(v SignEvmTypedDataFieldCriterion) 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 @@ -7312,22 +7607,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) { - var body SignEvmTypedDataVerifyingContractCriterion +// 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 } -// FromSignEvmTypedDataVerifyingContractCriterion overwrites any union data inside the SignEvmTypedDataCriteria_Item as the provided SignEvmTypedDataVerifyingContractCriterion -func (t *SignEvmTypedDataCriteria_Item) FromSignEvmTypedDataVerifyingContractCriterion(v SignEvmTypedDataVerifyingContractCriterion) 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 } -// MergeSignEvmTypedDataVerifyingContractCriterion performs a merge with any union data inside the SignEvmTypedDataCriteria_Item, using the provided SignEvmTypedDataVerifyingContractCriterion -func (t *SignEvmTypedDataCriteria_Item) MergeSignEvmTypedDataVerifyingContractCriterion(v SignEvmTypedDataVerifyingContractCriterion) 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 @@ -7338,32 +7633,22 @@ func (t *SignEvmTypedDataCriteria_Item) MergeSignEvmTypedDataVerifyingContractCr return err } -func (t SignEvmTypedDataCriteria_Item) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *SignEvmTypedDataCriteria_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 +// 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 } -// FromEvmTypedAddressCondition overwrites any union data inside the SignEvmTypedDataFieldCriterion_Conditions_Item as the provided EvmTypedAddressCondition -func (t *SignEvmTypedDataFieldCriterion_Conditions_Item) FromEvmTypedAddressCondition(v EvmTypedAddressCondition) 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 } -// 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 { +// 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 @@ -7374,22 +7659,22 @@ 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 +// 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 } -// FromEvmTypedNumericalCondition overwrites any union data inside the SignEvmTypedDataFieldCriterion_Conditions_Item as the provided EvmTypedNumericalCondition -func (t *SignEvmTypedDataFieldCriterion_Conditions_Item) FromEvmTypedNumericalCondition(v EvmTypedNumericalCondition) 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 } -// 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 { +// 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 @@ -7400,22 +7685,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 +// 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 } -// FromEvmTypedStringCondition overwrites any union data inside the SignEvmTypedDataFieldCriterion_Conditions_Item as the provided EvmTypedStringCondition -func (t *SignEvmTypedDataFieldCriterion_Conditions_Item) FromEvmTypedStringCondition(v EvmTypedStringCondition) 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 } -// 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 { +// 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 @@ -7426,32 +7711,48 @@ func (t *SignEvmTypedDataFieldCriterion_Conditions_Item) MergeEvmTypedStringCond return err } -func (t SignEvmTypedDataFieldCriterion_Conditions_Item) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err +// 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 } -func (t *SignEvmTypedDataFieldCriterion_Conditions_Item) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) +// 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 } -// AsSolMessageCriterion returns the union data inside the SignSolMessageCriteria_Item as a SolMessageCriterion -func (t SignSolMessageCriteria_Item) AsSolMessageCriterion() (SolMessageCriterion, error) { - var body SolMessageCriterion +// 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 + } + + merged, err := runtime.JsonMerge(t.union, b) + t.union = merged + 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 } -// FromSolMessageCriterion overwrites any union data inside the SignSolMessageCriteria_Item as the provided SolMessageCriterion -func (t *SignSolMessageCriteria_Item) FromSolMessageCriterion(v SolMessageCriterion) 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 } -// MergeSolMessageCriterion performs a merge with any union data inside the SignSolMessageCriteria_Item, using the provided SolMessageCriterion -func (t *SignSolMessageCriteria_Item) MergeSolMessageCriterion(v SolMessageCriterion) 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 @@ -7462,32 +7763,32 @@ func (t *SignSolMessageCriteria_Item) MergeSolMessageCriterion(v SolMessageCrite return err } -func (t SignSolMessageCriteria_Item) MarshalJSON() ([]byte, error) { +func (t SignEndUserSolTransactionCriteria_Item) MarshalJSON() ([]byte, error) { b, err := t.union.MarshalJSON() return b, err } -func (t *SignSolMessageCriteria_Item) UnmarshalJSON(b []byte) error { +func (t *SignEndUserSolTransactionCriteria_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 +// 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 } -// FromSolAddressCriterion overwrites any union data inside the SignSolTransactionCriteria_Item as the provided SolAddressCriterion -func (t *SignSolTransactionCriteria_Item) FromSolAddressCriterion(v SolAddressCriterion) 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 } -// MergeSolAddressCriterion performs a merge with any union data inside the SignSolTransactionCriteria_Item, using the provided SolAddressCriterion -func (t *SignSolTransactionCriteria_Item) MergeSolAddressCriterion(v SolAddressCriterion) 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 @@ -7498,22 +7799,32 @@ 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 +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 } -// FromSolValueCriterion overwrites any union data inside the SignSolTransactionCriteria_Item as the provided SolValueCriterion -func (t *SignSolTransactionCriteria_Item) FromSolValueCriterion(v SolValueCriterion) 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 } -// MergeSolValueCriterion performs a merge with any union data inside the SignSolTransactionCriteria_Item, using the provided SolValueCriterion -func (t *SignSolTransactionCriteria_Item) MergeSolValueCriterion(v SolValueCriterion) 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 @@ -7524,22 +7835,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 +// 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 } -// FromSplAddressCriterion overwrites any union data inside the SignSolTransactionCriteria_Item as the provided SplAddressCriterion -func (t *SignSolTransactionCriteria_Item) FromSplAddressCriterion(v SplAddressCriterion) 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 } -// MergeSplAddressCriterion performs a merge with any union data inside the SignSolTransactionCriteria_Item, using the provided SplAddressCriterion -func (t *SignSolTransactionCriteria_Item) MergeSplAddressCriterion(v SplAddressCriterion) 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 @@ -7550,22 +7861,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 +// 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 } -// FromSplValueCriterion overwrites any union data inside the SignSolTransactionCriteria_Item as the provided SplValueCriterion -func (t *SignSolTransactionCriteria_Item) FromSplValueCriterion(v SplValueCriterion) 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 } -// MergeSplValueCriterion performs a merge with any union data inside the SignSolTransactionCriteria_Item, using the provided SplValueCriterion -func (t *SignSolTransactionCriteria_Item) MergeSplValueCriterion(v SplValueCriterion) 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 @@ -7576,22 +7887,22 @@ 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 +// 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 } -// FromMintAddressCriterion overwrites any union data inside the SignSolTransactionCriteria_Item as the provided MintAddressCriterion -func (t *SignSolTransactionCriteria_Item) FromMintAddressCriterion(v MintAddressCriterion) 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 } -// MergeMintAddressCriterion performs a merge with any union data inside the SignSolTransactionCriteria_Item, using the provided MintAddressCriterion -func (t *SignSolTransactionCriteria_Item) MergeMintAddressCriterion(v MintAddressCriterion) 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 @@ -7602,22 +7913,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 SignEvmTransactionCriteria_Item) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *SignEvmTransactionCriteria_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) { + var body SignEvmTypedDataFieldCriterion 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 { +// 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 } -// MergeSolDataCriterion performs a merge with any union data inside the SignSolTransactionCriteria_Item, using the provided SolDataCriterion -func (t *SignSolTransactionCriteria_Item) MergeSolDataCriterion(v SolDataCriterion) 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 @@ -7628,22 +7949,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 +// 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 } -// FromProgramIdCriterion overwrites any union data inside the SignSolTransactionCriteria_Item as the provided ProgramIdCriterion -func (t *SignSolTransactionCriteria_Item) FromProgramIdCriterion(v ProgramIdCriterion) 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 } -// MergeProgramIdCriterion performs a merge with any union data inside the SignSolTransactionCriteria_Item, using the provided ProgramIdCriterion -func (t *SignSolTransactionCriteria_Item) MergeProgramIdCriterion(v ProgramIdCriterion) 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 @@ -7654,32 +7975,32 @@ func (t *SignSolTransactionCriteria_Item) MergeProgramIdCriterion(v ProgramIdCri return err } -func (t SignSolTransactionCriteria_Item) MarshalJSON() ([]byte, error) { +func (t SignEvmTypedDataCriteria_Item) MarshalJSON() ([]byte, error) { b, err := t.union.MarshalJSON() return b, err } -func (t *SignSolTransactionCriteria_Item) UnmarshalJSON(b []byte) error { +func (t *SignEvmTypedDataCriteria_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 +// 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 } -// FromSolDataParameterCondition overwrites any union data inside the SolDataCondition_Params_Item as the provided SolDataParameterCondition -func (t *SolDataCondition_Params_Item) FromSolDataParameterCondition(v SolDataParameterCondition) 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 } -// 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 { +// 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 @@ -7690,22 +8011,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 +// 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 } -// FromSolDataParameterConditionList overwrites any union data inside the SolDataCondition_Params_Item as the provided SolDataParameterConditionList -func (t *SolDataCondition_Params_Item) FromSolDataParameterConditionList(v SolDataParameterConditionList) 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 } -// 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 { +// 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 @@ -7716,32 +8037,22 @@ func (t *SolDataCondition_Params_Item) MergeSolDataParameterConditionList(v SolD return err } -func (t SolDataCondition_Params_Item) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *SolDataCondition_Params_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 +// 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 } -// FromKnownIdlType overwrites any union data inside the SolDataCriterion_Idls_Item as the provided KnownIdlType -func (t *SolDataCriterion_Idls_Item) FromKnownIdlType(v KnownIdlType) 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 } -// 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 { +// 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 @@ -7752,22 +8063,32 @@ 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 +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 } -// FromIdl overwrites any union data inside the SolDataCriterion_Idls_Item as the provided Idl -func (t *SolDataCriterion_Idls_Item) FromIdl(v Idl) 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 } -// 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 { +// 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 @@ -7778,32 +8099,32 @@ func (t *SolDataCriterion_Idls_Item) MergeIdl(v Idl) error { return err } -func (t SolDataCriterion_Idls_Item) MarshalJSON() ([]byte, error) { +func (t SignSolMessageCriteria_Item) MarshalJSON() ([]byte, error) { b, err := t.union.MarshalJSON() return b, err } -func (t *SolDataCriterion_Idls_Item) UnmarshalJSON(b []byte) error { +func (t *SignSolMessageCriteria_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 +// 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 } -// FromX402V1PaymentPayload overwrites any union data inside the X402PaymentPayload as the provided X402V1PaymentPayload -func (t *X402PaymentPayload) FromX402V1PaymentPayload(v X402V1PaymentPayload) error { +// 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 } -// MergeX402V1PaymentPayload performs a merge with any union data inside the X402PaymentPayload, using the provided X402V1PaymentPayload -func (t *X402PaymentPayload) MergeX402V1PaymentPayload(v X402V1PaymentPayload) 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 @@ -7814,22 +8135,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 +// 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 } -// FromX402V2PaymentPayload overwrites any union data inside the X402PaymentPayload as the provided X402V2PaymentPayload -func (t *X402PaymentPayload) FromX402V2PaymentPayload(v X402V2PaymentPayload) 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 } -// MergeX402V2PaymentPayload performs a merge with any union data inside the X402PaymentPayload, using the provided X402V2PaymentPayload -func (t *X402PaymentPayload) MergeX402V2PaymentPayload(v X402V2PaymentPayload) 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 @@ -7840,32 +8161,48 @@ func (t *X402PaymentPayload) MergeX402V2PaymentPayload(v X402V2PaymentPayload) e return err } -func (t X402PaymentPayload) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err +// 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 } -func (t *X402PaymentPayload) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) +// 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 } -// AsX402V1PaymentRequirements returns the union data inside the X402PaymentRequirements as a X402V1PaymentRequirements -func (t X402PaymentRequirements) AsX402V1PaymentRequirements() (X402V1PaymentRequirements, error) { - var body X402V1PaymentRequirements +// 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 + } + + merged, err := runtime.JsonMerge(t.union, b) + t.union = merged + return 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 } -// FromX402V1PaymentRequirements overwrites any union data inside the X402PaymentRequirements as the provided X402V1PaymentRequirements -func (t *X402PaymentRequirements) FromX402V1PaymentRequirements(v X402V1PaymentRequirements) error { +// 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 } -// MergeX402V1PaymentRequirements performs a merge with any union data inside the X402PaymentRequirements, using the provided X402V1PaymentRequirements -func (t *X402PaymentRequirements) MergeX402V1PaymentRequirements(v X402V1PaymentRequirements) error { +// 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 @@ -7876,22 +8213,22 @@ 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 +// 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 } -// FromX402V2PaymentRequirements overwrites any union data inside the X402PaymentRequirements as the provided X402V2PaymentRequirements -func (t *X402PaymentRequirements) FromX402V2PaymentRequirements(v X402V2PaymentRequirements) 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 } -// MergeX402V2PaymentRequirements performs a merge with any union data inside the X402PaymentRequirements, using the provided X402V2PaymentRequirements -func (t *X402PaymentRequirements) MergeX402V2PaymentRequirements(v X402V2PaymentRequirements) 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 @@ -7902,32 +8239,48 @@ func (t *X402PaymentRequirements) MergeX402V2PaymentRequirements(v X402V2Payment return err } -func (t X402PaymentRequirements) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err +// 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 } -func (t *X402PaymentRequirements) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) +// 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 } -// AsX402ExactEvmPayload returns the union data inside the X402V1PaymentPayload_Payload as a X402ExactEvmPayload -func (t X402V1PaymentPayload_Payload) AsX402ExactEvmPayload() (X402ExactEvmPayload, error) { - var body X402ExactEvmPayload +// 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 + } + + merged, err := runtime.JsonMerge(t.union, b) + t.union = merged + return err +} + +// 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 } -// FromX402ExactEvmPayload overwrites any union data inside the X402V1PaymentPayload_Payload as the provided X402ExactEvmPayload -func (t *X402V1PaymentPayload_Payload) FromX402ExactEvmPayload(v X402ExactEvmPayload) 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 } -// MergeX402ExactEvmPayload performs a merge with any union data inside the X402V1PaymentPayload_Payload, using the provided X402ExactEvmPayload -func (t *X402V1PaymentPayload_Payload) MergeX402ExactEvmPayload(v X402ExactEvmPayload) 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 @@ -7938,22 +8291,32 @@ 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 +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 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 { +// 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 } -// MergeX402ExactEvmPermit2Payload performs a merge with any union data inside the X402V1PaymentPayload_Payload, using the provided X402ExactEvmPermit2Payload -func (t *X402V1PaymentPayload_Payload) MergeX402ExactEvmPermit2Payload(v X402ExactEvmPermit2Payload) error { +// 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 @@ -7964,22 +8327,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 +// 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 } -// FromX402ExactSolanaPayload overwrites any union data inside the X402V1PaymentPayload_Payload as the provided X402ExactSolanaPayload -func (t *X402V1PaymentPayload_Payload) FromX402ExactSolanaPayload(v X402ExactSolanaPayload) error { +// 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 } -// MergeX402ExactSolanaPayload performs a merge with any union data inside the X402V1PaymentPayload_Payload, using the provided X402ExactSolanaPayload -func (t *X402V1PaymentPayload_Payload) MergeX402ExactSolanaPayload(v X402ExactSolanaPayload) error { +// 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 @@ -7990,32 +8353,32 @@ func (t *X402V1PaymentPayload_Payload) MergeX402ExactSolanaPayload(v X402ExactSo return err } -func (t X402V1PaymentPayload_Payload) MarshalJSON() ([]byte, error) { +func (t SolDataCondition_Params_Item) MarshalJSON() ([]byte, error) { b, err := t.union.MarshalJSON() return b, err } -func (t *X402V1PaymentPayload_Payload) UnmarshalJSON(b []byte) error { +func (t *SolDataCondition_Params_Item) UnmarshalJSON(b []byte) error { err := t.union.UnmarshalJSON(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 +// 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 } -// FromX402ExactEvmPayload overwrites any union data inside the X402V2PaymentPayload_Payload as the provided X402ExactEvmPayload -func (t *X402V2PaymentPayload_Payload) FromX402ExactEvmPayload(v X402ExactEvmPayload) 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 } -// MergeX402ExactEvmPayload performs a merge with any union data inside the X402V2PaymentPayload_Payload, using the provided X402ExactEvmPayload -func (t *X402V2PaymentPayload_Payload) MergeX402ExactEvmPayload(v X402ExactEvmPayload) 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 @@ -8026,22 +8389,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 +// 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 } -// FromX402ExactEvmPermit2Payload overwrites any union data inside the X402V2PaymentPayload_Payload as the provided X402ExactEvmPermit2Payload -func (t *X402V2PaymentPayload_Payload) FromX402ExactEvmPermit2Payload(v X402ExactEvmPermit2Payload) 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 } -// MergeX402ExactEvmPermit2Payload performs a merge with any union data inside the X402V2PaymentPayload_Payload, using the provided X402ExactEvmPermit2Payload -func (t *X402V2PaymentPayload_Payload) MergeX402ExactEvmPermit2Payload(v X402ExactEvmPermit2Payload) 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 @@ -8052,22 +8415,32 @@ 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 +func (t SolDataCriterion_Idls_Item) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *SolDataCriterion_Idls_Item) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// 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 } -// FromX402ExactSolanaPayload overwrites any union data inside the X402V2PaymentPayload_Payload as the provided X402ExactSolanaPayload -func (t *X402V2PaymentPayload_Payload) FromX402ExactSolanaPayload(v X402ExactSolanaPayload) 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 } -// MergeX402ExactSolanaPayload performs a merge with any union data inside the X402V2PaymentPayload_Payload, using the provided X402ExactSolanaPayload -func (t *X402V2PaymentPayload_Payload) MergeX402ExactSolanaPayload(v X402ExactSolanaPayload) 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 @@ -8078,18 +8451,282 @@ func (t *X402V2PaymentPayload_Payload) MergeX402ExactSolanaPayload(v X402ExactSo return err } -func (t X402V2PaymentPayload_Payload) MarshalJSON() ([]byte, 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 +} + +// 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 +} + +// 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 + } + + merged, err := runtime.JsonMerge(t.union, b) + t.union = merged + return err +} + +func (t X402PaymentPayload) MarshalJSON() ([]byte, error) { b, err := t.union.MarshalJSON() return b, err } -func (t *X402V2PaymentPayload_Payload) UnmarshalJSON(b []byte) error { +func (t *X402PaymentPayload) 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 +// 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 +} + +// 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 +} + +// 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 + } + + merged, err := runtime.JsonMerge(t.union, b) + t.union = merged + return err +} + +// 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 +} + +// 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 +} + +// 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 + } + + merged, err := runtime.JsonMerge(t.union, b) + t.union = merged + return err +} + +func (t X402PaymentRequirements) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *X402PaymentRequirements) 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 + 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) + 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 { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JsonMerge(t.union, b) + t.union = merged + return err +} + +// 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 +} + +// 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 +} + +// 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 + } + + merged, err := runtime.JsonMerge(t.union, b) + t.union = merged + return err +} + +// 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 +} + +// 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 +} + +// 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 + } + + merged, err := runtime.JsonMerge(t.union, b) + t.union = merged + return err +} + +func (t X402V1PaymentPayload_Payload) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *X402V1PaymentPayload_Payload) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(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 + 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 { + 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 { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JsonMerge(t.union, b) + t.union = merged + return err +} + +// 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 +} + +// 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 +} + +// 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 + } + + merged, err := runtime.JsonMerge(t.union, b) + t.union = merged + return err +} + +// 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 +} + +// 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 +} + +// 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 + } + + merged, err := runtime.JsonMerge(t.union, b) + t.union = merged + return err +} + +func (t X402V2PaymentPayload_Payload) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *X402V2PaymentPayload_Payload) 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. // @@ -8194,41 +8831,116 @@ type ClientInterface interface { UpdateWebhookSubscription(ctx context.Context, subscriptionId openapi_types.UUID, body UpdateWebhookSubscriptionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // ListEndUsers request - ListEndUsers(ctx context.Context, params *ListEndUsersParams, 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) - // CreateEndUserWithBody request with any body - CreateEndUserWithBody(ctx context.Context, params *CreateEndUserParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + RevokeDelegationForEndUser(ctx context.Context, projectId string, userId string, params *RevokeDelegationForEndUserParams, body RevokeDelegationForEndUserJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - CreateEndUser(ctx context.Context, params *CreateEndUserParams, body CreateEndUserJSONRequestBody, 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) - // ValidateEndUserAccessTokenWithBody request with any body - ValidateEndUserAccessTokenWithBody(ctx context.Context, 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) - ValidateEndUserAccessToken(ctx context.Context, body ValidateEndUserAccessTokenJSONRequestBody, 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) - // ImportEndUserWithBody request with any body - ImportEndUserWithBody(ctx context.Context, params *ImportEndUserParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + SendEvmTransactionWithEndUserAccount(ctx context.Context, projectId string, userId string, params *SendEvmTransactionWithEndUserAccountParams, body SendEvmTransactionWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - ImportEndUser(ctx context.Context, params *ImportEndUserParams, body ImportEndUserJSONRequestBody, 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) - // GetEndUser request - GetEndUser(ctx context.Context, userId string, reqEditors ...RequestEditorFn) (*http.Response, error) + SignEvmHashWithEndUserAccount(ctx context.Context, projectId string, userId string, params *SignEvmHashWithEndUserAccountParams, body SignEvmHashWithEndUserAccountJSONRequestBody, 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) + // 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) - AddEndUserEvmAccount(ctx context.Context, userId string, params *AddEndUserEvmAccountParams, body AddEndUserEvmAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + SignEvmMessageWithEndUserAccount(ctx context.Context, projectId string, userId string, params *SignEvmMessageWithEndUserAccountParams, body SignEvmMessageWithEndUserAccountJSONRequestBody, 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) + // 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) - AddEndUserEvmSmartAccount(ctx context.Context, userId string, params *AddEndUserEvmSmartAccountParams, body AddEndUserEvmSmartAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + SignEvmTransactionWithEndUserAccount(ctx context.Context, projectId string, userId string, params *SignEvmTransactionWithEndUserAccountParams, body SignEvmTransactionWithEndUserAccountJSONRequestBody, 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) + // 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) - AddEndUserSolanaAccount(ctx context.Context, userId string, params *AddEndUserSolanaAccountParams, body AddEndUserSolanaAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + SignEvmTypedDataWithEndUserAccount(ctx context.Context, projectId string, userId string, params *SignEvmTypedDataWithEndUserAccountParams, body SignEvmTypedDataWithEndUserAccountJSONRequestBody, 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) + + SendUserOperationWithEndUserAccount(ctx context.Context, projectId string, userId string, address string, params *SendUserOperationWithEndUserAccountParams, body SendUserOperationWithEndUserAccountJSONRequestBody, 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) + + RevokeSpendPermissionWithEndUserAccount(ctx context.Context, projectId string, userId string, address string, params *RevokeSpendPermissionWithEndUserAccountParams, body RevokeSpendPermissionWithEndUserAccountJSONRequestBody, 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) @@ -8615,8 +9327,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 +9339,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 +9351,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 +9363,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 +9375,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 +9387,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 +9399,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 +9411,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 +9423,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 +9435,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 +9447,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 +9459,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 +9471,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 +9483,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 +9495,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 +9507,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 +9519,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 +9531,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 +9543,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 +9555,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 +9567,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 +9579,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 +9591,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 +9603,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 +9615,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 +9627,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 +9639,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 +9651,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 +9663,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 +9675,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 +9687,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 +9699,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 +9711,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 +9723,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 +9735,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 +9747,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 +9759,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 +9771,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 +9783,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 +9795,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 +9807,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 +9819,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 +9831,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 +9843,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 +9855,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 +9867,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 +9879,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 +9891,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 +9903,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 +9915,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 +9927,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 +9939,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 +9951,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 +9963,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 +9975,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 +9987,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 +9999,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 +10011,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 +10023,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 +10035,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 +10047,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 +10059,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 +10071,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 +10083,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 +10095,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 +10107,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 +10119,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 +10131,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 +10143,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 +10155,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 +10167,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 +10179,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 +10191,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 +10203,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 +10215,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 +10227,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 +10239,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 +10251,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 +10263,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 +10275,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 +10287,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 +10299,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 +10311,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 +10323,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 +10335,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 +10347,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 +10359,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 +10371,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 +10383,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 +10395,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 +10407,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 +10419,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 +10431,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 +10443,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 +10455,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 +10467,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 +10479,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 +10491,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 +10503,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 +10515,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 +10527,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 +10539,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 +10551,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 +10563,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 +10575,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 +10587,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 +10599,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, 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) } -// 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) 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 } - 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) 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 } - - 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) 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 } - - 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) 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 } - - serverURL, err := url.Parse(server) - if err != nil { + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } + return c.Client.Do(req) +} - operationPath := fmt.Sprintf("/v2/data/webhooks/subscriptions/%s", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) +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, 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) 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 } + 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) 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 } - - 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) 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) +} - req, err := http.NewRequest("GET", queryURL.String(), nil) +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 } - - return req, nil + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + 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) RequestSolanaFaucet(ctx context.Context, body RequestSolanaFaucetJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewRequestSolanaFaucetRequest(c.Server, body) 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) 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 } + 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) 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 } - - 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) SettleX402Payment(ctx context.Context, body SettleX402PaymentJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewSettleX402PaymentRequest(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) +} - req, err := http.NewRequest("PUT", queryURL.String(), body) +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.Header.Add("Content-Type", contentType) +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) +} - 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 +11027,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 +11038,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 +11071,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 +11126,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 +11146,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 +11155,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,49 +11165,99 @@ 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) { +// 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/data/webhooks/subscriptions") + 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) + + return req, nil +} + +// 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 } @@ -10563,7 +11267,41 @@ func NewGetEndUserRequest(server string, userId string) (*http.Request, error) { return nil, err } - operationPath := fmt.Sprintf("/v2/end-users/%s", pathParam0) + operationPath := fmt.Sprintf("/v2/data/webhooks/subscriptions/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// 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) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v2/data/webhooks/subscriptions/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -10581,24 +11319,24 @@ func NewGetEndUserRequest(server string, userId string) (*http.Request, error) { return req, nil } -// NewAddEndUserEvmAccountRequest calls the generic AddEndUserEvmAccount builder with application/json body -func NewAddEndUserEvmAccountRequest(server string, userId string, params *AddEndUserEvmAccountParams, body AddEndUserEvmAccountJSONRequestBody) (*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 NewAddEndUserEvmAccountRequestWithBody(server, userId, params, "application/json", bodyReader) + return NewUpdateWebhookSubscriptionRequestWithBody(server, subscriptionId, "application/json", bodyReader) } -// 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) { +// 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 } @@ -10608,7 +11346,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,7 +11356,61 @@ func NewAddEndUserEvmAccountRequestWithBody(server string, userId string, params 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) + + return req, nil +} + +// 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 NewRevokeDelegationForEndUserRequestWithBody(server, projectId, userId, params, "application/json", bodyReader) +} + +// 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, "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/embedded-wallet-api/projects/%s/end-users/%s/delegation", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryURL.String(), body) if err != nil { return nil, err } @@ -10638,15 +11430,26 @@ func NewAddEndUserEvmAccountRequestWithBody(server string, userId string, params 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) } } @@ -10654,24 +11457,31 @@ func NewAddEndUserEvmAccountRequestWithBody(server string, userId string, params 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) { +// 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 NewAddEndUserEvmSmartAccountRequestWithBody(server, userId, params, "application/json", bodyReader) + return NewCreateEvmEip7702DelegationWithEndUserAccountRequestWithBody(server, projectId, userId, params, "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) { +// 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, "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 } @@ -10681,7 +11491,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/embedded-wallet-api/projects/%s/end-users/%s/evm/eip7702/delegation", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -10722,29 +11532,47 @@ func NewAddEndUserEvmSmartAccountRequestWithBody(server string, userId string, p 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 } -// NewAddEndUserSolanaAccountRequest calls the generic AddEndUserSolanaAccount builder with application/json body -func NewAddEndUserSolanaAccountRequest(server string, userId string, params *AddEndUserSolanaAccountParams, body AddEndUserSolanaAccountJSONRequestBody) (*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 NewAddEndUserSolanaAccountRequestWithBody(server, userId, params, "application/json", bodyReader) + return NewSendEvmTransactionWithEndUserAccountRequestWithBody(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) { +// 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, "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 +11582,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/evm/send/transaction", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -10795,21 +11623,57 @@ func NewAddEndUserSolanaAccountRequestWithBody(server string, userId string, par 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 } -// NewListEvmAccountsRequest generates requests for ListEvmAccounts -func NewListEvmAccountsRequest(server string, params *ListEvmAccountsParams) (*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 NewSignEvmHashWithEndUserAccountRequestWithBody(server, projectId, userId, params, "application/json", bodyReader) +} + +// 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, "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/sign", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -10819,73 +11683,88 @@ func NewListEvmAccountsRequest(server string, params *ListEvmAccountsParams) (*h return nil, err } - if params != nil { - queryValues := queryURL.Query() + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } - if params.PageSize != nil { + req.Header.Add("Content-Type", contentType) - 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 { + 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 - } 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) { +// 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 NewCreateEvmAccountRequestWithBody(server, params, "application/json", bodyReader) + return NewSignEvmMessageWithEndUserAccountRequestWithBody(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) { +// 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") + operationPath := fmt.Sprintf("/v2/embedded-wallet-api/projects/%s/end-users/%s/evm/sign/message", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -10926,63 +11805,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) { +// 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 NewExportEvmAccountByNameRequestWithBody(server, name, params, "application/json", bodyReader) + return NewSignEvmTransactionWithEndUserAccountRequestWithBody(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) { +// 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, "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 +11855,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/transaction", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -11033,32 +11896,57 @@ func NewExportEvmAccountByNameRequestWithBody(server string, name 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 } -// NewImportEvmAccountRequest calls the generic ImportEvmAccount builder with application/json body -func NewImportEvmAccountRequest(server string, params *ImportEvmAccountParams, body ImportEvmAccountJSONRequestBody) (*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 NewImportEvmAccountRequestWithBody(server, params, "application/json", bodyReader) + return NewSignEvmTypedDataWithEndUserAccountRequestWithBody(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) { +// 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, "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/typed-data", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -11099,63 +11987,54 @@ func NewImportEvmAccountRequestWithBody(server string, params *ImportEvmAccountP req.Header.Set("X-Idempotency-Key", headerParam1) } - } - - return req, nil -} + if params.XDeveloperAuth != nil { + var headerParam2 string -// NewGetEvmAccountRequest generates requests for GetEvmAccount -func NewGetEvmAccountRequest(server string, address string) (*http.Request, error) { - var err error + headerParam2, err = runtime.StyleParamWithLocation("simple", false, "X-Developer-Auth", runtime.ParamLocationHeader, *params.XDeveloperAuth) + if err != nil { + return nil, err + } - var pathParam0 string + req.Header.Set("X-Developer-Auth", headerParam2) + } - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "address", runtime.ParamLocationPath, address) - if err != nil { - return nil, err } - serverURL, err := url.Parse(server) + return req, nil +} + +// 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 NewSendUserOperationWithEndUserAccountRequestWithBody(server, projectId, userId, address, params, "application/json", bodyReader) +} - operationPath := fmt.Sprintf("/v2/evm/accounts/%s", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } +// 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 - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } + var pathParam0 string - req, err := http.NewRequest("GET", queryURL.String(), nil) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "projectId", runtime.ParamLocationPath, projectId) if err != nil { return nil, err } - return req, nil -} + var pathParam1 string -// 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) + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "userId", runtime.ParamLocationPath, userId) if err != nil { return nil, err } - bodyReader = bytes.NewReader(buf) - return NewUpdateEvmAccountRequestWithBody(server, address, 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) { - var err error - var pathParam0 string + var pathParam2 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "address", runtime.ParamLocationPath, address) + pathParam2, err = runtime.StyleParamWithLocation("simple", false, "address", runtime.ParamLocationPath, address) if err != nil { return nil, err } @@ -11165,7 +12044,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/smart-accounts/%s/send", pathParam0, pathParam1, pathParam2) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -11175,7 +12054,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 } @@ -11195,29 +12074,65 @@ func NewUpdateEvmAccountRequestWithBody(server string, address string, params *U req.Header.Set("X-Idempotency-Key", headerParam0) } + if params.XWalletAuth != nil { + var headerParam1 string + + headerParam1, err = runtime.StyleParamWithLocation("simple", false, "X-Wallet-Auth", runtime.ParamLocationHeader, *params.XWalletAuth) + if err != nil { + return nil, err + } + + 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) + } + } 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) { +// 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 NewCreateEvmEip7702DelegationRequestWithBody(server, address, params, "application/json", bodyReader) + return NewRevokeSpendPermissionWithEndUserAccountRequestWithBody(server, projectId, userId, address, 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) { +// 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 } @@ -11227,7 +12142,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/smart-accounts/%s/spend-permissions/revoke", pathParam0, pathParam1, pathParam2) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -11273,24 +12188,45 @@ func NewCreateEvmEip7702DelegationRequestWithBody(server string, address string, 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) { +// 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 NewExportEvmAccountRequestWithBody(server, address, params, "application/json", bodyReader) + return NewSendEvmAssetWithEndUserAccountRequestWithBody(server, projectId, userId, address, asset, 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) { +// 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 } @@ -11300,7 +12236,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/%s/send/%s", pathParam0, pathParam1, pathParam2, pathParam3) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -11341,29 +12277,47 @@ func NewExportEvmAccountRequestWithBody(server string, address string, params *E 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 } -// NewSendEvmTransactionRequest calls the generic SendEvmTransaction builder with application/json body -func NewSendEvmTransactionRequest(server string, address string, params *SendEvmTransactionParams, body SendEvmTransactionJSONRequestBody) (*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 NewSendEvmTransactionRequestWithBody(server, address, params, "application/json", bodyReader) + return NewSendSolanaTransactionWithEndUserAccountRequestWithBody(server, projectId, userId, 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) { +// 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 } @@ -11373,7 +12327,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/solana/send/transaction", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -11414,29 +12368,47 @@ func NewSendEvmTransactionRequestWithBody(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 } -// NewSignEvmHashRequest calls the generic SignEvmHash builder with application/json body -func NewSignEvmHashRequest(server string, address string, params *SignEvmHashParams, body SignEvmHashJSONRequestBody) (*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 NewSignEvmHashRequestWithBody(server, address, params, "application/json", bodyReader) + return NewSignSolanaHashWithEndUserAccountRequestWithBody(server, projectId, userId, 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) { +// 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 } @@ -11446,7 +12418,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/solana/sign", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -11487,29 +12459,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) { +// 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 NewSignEvmMessageRequestWithBody(server, address, params, "application/json", bodyReader) + return NewSignSolanaMessageWithEndUserAccountRequestWithBody(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) { +// 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 + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "userId", runtime.ParamLocationPath, userId) if err != nil { return nil, err } @@ -11519,7 +12509,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/sign/message", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -11560,29 +12550,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) { +// 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 NewSignEvmTransactionRequestWithBody(server, address, params, "application/json", bodyReader) + return NewSignSolanaTransactionWithEndUserAccountRequestWithBody(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) { +// 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, "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 +12600,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/transaction", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -11633,29 +12641,61 @@ 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) { +// 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 NewSignEvmTypedDataRequestWithBody(server, address, params, "application/json", bodyReader) + return NewSendSolanaAssetWithEndUserAccountRequestWithBody(server, projectId, userId, address, asset, 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) { +// 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, "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 } @@ -11665,7 +12705,7 @@ func NewSignEvmTypedDataRequestWithBody(server string, address string, params *S return nil, err } - operationPath := fmt.Sprintf("/v2/evm/accounts/%s/sign/typed-data", pathParam0) + 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 } @@ -11706,87 +12746,24 @@ func NewSignEvmTypedDataRequestWithBody(server string, address string, params *S req.Header.Set("X-Idempotency-Key", headerParam1) } - } - - return req, nil -} - -// 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, "delegationOperationId", runtime.ParamLocationPath, delegationOperationId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/v2/evm/eip7702/delegation-operations/%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 -} - -// 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 NewRequestEvmFaucetRequestWithBody(server, "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) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } + if params.XDeveloperAuth != nil { + var headerParam2 string - operationPath := fmt.Sprintf("/v2/evm/faucet") - 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("POST", queryURL.String(), body) - if err != nil { - return nil, err } - req.Header.Add("Content-Type", contentType) - 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 +12771,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 +12816,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 +12843,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 +12863,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,15 +12882,26 @@ 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) + } + + 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) } } @@ -11905,23 +12909,27 @@ func NewCreateEvmSmartAccountRequestWithBody(server string, params *CreateEvmSma return req, nil } -// 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) +// 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 } + bodyReader = bytes.NewReader(buf) + return NewValidateEndUserAccessTokenRequestWithBody(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) { + var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/v2/evm/smart-accounts/by-name/%s", pathParam0) + operationPath := fmt.Sprintf("/v2/end-users/auth/validate-token") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -11931,31 +12939,37 @@ func NewGetEvmSmartAccountByNameRequest(server string, name string) (*http.Reque 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 } -// NewGetEvmSmartAccountRequest generates requests for GetEvmSmartAccount -func NewGetEvmSmartAccountRequest(server string, address string) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "address", runtime.ParamLocationPath, address) +// 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) { + var err error 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 } @@ -11965,32 +12979,49 @@ 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 } - return req, nil -} + 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) + } -// 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 NewUpdateEvmSmartAccountRequestWithBody(server, address, "application/json", bodyReader) + + return req, nil } -// NewUpdateEvmSmartAccountRequestWithBody generates requests for UpdateEvmSmartAccount with any type of body -func NewUpdateEvmSmartAccountRequestWithBody(server string, address string, contentType string, body io.Reader) (*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 } @@ -12000,7 +13031,7 @@ func NewUpdateEvmSmartAccountRequestWithBody(server string, address string, cont return nil, err } - operationPath := fmt.Sprintf("/v2/evm/smart-accounts/%s", pathParam0) + operationPath := fmt.Sprintf("/v2/end-users/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -12010,34 +13041,32 @@ func NewUpdateEvmSmartAccountRequestWithBody(server string, address string, cont return nil, err } - req, err := http.NewRequest("PUT", 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 } -// NewCreateSpendPermissionRequest calls the generic CreateSpendPermission builder with application/json body -func NewCreateSpendPermissionRequest(server string, address string, params *CreateSpendPermissionParams, body CreateSpendPermissionJSONRequestBody) (*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 NewCreateSpendPermissionRequestWithBody(server, address, params, "application/json", bodyReader) + return NewAddEndUserEvmAccountRequestWithBody(server, userId, 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) { +// 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 } @@ -12047,7 +13076,7 @@ func NewCreateSpendPermissionRequestWithBody(server string, address string, para return nil, err } - operationPath := fmt.Sprintf("/v2/evm/smart-accounts/%s/spend-permissions", pathParam0) + operationPath := fmt.Sprintf("/v2/end-users/%s/evm", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -12093,13 +13122,24 @@ 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) { +// 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 NewAddEndUserEvmSmartAccountRequestWithBody(server, userId, params, "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) { 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 +13149,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/evm-smart-account", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -12119,70 +13159,60 @@ func NewListSpendPermissionsRequest(server string, address string, params *ListS 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 } -// NewRevokeSpendPermissionRequest calls the generic RevokeSpendPermission builder with application/json body -func NewRevokeSpendPermissionRequest(server string, address string, params *RevokeSpendPermissionParams, body RevokeSpendPermissionJSONRequestBody) (*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 NewRevokeSpendPermissionRequestWithBody(server, address, params, "application/json", bodyReader) + return NewAddEndUserSolanaAccountRequestWithBody(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) { +// 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 } @@ -12192,7 +13222,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/solana", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -12238,34 +13268,16 @@ 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) { - 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) -} - -// NewPrepareUserOperationRequestWithBody generates requests for PrepareUserOperation with any type of body -func NewPrepareUserOperationRequestWithBody(server string, address string, contentType string, body io.Reader) (*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 - } - serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/v2/evm/smart-accounts/%s/user-operations", pathParam0) + operationPath := fmt.Sprintf("/v2/evm/accounts") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -12275,44 +13287,73 @@ func NewPrepareUserOperationRequestWithBody(server string, address string, conte return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), body) + 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.Header.Add("Content-Type", contentType) - 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) { +// 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 NewPrepareAndSendUserOperationRequestWithBody(server, address, params, "application/json", bodyReader) + return NewCreateEvmAccountRequestWithBody(server, 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) { +// 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 - } - serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/v2/evm/smart-accounts/%s/user-operations/prepare-and-send", pathParam0) + operationPath := fmt.Sprintf("/v2/evm/accounts") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -12331,26 +13372,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,20 +13399,13 @@ 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) { +// 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, "address", runtime.ParamLocationPath, address) - if err != nil { - return nil, err - } - - var pathParam1 string - - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "userOpHash", runtime.ParamLocationPath, userOpHash) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "name", runtime.ParamLocationPath, name) if err != nil { return nil, err } @@ -12381,7 +13415,7 @@ func NewGetUserOperationRequest(server string, address string, userOpHash string return nil, err } - operationPath := fmt.Sprintf("/v2/evm/smart-accounts/%s/user-operations/%s", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/v2/evm/accounts/by-name/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -12399,31 +13433,24 @@ 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) { +// 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 NewSendUserOperationRequestWithBody(server, address, userOpHash, "application/json", bodyReader) + return NewExportEvmAccountByNameRequestWithBody(server, name, 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) { +// 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, "address", runtime.ParamLocationPath, address) - if err != nil { - return nil, err - } - - var pathParam1 string - - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "userOpHash", runtime.ParamLocationPath, userOpHash) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "name", runtime.ParamLocationPath, name) if err != nil { return nil, err } @@ -12433,7 +13460,7 @@ func NewSendUserOperationRequestWithBody(server string, address string, userOpHa return nil, err } - operationPath := fmt.Sprintf("/v2/evm/smart-accounts/%s/user-operations/%s/send", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/v2/evm/accounts/export/by-name/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -12450,22 +13477,48 @@ func NewSendUserOperationRequestWithBody(server string, address string, userOpHa 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 } -// NewCreateEvmSwapQuoteRequest calls the generic CreateEvmSwapQuote builder with application/json body -func NewCreateEvmSwapQuoteRequest(server string, params *CreateEvmSwapQuoteParams, body CreateEvmSwapQuoteJSONRequestBody) (*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 NewCreateEvmSwapQuoteRequestWithBody(server, params, "application/json", bodyReader) + return NewImportEvmAccountRequestWithBody(server, 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) { +// 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) @@ -12473,7 +13526,7 @@ func NewCreateEvmSwapQuoteRequestWithBody(server string, params *CreateEvmSwapQu return nil, err } - operationPath := fmt.Sprintf("/v2/evm/swaps") + operationPath := fmt.Sprintf("/v2/evm/accounts/import") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -12492,15 +13545,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,16 +13572,23 @@ func NewCreateEvmSwapQuoteRequestWithBody(server string, params *CreateEvmSwapQu return req, nil } -// NewGetEvmSwapPriceRequest generates requests for GetEvmSwapPrice -func NewGetEvmSwapPriceRequest(server string, params *GetEvmSwapPriceParams) (*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, "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/swaps/quote") + operationPath := fmt.Sprintf("/v2/evm/accounts/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -12527,120 +13598,6 @@ 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 { - - 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) - } - } - } - - } - - if params.GasPrice != nil { - - 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) - } - } - } - - } - - if params.SlippageBps != nil { - - 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) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - } - req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err @@ -12649,20 +13606,24 @@ func NewGetEvmSwapPriceRequest(server string, params *GetEvmSwapPriceParams) (*h return req, nil } -// NewListEvmTokenBalancesRequest generates requests for ListEvmTokenBalances -func NewListEvmTokenBalancesRequest(server string, network ListEvmTokenBalancesNetwork, address string, params *ListEvmTokenBalancesParams) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "network", runtime.ParamLocationPath, network) +// 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 NewUpdateEvmAccountRequestWithBody(server, address, params, "application/json", bodyReader) +} - var pathParam1 string +// 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 - 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 } @@ -12672,7 +13633,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 +13643,59 @@ func NewListEvmTokenBalancesRequest(server string, network ListEvmTokenBalancesN return nil, err } + req, err := http.NewRequest("PUT", 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) - } - } - } - - } - - 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", headerParam0) } - queryURL.RawQuery = queryValues.Encode() - } - - 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) { +// 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 NewGetOnrampUserLimitsRequestWithBody(server, "application/json", bodyReader) + return NewCreateEvmEip7702DelegationRequestWithBody(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) { +// 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/limits") + operationPath := fmt.Sprintf("/v2/evm/accounts/%s/eip7702/delegation", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -12765,30 +13712,63 @@ func NewGetOnrampUserLimitsRequestWithBody(server string, contentType string, bo 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 } -// NewCreateOnrampOrderRequest calls the generic CreateOnrampOrder builder with application/json body -func NewCreateOnrampOrderRequest(server string, body CreateOnrampOrderJSONRequestBody) (*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 NewCreateOnrampOrderRequestWithBody(server, "application/json", bodyReader) + return NewExportEvmAccountRequestWithBody(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) { +// 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/orders") + operationPath := fmt.Sprintf("/v2/evm/accounts/%s/export", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -12805,64 +13785,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) { +// 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 NewCreateOnrampSessionRequestWithBody(server, "application/json", bodyReader) + return NewSendEvmTransactionRequestWithBody(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) { +// 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/onramp/sessions") + operationPath := fmt.Sprintf("/v2/evm/accounts/%s/send/transaction", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -12879,111 +13858,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) { +// 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 NewCreatePolicyRequestWithBody(server, params, "application/json", bodyReader) + return NewSignEvmHashRequestWithBody(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) { +// 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, "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/sign", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -13002,29 +13933,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 - return req, nil + 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) { +// 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 NewSignEvmMessageRequestWithBody(server, address, 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) { 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 +13987,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/message", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -13044,22 +13997,35 @@ 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) + } + + 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) } } @@ -13067,13 +14033,24 @@ func NewDeletePolicyRequest(server string, policyId string, params *DeletePolicy return req, nil } -// NewGetPolicyByIdRequest generates requests for GetPolicyById -func NewGetPolicyByIdRequest(server string, policyId string) (*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, "policyId", runtime.ParamLocationPath, policyId) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "address", runtime.ParamLocationPath, address) if err != nil { return nil, err } @@ -13083,7 +14060,7 @@ func NewGetPolicyByIdRequest(server string, policyId string) (*http.Request, err return nil, err } - operationPath := fmt.Sprintf("/v2/policy-engine/policies/%s", pathParam0) + operationPath := fmt.Sprintf("/v2/evm/accounts/%s/sign/transaction", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -13093,32 +14070,60 @@ func NewGetPolicyByIdRequest(server string, policyId string) (*http.Request, err 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) + } + + } + 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) { +// 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 NewUpdatePolicyRequestWithBody(server, policyId, params, "application/json", bodyReader) + return NewSignEvmTypedDataRequestWithBody(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) { +// 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, "policyId", runtime.ParamLocationPath, policyId) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "address", runtime.ParamLocationPath, address) if err != nil { return nil, err } @@ -13128,7 +14133,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/typed-data", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -13138,7 +14143,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 +14152,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 +14179,90 @@ 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) { +// 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, "delegationOperationId", runtime.ParamLocationPath, delegationOperationId) + 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/eip7702/delegation-operations/%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 +} + +// 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 NewRequestEvmFaucetRequestWithBody(server, "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) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v2/evm/faucet") + 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) + + return req, nil +} + +// NewListEvmSmartAccountsRequest generates requests for ListEvmSmartAccounts +func NewListEvmSmartAccountsRequest(server string, params *ListEvmSmartAccountsParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v2/evm/smart-accounts") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -13228,19 +14318,19 @@ func NewListSolanaAccountsRequest(server string, params *ListSolanaAccountsParam return req, nil } -// NewCreateSolanaAccountRequest calls the generic CreateSolanaAccount builder with application/json body -func NewCreateSolanaAccountRequest(server string, params *CreateSolanaAccountParams, body CreateSolanaAccountJSONRequestBody) (*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 NewCreateSolanaAccountRequestWithBody(server, params, "application/json", bodyReader) + return NewCreateEvmSmartAccountRequestWithBody(server, 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) { +// 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) @@ -13248,7 +14338,7 @@ func NewCreateSolanaAccountRequestWithBody(server string, params *CreateSolanaAc return nil, err } - operationPath := fmt.Sprintf("/v2/solana/accounts") + operationPath := fmt.Sprintf("/v2/evm/smart-accounts") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -13267,26 +14357,15 @@ func NewCreateSolanaAccountRequestWithBody(server string, params *CreateSolanaAc 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) } } @@ -13294,8 +14373,8 @@ func NewCreateSolanaAccountRequestWithBody(server string, params *CreateSolanaAc return req, nil } -// NewGetSolanaAccountByNameRequest generates requests for GetSolanaAccountByName -func NewGetSolanaAccountByNameRequest(server string, name string) (*http.Request, error) { +// NewGetEvmSmartAccountByNameRequest generates requests for GetEvmSmartAccountByName +func NewGetEvmSmartAccountByNameRequest(server string, name string) (*http.Request, error) { var err error var pathParam0 string @@ -13310,7 +14389,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/smart-accounts/by-name/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -13328,24 +14407,13 @@ 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) { - 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) -} - -// 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) { +// NewGetEvmSmartAccountRequest generates requests for GetEvmSmartAccount +func NewGetEvmSmartAccountRequest(server string, address string) (*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, "address", runtime.ParamLocationPath, address) if err != nil { return nil, err } @@ -13355,7 +14423,7 @@ func NewExportSolanaAccountByNameRequestWithBody(server string, name string, par return nil, err } - operationPath := fmt.Sprintf("/v2/solana/accounts/export/by-name/%s", pathParam0) + operationPath := fmt.Sprintf("/v2/evm/smart-accounts/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -13365,63 +14433,42 @@ func NewExportSolanaAccountByNameRequestWithBody(server string, name string, par 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 } -// NewImportSolanaAccountRequest calls the generic ImportSolanaAccount builder with application/json body -func NewImportSolanaAccountRequest(server string, params *ImportSolanaAccountParams, body ImportSolanaAccountJSONRequestBody) (*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 NewImportSolanaAccountRequestWithBody(server, params, "application/json", bodyReader) + return NewUpdateEvmSmartAccountRequestWithBody(server, address, "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) { +// 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 + + 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/import") + operationPath := fmt.Sprintf("/v2/evm/smart-accounts/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -13431,63 +14478,44 @@ func NewImportSolanaAccountRequestWithBody(server string, params *ImportSolanaAc 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 } -// NewSendSolanaTransactionRequest calls the generic SendSolanaTransaction builder with application/json body -func NewSendSolanaTransactionRequest(server string, params *SendSolanaTransactionParams, body SendSolanaTransactionJSONRequestBody) (*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 NewSendSolanaTransactionRequestWithBody(server, params, "application/json", bodyReader) + return NewCreateSpendPermissionRequestWithBody(server, address, 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) { +// 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/solana/accounts/send/transaction") + operationPath := fmt.Sprintf("/v2/evm/smart-accounts/%s/spend-permissions", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -13533,8 +14561,8 @@ func NewSendSolanaTransactionRequestWithBody(server string, params *SendSolanaTr return req, nil } -// NewGetSolanaAccountRequest generates requests for GetSolanaAccount -func NewGetSolanaAccountRequest(server string, address string) (*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 @@ -13549,7 +14577,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/spend-permissions/list", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -13559,6 +14587,44 @@ func NewGetSolanaAccountRequest(server string, address string) (*http.Request, e 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 @@ -13567,19 +14633,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) { +// 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 NewUpdateSolanaAccountRequestWithBody(server, address, params, "application/json", bodyReader) + return NewRevokeSpendPermissionRequestWithBody(server, address, params, "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) { +// 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 @@ -13594,7 +14660,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/spend-permissions/revoke", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -13604,7 +14670,7 @@ func NewUpdateSolanaAccountRequestWithBody(server string, address string, params 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 } @@ -13613,15 +14679,26 @@ func NewUpdateSolanaAccountRequestWithBody(server string, address string, params 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) } } @@ -13629,19 +14706,19 @@ func NewUpdateSolanaAccountRequestWithBody(server string, address string, params 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) { +// 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 NewExportSolanaAccountRequestWithBody(server, address, params, "application/json", bodyReader) + return NewPrepareUserOperationRequestWithBody(server, address, "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) { +// 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 @@ -13656,7 +14733,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/user-operations", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -13673,48 +14750,22 @@ func NewExportSolanaAccountRequestWithBody(server string, address string, params 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 } -// NewSignSolanaMessageRequest calls the generic SignSolanaMessage builder with application/json body -func NewSignSolanaMessageRequest(server string, address string, params *SignSolanaMessageParams, body SignSolanaMessageJSONRequestBody) (*http.Request, error) { +// 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 NewSignSolanaMessageRequestWithBody(server, address, params, "application/json", bodyReader) + return NewPrepareAndSendUserOperationRequestWithBody(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) { +// 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 var pathParam0 string @@ -13729,7 +14780,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/user-operations/prepare-and-send", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -13748,26 +14799,26 @@ func NewSignSolanaMessageRequestWithBody(server string, address string, params * 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) } } @@ -13775,24 +14826,20 @@ func NewSignSolanaMessageRequestWithBody(server string, address string, params * 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) { - var bodyReader io.Reader - buf, err := json.Marshal(body) +// 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 } - bodyReader = bytes.NewReader(buf) - return NewSignSolanaTransactionRequestWithBody(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) { - var err error - var pathParam0 string + var pathParam1 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "address", runtime.ParamLocationPath, address) + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "userOpHash", runtime.ParamLocationPath, userOpHash) if err != nil { return nil, err } @@ -13802,7 +14849,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/user-operations/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -13812,55 +14859,81 @@ func NewSignSolanaTransactionRequestWithBody(server string, address string, para 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 +} - if params != nil { +// 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) +} - if params.XWalletAuth != nil { - var headerParam0 string +// 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 - 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, "address", runtime.ParamLocationPath, address) + if err != nil { + return nil, err + } - if params.XIdempotencyKey != nil { - var headerParam1 string + var pathParam1 string - headerParam1, err = runtime.StyleParamWithLocation("simple", false, "X-Idempotency-Key", runtime.ParamLocationHeader, *params.XIdempotencyKey) - if err != nil { - return nil, err - } + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "userOpHash", runtime.ParamLocationPath, userOpHash) + if err != nil { + return nil, err + } - req.Header.Set("X-Idempotency-Key", headerParam1) - } + 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) + 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) + return req, nil } -// NewRequestSolanaFaucetRequest calls the generic RequestSolanaFaucet builder with application/json body -func NewRequestSolanaFaucetRequest(server string, body RequestSolanaFaucetJSONRequestBody) (*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 NewRequestSolanaFaucetRequestWithBody(server, "application/json", bodyReader) + return NewCreateEvmSwapQuoteRequestWithBody(server, params, "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) { +// 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) @@ -13868,7 +14941,7 @@ func NewRequestSolanaFaucetRequestWithBody(server string, contentType string, bo return nil, err } - operationPath := fmt.Sprintf("/v2/solana/faucet") + operationPath := fmt.Sprintf("/v2/evm/swaps") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -13885,33 +14958,34 @@ func NewRequestSolanaFaucetRequestWithBody(server string, contentType string, bo req.Header.Add("Content-Type", contentType) - return req, nil -} + if params != nil { -// NewListSolanaTokenBalancesRequest generates requests for ListSolanaTokenBalances -func NewListSolanaTokenBalancesRequest(server string, network ListSolanaTokenBalancesNetwork, address string, params *ListSolanaTokenBalancesParams) (*http.Request, error) { - var err error + if params.XIdempotencyKey != nil { + var headerParam0 string - var pathParam0 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) + } - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "network", runtime.ParamLocationPath, network) - if err != nil { - return nil, err } - var pathParam1 string + return req, nil +} - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "address", runtime.ParamLocationPath, address) - if err != nil { - return nil, err - } +// 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 } - operationPath := fmt.Sprintf("/v2/solana/token-balances/%s/%s", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/v2/evm/swaps/quote") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -13924,9 +14998,69 @@ func NewListSolanaTokenBalancesRequest(server string, network ListSolanaTokenBal if params != nil { queryValues := queryURL.Query() - if params.PageSize != nil { + 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, "pageSize", runtime.ParamLocationQuery, *params.PageSize); err != nil { + 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 { + + 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 @@ -13940,9 +15074,25 @@ func NewListSolanaTokenBalancesRequest(server string, network ListSolanaTokenBal } - if params.PageToken != nil { + if params.GasPrice != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "pageToken", runtime.ParamLocationQuery, *params.PageToken); err != nil { + 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) + } + } + } + + } + + if params.SlippageBps != nil { + + 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 @@ -13967,56 +15117,30 @@ func NewListSolanaTokenBalancesRequest(server string, network ListSolanaTokenBal return req, nil } -// 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 - } - 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) { +// NewListEvmTokenBalancesRequest generates requests for ListEvmTokenBalances +func NewListEvmTokenBalancesRequest(server string, network ListEvmTokenBalancesNetwork, address string, params *ListEvmTokenBalancesParams) (*http.Request, error) { var err error - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/v2/x402/settle") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } + var pathParam0 string - queryURL, err := serverURL.Parse(operationPath) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "network", runtime.ParamLocationPath, network) if err != nil { return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), body) + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "address", runtime.ParamLocationPath, address) 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) { - var err error - serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/v2/x402/supported") + operationPath := fmt.Sprintf("/v2/evm/token-balances/%s/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -14026,27 +15150,65 @@ func NewSupportedX402PaymentKindsRequest(server string) (*http.Request, error) { return nil, err } - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } + if params != nil { + queryValues := queryURL.Query() - return req, nil -} + if params.PageSize != nil { -// NewVerifyX402PaymentRequest calls the generic VerifyX402Payment builder with application/json body -func NewVerifyX402PaymentRequest(server string, body VerifyX402PaymentJSONRequestBody) (*http.Request, 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) + } + } + } + + } + + 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 + } + + return req, nil +} + +// 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 NewVerifyX402PaymentRequestWithBody(server, "application/json", bodyReader) + return NewGetOnrampUserLimitsRequestWithBody(server, "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) { +// 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 serverURL, err := url.Parse(server) @@ -14054,7 +15216,7 @@ func NewVerifyX402PaymentRequestWithBody(server string, contentType string, body return nil, err } - operationPath := fmt.Sprintf("/v2/x402/verify") + operationPath := fmt.Sprintf("/v2/onramp/limits") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -14074,1916 +15236,4336 @@ func NewVerifyX402PaymentRequestWithBody(server string, contentType string, body return req, 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 - } +// 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 } - return nil + bodyReader = bytes.NewReader(buf) + return NewCreateOnrampOrderRequestWithBody(server, "application/json", bodyReader) } -// ClientWithResponses builds on ClientInterface to offer response payloads -type ClientWithResponses struct { - ClientInterface -} +// 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 -// 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...) + 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/onramp/orders") + 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) - - // ListTokensForAccountWithResponse request - ListTokensForAccountWithResponse(ctx context.Context, network ListTokensForAccountParamsNetwork, address string, reqEditors ...RequestEditorFn) (*ListTokensForAccountResponse, error) - - // GetSQLGrammarWithResponse request - GetSQLGrammarWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetSQLGrammarResponse, error) - // RunSQLQueryWithBodyWithResponse request with any body - RunSQLQueryWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RunSQLQueryResponse, error) + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } - RunSQLQueryWithResponse(ctx context.Context, body RunSQLQueryJSONRequestBody, reqEditors ...RequestEditorFn) (*RunSQLQueryResponse, error) + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } - // ListWebhookSubscriptionsWithResponse request - ListWebhookSubscriptionsWithResponse(ctx context.Context, params *ListWebhookSubscriptionsParams, reqEditors ...RequestEditorFn) (*ListWebhookSubscriptionsResponse, error) + req.Header.Add("Content-Type", contentType) - // CreateWebhookSubscriptionWithBodyWithResponse request with any body - CreateWebhookSubscriptionWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateWebhookSubscriptionResponse, error) + return req, nil +} - CreateWebhookSubscriptionWithResponse(ctx context.Context, body CreateWebhookSubscriptionJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateWebhookSubscriptionResponse, error) +// NewGetOnrampOrderByIdRequest generates requests for GetOnrampOrderById +func NewGetOnrampOrderByIdRequest(server string, orderId string) (*http.Request, error) { + var err error - // DeleteWebhookSubscriptionWithResponse request - DeleteWebhookSubscriptionWithResponse(ctx context.Context, subscriptionId openapi_types.UUID, reqEditors ...RequestEditorFn) (*DeleteWebhookSubscriptionResponse, error) + var pathParam0 string - // GetWebhookSubscriptionWithResponse request - GetWebhookSubscriptionWithResponse(ctx context.Context, subscriptionId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetWebhookSubscriptionResponse, error) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "orderId", runtime.ParamLocationPath, orderId) + if err != nil { + return nil, err + } - // UpdateWebhookSubscriptionWithBodyWithResponse request with any body - UpdateWebhookSubscriptionWithBodyWithResponse(ctx context.Context, subscriptionId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateWebhookSubscriptionResponse, error) + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } - UpdateWebhookSubscriptionWithResponse(ctx context.Context, subscriptionId openapi_types.UUID, body UpdateWebhookSubscriptionJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateWebhookSubscriptionResponse, error) + operationPath := fmt.Sprintf("/v2/onramp/orders/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } - // ListEndUsersWithResponse request - ListEndUsersWithResponse(ctx context.Context, params *ListEndUsersParams, reqEditors ...RequestEditorFn) (*ListEndUsersResponse, error) + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } - // CreateEndUserWithBodyWithResponse request with any body - CreateEndUserWithBodyWithResponse(ctx context.Context, params *CreateEndUserParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateEndUserResponse, error) + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } - CreateEndUserWithResponse(ctx context.Context, params *CreateEndUserParams, body CreateEndUserJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateEndUserResponse, error) + return req, nil +} - // ValidateEndUserAccessTokenWithBodyWithResponse request with any body - ValidateEndUserAccessTokenWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ValidateEndUserAccessTokenResponse, 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) +} - ValidateEndUserAccessTokenWithResponse(ctx context.Context, body ValidateEndUserAccessTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*ValidateEndUserAccessTokenResponse, 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 - // ImportEndUserWithBodyWithResponse request with any body - ImportEndUserWithBodyWithResponse(ctx context.Context, params *ImportEndUserParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ImportEndUserResponse, error) + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } - ImportEndUserWithResponse(ctx context.Context, params *ImportEndUserParams, body ImportEndUserJSONRequestBody, reqEditors ...RequestEditorFn) (*ImportEndUserResponse, error) + operationPath := fmt.Sprintf("/v2/onramp/sessions") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } - // GetEndUserWithResponse request - GetEndUserWithResponse(ctx context.Context, userId string, reqEditors ...RequestEditorFn) (*GetEndUserResponse, error) + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } - // AddEndUserEvmAccountWithBodyWithResponse request with any body - AddEndUserEvmAccountWithBodyWithResponse(ctx context.Context, userId string, params *AddEndUserEvmAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AddEndUserEvmAccountResponse, error) + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } - AddEndUserEvmAccountWithResponse(ctx context.Context, userId string, params *AddEndUserEvmAccountParams, body AddEndUserEvmAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*AddEndUserEvmAccountResponse, error) + req.Header.Add("Content-Type", contentType) - // AddEndUserEvmSmartAccountWithBodyWithResponse request with any body - AddEndUserEvmSmartAccountWithBodyWithResponse(ctx context.Context, userId string, params *AddEndUserEvmSmartAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AddEndUserEvmSmartAccountResponse, error) + return req, nil +} - AddEndUserEvmSmartAccountWithResponse(ctx context.Context, userId string, params *AddEndUserEvmSmartAccountParams, body AddEndUserEvmSmartAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*AddEndUserEvmSmartAccountResponse, error) +// NewListPoliciesRequest generates requests for ListPolicies +func NewListPoliciesRequest(server string, params *ListPoliciesParams) (*http.Request, error) { + var err error - // 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/policy-engine/policies") + 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) + if params.Scope != nil { - // UpdateEvmAccountWithBodyWithResponse request with any body - UpdateEvmAccountWithBodyWithResponse(ctx context.Context, address string, params *UpdateEvmAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateEvmAccountResponse, 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) + } + } + } - 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) + queryURL.RawQuery = queryValues.Encode() + } - CreateEvmEip7702DelegationWithResponse(ctx context.Context, address string, params *CreateEvmEip7702DelegationParams, body CreateEvmEip7702DelegationJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateEvmEip7702DelegationResponse, error) + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } - // ExportEvmAccountWithBodyWithResponse request with any body - ExportEvmAccountWithBodyWithResponse(ctx context.Context, address string, params *ExportEvmAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ExportEvmAccountResponse, error) + return req, nil +} - ExportEvmAccountWithResponse(ctx context.Context, address string, params *ExportEvmAccountParams, body ExportEvmAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*ExportEvmAccountResponse, 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) +} - // SendEvmTransactionWithBodyWithResponse request with any body - SendEvmTransactionWithBodyWithResponse(ctx context.Context, address string, params *SendEvmTransactionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SendEvmTransactionResponse, 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 - SendEvmTransactionWithResponse(ctx context.Context, address string, params *SendEvmTransactionParams, body SendEvmTransactionJSONRequestBody, reqEditors ...RequestEditorFn) (*SendEvmTransactionResponse, error) + serverURL, err := url.Parse(server) + 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) + operationPath := fmt.Sprintf("/v2/policy-engine/policies") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } - SignEvmHashWithResponse(ctx context.Context, address string, params *SignEvmHashParams, body SignEvmHashJSONRequestBody, reqEditors ...RequestEditorFn) (*SignEvmHashResponse, error) + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } - // SignEvmMessageWithBodyWithResponse request with any body - SignEvmMessageWithBodyWithResponse(ctx context.Context, address string, params *SignEvmMessageParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SignEvmMessageResponse, error) + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } - SignEvmMessageWithResponse(ctx context.Context, address string, params *SignEvmMessageParams, body SignEvmMessageJSONRequestBody, reqEditors ...RequestEditorFn) (*SignEvmMessageResponse, error) + req.Header.Add("Content-Type", contentType) - // SignEvmTransactionWithBodyWithResponse request with any body - SignEvmTransactionWithBodyWithResponse(ctx context.Context, address string, params *SignEvmTransactionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SignEvmTransactionResponse, error) + if params != nil { - SignEvmTransactionWithResponse(ctx context.Context, address string, params *SignEvmTransactionParams, body SignEvmTransactionJSONRequestBody, reqEditors ...RequestEditorFn) (*SignEvmTransactionResponse, error) + if params.XIdempotencyKey != nil { + var headerParam0 string - // SignEvmTypedDataWithBodyWithResponse request with any body - SignEvmTypedDataWithBodyWithResponse(ctx context.Context, address string, params *SignEvmTypedDataParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SignEvmTypedDataResponse, error) + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Idempotency-Key", runtime.ParamLocationHeader, *params.XIdempotencyKey) + if err != nil { + return nil, err + } - SignEvmTypedDataWithResponse(ctx context.Context, address string, params *SignEvmTypedDataParams, body SignEvmTypedDataJSONRequestBody, reqEditors ...RequestEditorFn) (*SignEvmTypedDataResponse, error) + req.Header.Set("X-Idempotency-Key", headerParam0) + } - // 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) + return req, nil +} - RequestEvmFaucetWithResponse(ctx context.Context, body RequestEvmFaucetJSONRequestBody, reqEditors ...RequestEditorFn) (*RequestEvmFaucetResponse, error) +// NewDeletePolicyRequest generates requests for DeletePolicy +func NewDeletePolicyRequest(server string, policyId string, params *DeletePolicyParams) (*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, "policyId", runtime.ParamLocationPath, policyId) + 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/policy-engine/policies/%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("DELETE", queryURL.String(), nil) + if err != nil { + return nil, err + } - UpdateEvmSmartAccountWithResponse(ctx context.Context, address string, body UpdateEvmSmartAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateEvmSmartAccountResponse, error) + if params != nil { - // CreateSpendPermissionWithBodyWithResponse request with any body - CreateSpendPermissionWithBodyWithResponse(ctx context.Context, address string, params *CreateSpendPermissionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateSpendPermissionResponse, error) + if params.XIdempotencyKey != nil { + var headerParam0 string - CreateSpendPermissionWithResponse(ctx context.Context, address string, params *CreateSpendPermissionParams, body CreateSpendPermissionJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateSpendPermissionResponse, error) + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Idempotency-Key", runtime.ParamLocationHeader, *params.XIdempotencyKey) + if err != nil { + return nil, err + } - // ListSpendPermissionsWithResponse request - ListSpendPermissionsWithResponse(ctx context.Context, address string, params *ListSpendPermissionsParams, reqEditors ...RequestEditorFn) (*ListSpendPermissionsResponse, error) + req.Header.Set("X-Idempotency-Key", headerParam0) + } - // 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) + return req, nil +} - // PrepareUserOperationWithBodyWithResponse request with any body - PrepareUserOperationWithBodyWithResponse(ctx context.Context, address string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PrepareUserOperationResponse, error) +// NewGetPolicyByIdRequest generates requests for GetPolicyById +func NewGetPolicyByIdRequest(server string, policyId string) (*http.Request, error) { + var err error - PrepareUserOperationWithResponse(ctx context.Context, address string, body PrepareUserOperationJSONRequestBody, reqEditors ...RequestEditorFn) (*PrepareUserOperationResponse, error) + var pathParam0 string - // PrepareAndSendUserOperationWithBodyWithResponse request with any body - PrepareAndSendUserOperationWithBodyWithResponse(ctx context.Context, address string, params *PrepareAndSendUserOperationParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PrepareAndSendUserOperationResponse, error) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "policyId", runtime.ParamLocationPath, policyId) + if err != nil { + return nil, err + } - PrepareAndSendUserOperationWithResponse(ctx context.Context, address string, params *PrepareAndSendUserOperationParams, body PrepareAndSendUserOperationJSONRequestBody, reqEditors ...RequestEditorFn) (*PrepareAndSendUserOperationResponse, error) + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } - // GetUserOperationWithResponse request - GetUserOperationWithResponse(ctx context.Context, address string, userOpHash string, reqEditors ...RequestEditorFn) (*GetUserOperationResponse, error) + operationPath := fmt.Sprintf("/v2/policy-engine/policies/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } - // SendUserOperationWithBodyWithResponse request with any body - SendUserOperationWithBodyWithResponse(ctx context.Context, address string, userOpHash string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SendUserOperationResponse, error) + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } - SendUserOperationWithResponse(ctx context.Context, address string, userOpHash string, body SendUserOperationJSONRequestBody, reqEditors ...RequestEditorFn) (*SendUserOperationResponse, error) + req, err := http.NewRequest("GET", queryURL.String(), nil) + 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) + return req, nil +} - CreateEvmSwapQuoteWithResponse(ctx context.Context, params *CreateEvmSwapQuoteParams, body CreateEvmSwapQuoteJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateEvmSwapQuoteResponse, error) +// 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 + } + bodyReader = bytes.NewReader(buf) + return NewUpdatePolicyRequestWithBody(server, policyId, params, "application/json", bodyReader) +} - // GetEvmSwapPriceWithResponse request - GetEvmSwapPriceWithResponse(ctx context.Context, params *GetEvmSwapPriceParams, reqEditors ...RequestEditorFn) (*GetEvmSwapPriceResponse, error) +// 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 - // ListEvmTokenBalancesWithResponse request - ListEvmTokenBalancesWithResponse(ctx context.Context, network ListEvmTokenBalancesNetwork, address string, params *ListEvmTokenBalancesParams, reqEditors ...RequestEditorFn) (*ListEvmTokenBalancesResponse, error) + var pathParam0 string - // GetOnrampUserLimitsWithBodyWithResponse request with any body - GetOnrampUserLimitsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*GetOnrampUserLimitsResponse, error) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "policyId", runtime.ParamLocationPath, policyId) + if err != nil { + return nil, err + } - GetOnrampUserLimitsWithResponse(ctx context.Context, body GetOnrampUserLimitsJSONRequestBody, reqEditors ...RequestEditorFn) (*GetOnrampUserLimitsResponse, error) + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } - // CreateOnrampOrderWithBodyWithResponse request with any body - CreateOnrampOrderWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateOnrampOrderResponse, error) + operationPath := fmt.Sprintf("/v2/policy-engine/policies/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } - CreateOnrampOrderWithResponse(ctx context.Context, body CreateOnrampOrderJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateOnrampOrderResponse, error) + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } - // GetOnrampOrderByIdWithResponse request - GetOnrampOrderByIdWithResponse(ctx context.Context, orderId string, reqEditors ...RequestEditorFn) (*GetOnrampOrderByIdResponse, error) + req, err := http.NewRequest("PUT", queryURL.String(), body) + if err != nil { + return nil, err + } - // CreateOnrampSessionWithBodyWithResponse request with any body - CreateOnrampSessionWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateOnrampSessionResponse, error) + req.Header.Add("Content-Type", contentType) - CreateOnrampSessionWithResponse(ctx context.Context, body CreateOnrampSessionJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateOnrampSessionResponse, error) + if params != nil { - // ListPoliciesWithResponse request - ListPoliciesWithResponse(ctx context.Context, params *ListPoliciesParams, reqEditors ...RequestEditorFn) (*ListPoliciesResponse, error) + if params.XIdempotencyKey != nil { + var headerParam0 string - // CreatePolicyWithBodyWithResponse request with any body - CreatePolicyWithBodyWithResponse(ctx context.Context, params *CreatePolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreatePolicyResponse, error) + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Idempotency-Key", runtime.ParamLocationHeader, *params.XIdempotencyKey) + if err != nil { + return nil, err + } - CreatePolicyWithResponse(ctx context.Context, params *CreatePolicyParams, body CreatePolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*CreatePolicyResponse, error) + req.Header.Set("X-Idempotency-Key", headerParam0) + } - // 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) + return req, nil +} - // UpdatePolicyWithBodyWithResponse request with any body - UpdatePolicyWithBodyWithResponse(ctx context.Context, policyId string, params *UpdatePolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdatePolicyResponse, error) +// NewListSolanaAccountsRequest generates requests for ListSolanaAccounts +func NewListSolanaAccountsRequest(server string, params *ListSolanaAccountsParams) (*http.Request, error) { + var err error - UpdatePolicyWithResponse(ctx context.Context, policyId string, params *UpdatePolicyParams, body UpdatePolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdatePolicyResponse, error) + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } - // ListSolanaAccountsWithResponse request - ListSolanaAccountsWithResponse(ctx context.Context, params *ListSolanaAccountsParams, reqEditors ...RequestEditorFn) (*ListSolanaAccountsResponse, error) + operationPath := fmt.Sprintf("/v2/solana/accounts") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } - // CreateSolanaAccountWithBodyWithResponse request with any body - CreateSolanaAccountWithBodyWithResponse(ctx context.Context, params *CreateSolanaAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateSolanaAccountResponse, error) + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } - CreateSolanaAccountWithResponse(ctx context.Context, params *CreateSolanaAccountParams, body CreateSolanaAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateSolanaAccountResponse, error) + if params != nil { + queryValues := queryURL.Query() - // GetSolanaAccountByNameWithResponse request - GetSolanaAccountByNameWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*GetSolanaAccountByNameResponse, error) + if params.PageSize != nil { - // ExportSolanaAccountByNameWithBodyWithResponse request with any body - ExportSolanaAccountByNameWithBodyWithResponse(ctx context.Context, name string, params *ExportSolanaAccountByNameParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ExportSolanaAccountByNameResponse, 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) + } + } + } - 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) + if params.PageToken != nil { - ImportSolanaAccountWithResponse(ctx context.Context, params *ImportSolanaAccountParams, body ImportSolanaAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*ImportSolanaAccountResponse, 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) + } + } + } - // 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) + queryURL.RawQuery = queryValues.Encode() + } - // GetSolanaAccountWithResponse request - GetSolanaAccountWithResponse(ctx context.Context, address string, reqEditors ...RequestEditorFn) (*GetSolanaAccountResponse, error) + req, err := http.NewRequest("GET", queryURL.String(), nil) + 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) + return req, nil +} - UpdateSolanaAccountWithResponse(ctx context.Context, address string, params *UpdateSolanaAccountParams, body UpdateSolanaAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateSolanaAccountResponse, error) +// 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 + } + bodyReader = bytes.NewReader(buf) + return NewCreateSolanaAccountRequestWithBody(server, params, "application/json", bodyReader) +} - // ExportSolanaAccountWithBodyWithResponse request with any body - ExportSolanaAccountWithBodyWithResponse(ctx context.Context, address string, params *ExportSolanaAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ExportSolanaAccountResponse, error) +// 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 - 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/solana/accounts") + 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("POST", queryURL.String(), body) + if err != nil { + return nil, err + } - SignSolanaTransactionWithResponse(ctx context.Context, address string, params *SignSolanaTransactionParams, body SignSolanaTransactionJSONRequestBody, reqEditors ...RequestEditorFn) (*SignSolanaTransactionResponse, error) + req.Header.Add("Content-Type", contentType) - // RequestSolanaFaucetWithBodyWithResponse request with any body - RequestSolanaFaucetWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RequestSolanaFaucetResponse, error) + if params != nil { - RequestSolanaFaucetWithResponse(ctx context.Context, body RequestSolanaFaucetJSONRequestBody, reqEditors ...RequestEditorFn) (*RequestSolanaFaucetResponse, error) + if params.XWalletAuth != nil { + var headerParam0 string - // ListSolanaTokenBalancesWithResponse request - ListSolanaTokenBalancesWithResponse(ctx context.Context, network ListSolanaTokenBalancesNetwork, address string, params *ListSolanaTokenBalancesParams, reqEditors ...RequestEditorFn) (*ListSolanaTokenBalancesResponse, error) + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Wallet-Auth", runtime.ParamLocationHeader, *params.XWalletAuth) + if err != nil { + return nil, err + } - // SettleX402PaymentWithBodyWithResponse request with any body - SettleX402PaymentWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SettleX402PaymentResponse, error) + req.Header.Set("X-Wallet-Auth", headerParam0) + } - SettleX402PaymentWithResponse(ctx context.Context, body SettleX402PaymentJSONRequestBody, reqEditors ...RequestEditorFn) (*SettleX402PaymentResponse, error) + if params.XIdempotencyKey != nil { + var headerParam1 string - // SupportedX402PaymentKindsWithResponse request - SupportedX402PaymentKindsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*SupportedX402PaymentKindsResponse, error) + headerParam1, err = runtime.StyleParamWithLocation("simple", false, "X-Idempotency-Key", runtime.ParamLocationHeader, *params.XIdempotencyKey) + if err != nil { + return nil, err + } - // VerifyX402PaymentWithBodyWithResponse request with any body - VerifyX402PaymentWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*VerifyX402PaymentResponse, error) + req.Header.Set("X-Idempotency-Key", headerParam1) + } - VerifyX402PaymentWithResponse(ctx context.Context, body VerifyX402PaymentJSONRequestBody, reqEditors ...RequestEditorFn) (*VerifyX402PaymentResponse, error) + } + + return req, nil } -type ListDataTokenBalancesResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - // Balances The list of EVM token balances. - Balances []TokenBalance `json:"balances"` +// NewGetSolanaAccountByNameRequest generates requests for GetSolanaAccountByName +func NewGetSolanaAccountByNameRequest(server string, name string) (*http.Request, error) { + var err error - // 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 -} + var pathParam0 string -// Status returns HTTPResponse.Status -func (r ListDataTokenBalancesResponse) 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 ListDataTokenBalancesResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode + serverURL, err := url.Parse(server) + 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 -} + operationPath := fmt.Sprintf("/v2/solana/accounts/by-name/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } -// Status returns HTTPResponse.Status -func (r ListTokensForAccountResponse) 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 ListTokensForAccountResponse) 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 GetSQLGrammarResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *string - JSON401 *UnauthorizedError - JSON429 *Error - JSON500 *InternalServerError - JSON504 *TimedOutError + return req, nil } -// Status returns HTTPResponse.Status -func (r GetSQLGrammarResponse) 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 GetSQLGrammarResponse) 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 RunSQLQueryResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *OnchainDataResult - JSON400 *InvalidSQLQueryError - JSON401 *UnauthorizedError - JSON408 *Error - JSON429 *Error - JSON499 *ClientClosedRequestError - JSON500 *InternalServerError - JSON504 *TimedOutError -} + var pathParam0 string -// Status returns HTTPResponse.Status -func (r RunSQLQueryResponse) 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 RunSQLQueryResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode + serverURL, err := url.Parse(server) + 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 -} -// Status returns HTTPResponse.Status -func (r ListWebhookSubscriptionsResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status + operationPath := fmt.Sprintf("/v2/solana/accounts/export/by-name/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath } - return http.StatusText(0) -} -// StatusCode returns HTTPResponse.StatusCode -func (r ListWebhookSubscriptionsResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err } - 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 + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err } - return http.StatusText(0) -} -// StatusCode returns HTTPResponse.StatusCode -func (r CreateWebhookSubscriptionResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} + req.Header.Add("Content-Type", contentType) -type DeleteWebhookSubscriptionResponse struct { - Body []byte - HTTPResponse *http.Response - JSON401 *UnauthorizedError - JSON404 *Error - JSON429 *Error - JSON500 *InternalServerError -} + if params != nil { -// Status returns HTTPResponse.Status -func (r DeleteWebhookSubscriptionResponse) 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 DeleteWebhookSubscriptionResponse) 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 GetWebhookSubscriptionResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *WebhookSubscriptionResponse - JSON401 *UnauthorizedError - JSON404 *Error - JSON429 *Error - JSON500 *InternalServerError -} + req.Header.Set("X-Wallet-Auth", headerParam0) + } -// Status returns HTTPResponse.Status -func (r GetWebhookSubscriptionResponse) 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 GetWebhookSubscriptionResponse) 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 UpdateWebhookSubscriptionResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *WebhookSubscriptionResponse - JSON400 *Error - JSON401 *UnauthorizedError - JSON404 *Error - JSON429 *Error - JSON500 *InternalServerError -} + req.Header.Set("X-Idempotency-Key", headerParam1) + } -// Status returns HTTPResponse.Status -func (r UpdateWebhookSubscriptionResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status } - return http.StatusText(0) + + return req, nil } -// StatusCode returns HTTPResponse.StatusCode -func (r UpdateWebhookSubscriptionResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// 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 0 + bodyReader = bytes.NewReader(buf) + return NewImportSolanaAccountRequestWithBody(server, params, "application/json", bodyReader) } -type ListEndUsersResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - // EndUsers The list of end users. - EndUsers []EndUser `json:"endUsers"` +// 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 - // NextPageToken The token for the next page of items, if any. - NextPageToken *string `json:"nextPageToken,omitempty"` + serverURL, err := url.Parse(server) + 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 + operationPath := fmt.Sprintf("/v2/solana/accounts/import") + if operationPath[0] == '/' { + operationPath = "." + operationPath } - return http.StatusText(0) -} -// StatusCode returns HTTPResponse.StatusCode -func (r ListEndUsersResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err } - 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 + req, err := http.NewRequest("POST", queryURL.String(), body) + 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 - } - return 0 -} + req.Header.Add("Content-Type", contentType) -type ValidateEndUserAccessTokenResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *EndUser - JSON400 *Error - JSON401 *Error - JSON404 *Error - JSON500 *InternalServerError -} + if params != nil { -// Status returns HTTPResponse.Status -func (r ValidateEndUserAccessTokenResponse) 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 ValidateEndUserAccessTokenResponse) 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 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 -} + 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) + } -// Status returns HTTPResponse.Status -func (r ImportEndUserResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status } - return http.StatusText(0) + + return req, nil } -// StatusCode returns HTTPResponse.StatusCode -func (r ImportEndUserResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// 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 0 + bodyReader = bytes.NewReader(buf) + return NewSendSolanaTransactionRequestWithBody(server, params, "application/json", bodyReader) } -type GetEndUserResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *EndUser - JSON404 *Error - JSON500 *InternalServerError -} +// 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 GetEndUserResponse) 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 GetEndUserResponse) 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 AddEndUserEvmAccountResponse struct { - Body []byte - HTTPResponse *http.Response - JSON201 *struct { - // EvmAccount Information about an EVM account associated with an end user. - EvmAccount EndUserEvmAccount `json:"evmAccount"` + queryURL, err := serverURL.Parse(operationPath) + 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 AddEndUserEvmAccountResponse) 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 AddEndUserEvmAccountResponse) 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 + + return req, nil } -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"` +// 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 } - 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 + serverURL, err := url.Parse(server) + if err != nil { + return nil, err } - return http.StatusText(0) -} -// StatusCode returns HTTPResponse.StatusCode -func (r AddEndUserEvmSmartAccountResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode + operationPath := fmt.Sprintf("/v2/solana/accounts/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath } - 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"` + queryURL, err := serverURL.Parse(operationPath) + 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 AddEndUserSolanaAccountResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err } - return http.StatusText(0) + + return req, nil } -// StatusCode returns HTTPResponse.StatusCode -func (r AddEndUserSolanaAccountResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// 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 0 + bodyReader = bytes.NewReader(buf) + return NewUpdateSolanaAccountRequestWithBody(server, address, params, "application/json", bodyReader) } -type ListEvmAccountsResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - // Accounts The list of EVM accounts. - Accounts []EvmAccount `json:"accounts"` +// 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 - // NextPageToken The token for the next page of items, if any. - NextPageToken *string `json:"nextPageToken,omitempty"` - } - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError -} + var pathParam0 string -// Status returns HTTPResponse.Status -func (r ListEvmAccountsResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status + 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 ListEvmAccountsResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode + serverURL, err := url.Parse(server) + if err != nil { + return nil, err } - 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 -} + operationPath := fmt.Sprintf("/v2/solana/accounts/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } -// Status returns HTTPResponse.Status -func (r CreateEvmAccountResponse) 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 CreateEvmAccountResponse) 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 GetEvmAccountByNameResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *EvmAccount - JSON400 *Error - JSON404 *Error - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError -} + req.Header.Add("Content-Type", contentType) -// Status returns HTTPResponse.Status -func (r GetEvmAccountByNameResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} + if params != nil { -// StatusCode returns HTTPResponse.StatusCode -func (r GetEvmAccountByNameResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} + if params.XIdempotencyKey != nil { + var headerParam0 string -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 -} + 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) + } -// Status returns HTTPResponse.Status -func (r ExportEvmAccountByNameResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status } - return http.StatusText(0) + + return req, nil } -// StatusCode returns HTTPResponse.StatusCode -func (r ExportEvmAccountByNameResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// 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 } - return 0 + bodyReader = bytes.NewReader(buf) + return NewExportSolanaAccountRequestWithBody(server, address, params, "application/json", bodyReader) } -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 -} +// 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 -// Status returns HTTPResponse.Status -func (r ImportEvmAccountResponse) 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 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/export", 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("POST", queryURL.String(), body) + 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 -} + 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) + } -// Status returns HTTPResponse.Status -func (r UpdateEvmAccountResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status } - return http.StatusText(0) + + return req, nil } -// StatusCode returns HTTPResponse.StatusCode -func (r UpdateEvmAccountResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// 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 0 + bodyReader = bytes.NewReader(buf) + return NewSignSolanaMessageRequestWithBody(server, address, params, "application/json", bodyReader) } -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"` +// 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 } - 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 + serverURL, err := url.Parse(server) + if err != nil { + return nil, err } - return http.StatusText(0) -} -// StatusCode returns HTTPResponse.StatusCode -func (r CreateEvmEip7702DelegationResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode + operationPath := fmt.Sprintf("/v2/solana/accounts/%s/sign/message", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath } - 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"` + queryURL, err := serverURL.Parse(operationPath) + 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 + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err } - return http.StatusText(0) -} -// StatusCode returns HTTPResponse.StatusCode -func (r ExportEvmAccountResponse) 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 + + 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"` +// 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 } - 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 NewSignSolanaTransactionRequestWithBody(server, address, params, "application/json", bodyReader) } -// Status returns HTTPResponse.Status -func (r SendEvmTransactionResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// 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 + + 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/sign/transaction", 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 +// 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 http.StatusText(0) + bodyReader = bytes.NewReader(buf) + return NewRequestSolanaFaucetRequestWithBody(server, "application/json", bodyReader) } -// StatusCode returns HTTPResponse.StatusCode -func (r SignEvmMessageResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// 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 + + serverURL, err := url.Parse(server) + 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"` + operationPath := fmt.Sprintf("/v2/solana/faucet") + if operationPath[0] == '/' { + operationPath = "." + operationPath } - 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 + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err } - return http.StatusText(0) -} -// StatusCode returns HTTPResponse.StatusCode -func (r SignEvmTransactionResponse) 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 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 -} + req.Header.Add("Content-Type", contentType) -// Status returns HTTPResponse.Status -func (r SignEvmTypedDataResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) + return req, nil } -// StatusCode returns HTTPResponse.StatusCode -func (r SignEvmTypedDataResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} +// NewListSolanaTokenBalancesRequest generates requests for ListSolanaTokenBalances +func NewListSolanaTokenBalancesRequest(server string, network ListSolanaTokenBalancesNetwork, address string, params *ListSolanaTokenBalancesParams) (*http.Request, error) { + var err error -type GetEvmEip7702DelegationOperationByIdResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *EvmEip7702DelegationOperation - JSON400 *Error - JSON404 *Error - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError -} + var pathParam0 string -// Status returns HTTPResponse.Status -func (r GetEvmEip7702DelegationOperationByIdResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "network", runtime.ParamLocationPath, network) + 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 + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "address", runtime.ParamLocationPath, address) + 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"` + serverURL, err := url.Parse(server) + if err != nil { + return nil, err } - 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 + operationPath := fmt.Sprintf("/v2/solana/token-balances/%s/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath } - return http.StatusText(0) -} -// StatusCode returns HTTPResponse.StatusCode -func (r RequestEvmFaucetResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode + queryURL, err := serverURL.Parse(operationPath) + 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"` + if params != nil { + queryValues := queryURL.Query() - // NextPageToken The token for the next page of items, if any. - NextPageToken *string `json:"nextPageToken,omitempty"` + 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() } - 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 + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err } - return http.StatusText(0) + + return req, nil } -// StatusCode returns HTTPResponse.StatusCode -func (r ListEvmSmartAccountsResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// 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 0 + bodyReader = bytes.NewReader(buf) + return NewSettleX402PaymentRequestWithBody(server, "application/json", bodyReader) } -type CreateEvmSmartAccountResponse struct { - Body []byte - HTTPResponse *http.Response - JSON201 *EvmSmartAccount - JSON400 *Error - JSON402 *PaymentMethodRequiredError - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError -} +// 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 -// Status returns HTTPResponse.Status -func (r CreateEvmSmartAccountResponse) 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 CreateEvmSmartAccountResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode + operationPath := fmt.Sprintf("/v2/x402/settle") + if operationPath[0] == '/' { + operationPath = "." + operationPath } - return 0 -} -type GetEvmSmartAccountByNameResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *EvmSmartAccount - 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 GetEvmSmartAccountByNameResponse) 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) + + req.Header.Add("Content-Type", contentType) + + return req, nil } -// StatusCode returns HTTPResponse.StatusCode -func (r GetEvmSmartAccountByNameResponse) 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 GetEvmSmartAccountResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *EvmSmartAccount - JSON400 *Error - JSON404 *Error - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError -} + operationPath := fmt.Sprintf("/v2/x402/supported") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } -// Status returns HTTPResponse.Status -func (r GetEvmSmartAccountResponse) 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 GetEvmSmartAccountResponse) 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 UpdateEvmSmartAccountResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *EvmSmartAccount - JSON400 *Error - JSON404 *Error - JSON409 *AlreadyExistsError - JSON422 *IdempotencyError - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError + return req, nil } -// Status returns HTTPResponse.Status -func (r UpdateEvmSmartAccountResponse) 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 UpdateEvmSmartAccountResponse) 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 CreateSpendPermissionResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *EvmUserOperation - JSON400 *Error - JSON404 *Error - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError -} + operationPath := fmt.Sprintf("/v2/x402/verify") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } -// Status returns HTTPResponse.Status -func (r CreateSpendPermissionResponse) 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 CreateSpendPermissionResponse) 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 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"` + req.Header.Add("Content-Type", contentType) - // SpendPermissions The spend permissions for the smart account. - SpendPermissions []SpendPermissionResponseObject `json:"spendPermissions"` - } - JSON400 *Error - JSON404 *Error - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError + return req, nil } -// Status returns HTTPResponse.Status -func (r ListSpendPermissionsResponse) 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 ListSpendPermissionsResponse) 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 RevokeSpendPermissionResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *EvmUserOperation - JSON400 *Error - JSON404 *Error - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError +// ClientWithResponses builds on ClientInterface to offer response payloads +type ClientWithResponses struct { + ClientInterface } -// Status returns HTTPResponse.Status -func (r RevokeSpendPermissionResponse) 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 RevokeSpendPermissionResponse) 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 PrepareUserOperationResponse struct { - Body []byte - HTTPResponse *http.Response - JSON201 *EvmUserOperation - JSON400 *Error - JSON403 *Error - JSON404 *Error - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError -} +// 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) -// Status returns HTTPResponse.Status -func (r PrepareUserOperationResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} + // ListTokensForAccountWithResponse request + ListTokensForAccountWithResponse(ctx context.Context, network ListTokensForAccountParamsNetwork, address string, reqEditors ...RequestEditorFn) (*ListTokensForAccountResponse, error) -// StatusCode returns HTTPResponse.StatusCode -func (r PrepareUserOperationResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} + // GetSQLGrammarWithResponse request + GetSQLGrammarWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetSQLGrammarResponse, error) -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 -} + // RunSQLQueryWithBodyWithResponse request with any body + RunSQLQueryWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RunSQLQueryResponse, error) -// Status returns HTTPResponse.Status -func (r PrepareAndSendUserOperationResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} + RunSQLQueryWithResponse(ctx context.Context, body RunSQLQueryJSONRequestBody, reqEditors ...RequestEditorFn) (*RunSQLQueryResponse, error) -// StatusCode returns HTTPResponse.StatusCode -func (r PrepareAndSendUserOperationResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} + // ListWebhookSubscriptionsWithResponse request + ListWebhookSubscriptionsWithResponse(ctx context.Context, params *ListWebhookSubscriptionsParams, reqEditors ...RequestEditorFn) (*ListWebhookSubscriptionsResponse, error) -type GetUserOperationResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *EvmUserOperation - JSON400 *Error - JSON404 *Error - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError -} + // CreateWebhookSubscriptionWithBodyWithResponse request with any body + CreateWebhookSubscriptionWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateWebhookSubscriptionResponse, error) -// Status returns HTTPResponse.Status -func (r GetUserOperationResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} + CreateWebhookSubscriptionWithResponse(ctx context.Context, body CreateWebhookSubscriptionJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateWebhookSubscriptionResponse, error) -// StatusCode returns HTTPResponse.StatusCode -func (r GetUserOperationResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} + // DeleteWebhookSubscriptionWithResponse request + DeleteWebhookSubscriptionWithResponse(ctx context.Context, subscriptionId openapi_types.UUID, reqEditors ...RequestEditorFn) (*DeleteWebhookSubscriptionResponse, error) -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 -} + // GetWebhookSubscriptionWithResponse request + GetWebhookSubscriptionWithResponse(ctx context.Context, subscriptionId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetWebhookSubscriptionResponse, error) -// Status returns HTTPResponse.Status -func (r SendUserOperationResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} + // UpdateWebhookSubscriptionWithBodyWithResponse request with any body + UpdateWebhookSubscriptionWithBodyWithResponse(ctx context.Context, subscriptionId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateWebhookSubscriptionResponse, error) -// StatusCode returns HTTPResponse.StatusCode -func (r SendUserOperationResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} + UpdateWebhookSubscriptionWithResponse(ctx context.Context, subscriptionId openapi_types.UUID, body UpdateWebhookSubscriptionJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateWebhookSubscriptionResponse, error) -type CreateEvmSwapQuoteResponse struct { - Body []byte - HTTPResponse *http.Response - JSON201 *CreateSwapQuoteResponseWrapper - JSON400 *Error - JSON403 *Error - 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 CreateEvmSwapQuoteResponse) 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 CreateEvmSwapQuoteResponse) 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 GetEvmSwapPriceResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *GetSwapPriceResponseWrapper - JSON400 *Error - JSON403 *Error - 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 GetEvmSwapPriceResponse) 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 GetEvmSwapPriceResponse) 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 ListEvmTokenBalancesResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - // Balances The list of EVM token balances. - Balances []TokenBalance `json:"balances"` + // SignEvmHashWithEndUserAccountWithBodyWithResponse request with any body + SignEvmHashWithEndUserAccountWithBodyWithResponse(ctx context.Context, projectId string, userId string, params *SignEvmHashWithEndUserAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SignEvmHashWithEndUserAccountResponse, error) - // 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 -} + SignEvmHashWithEndUserAccountWithResponse(ctx context.Context, projectId string, userId string, params *SignEvmHashWithEndUserAccountParams, body SignEvmHashWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*SignEvmHashWithEndUserAccountResponse, error) -// Status returns HTTPResponse.Status -func (r ListEvmTokenBalancesResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(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) -// StatusCode returns HTTPResponse.StatusCode -func (r ListEvmTokenBalancesResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} + SignEvmMessageWithEndUserAccountWithResponse(ctx context.Context, projectId string, userId string, params *SignEvmMessageWithEndUserAccountParams, body SignEvmMessageWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*SignEvmMessageWithEndUserAccountResponse, error) -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 -} + // SignEvmTransactionWithEndUserAccountWithBodyWithResponse request with any body + SignEvmTransactionWithEndUserAccountWithBodyWithResponse(ctx context.Context, projectId string, userId string, params *SignEvmTransactionWithEndUserAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SignEvmTransactionWithEndUserAccountResponse, error) -// Status returns HTTPResponse.Status -func (r GetOnrampUserLimitsResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} + SignEvmTransactionWithEndUserAccountWithResponse(ctx context.Context, projectId string, userId string, params *SignEvmTransactionWithEndUserAccountParams, body SignEvmTransactionWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*SignEvmTransactionWithEndUserAccountResponse, error) -// StatusCode returns HTTPResponse.StatusCode -func (r GetOnrampUserLimitsResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} + // SignEvmTypedDataWithEndUserAccountWithBodyWithResponse request with any body + SignEvmTypedDataWithEndUserAccountWithBodyWithResponse(ctx context.Context, projectId string, userId string, params *SignEvmTypedDataWithEndUserAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SignEvmTypedDataWithEndUserAccountResponse, error) -type CreateOnrampOrderResponse struct { - Body []byte - HTTPResponse *http.Response - JSON201 *struct { - // Order An Onramp order. - Order OnrampOrder `json:"order"` + SignEvmTypedDataWithEndUserAccountWithResponse(ctx context.Context, projectId string, userId string, params *SignEvmTypedDataWithEndUserAccountParams, body SignEvmTypedDataWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*SignEvmTypedDataWithEndUserAccountResponse, 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 -} + // 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) -// Status returns HTTPResponse.Status -func (r CreateOnrampOrderResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} + SendUserOperationWithEndUserAccountWithResponse(ctx context.Context, projectId string, userId string, address string, params *SendUserOperationWithEndUserAccountParams, body SendUserOperationWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*SendUserOperationWithEndUserAccountResponse, error) -// StatusCode returns HTTPResponse.StatusCode -func (r CreateOnrampOrderResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} + // 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) -type GetOnrampOrderByIdResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - // Order An Onramp order. - Order OnrampOrder `json:"order"` - } - JSON401 *UnauthorizedError - JSON404 *Error - JSON429 *RateLimitExceeded -} + RevokeSpendPermissionWithEndUserAccountWithResponse(ctx context.Context, projectId string, userId string, address string, params *RevokeSpendPermissionWithEndUserAccountParams, body RevokeSpendPermissionWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*RevokeSpendPermissionWithEndUserAccountResponse, error) -// Status returns HTTPResponse.Status -func (r GetOnrampOrderByIdResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(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) -// StatusCode returns HTTPResponse.StatusCode -func (r GetOnrampOrderByIdResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} + SendEvmAssetWithEndUserAccountWithResponse(ctx context.Context, projectId string, userId string, address BlockchainAddress, asset Asset, params *SendEvmAssetWithEndUserAccountParams, body SendEvmAssetWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*SendEvmAssetWithEndUserAccountResponse, 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"` + // SendSolanaTransactionWithEndUserAccountWithBodyWithResponse request with any body + SendSolanaTransactionWithEndUserAccountWithBodyWithResponse(ctx context.Context, projectId string, userId string, params *SendSolanaTransactionWithEndUserAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SendSolanaTransactionWithEndUserAccountResponse, error) - // Session An onramp session containing a ready-to-use onramp URL. - Session OnrampSession `json:"session"` - } - JSON400 *Error - JSON401 *UnauthorizedError - JSON429 *RateLimitExceeded - JSON500 *InternalServerError -} + SendSolanaTransactionWithEndUserAccountWithResponse(ctx context.Context, projectId string, userId string, params *SendSolanaTransactionWithEndUserAccountParams, body SendSolanaTransactionWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*SendSolanaTransactionWithEndUserAccountResponse, error) -// Status returns HTTPResponse.Status -func (r CreateOnrampSessionResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} + // SignSolanaHashWithEndUserAccountWithBodyWithResponse request with any body + SignSolanaHashWithEndUserAccountWithBodyWithResponse(ctx context.Context, projectId string, userId string, params *SignSolanaHashWithEndUserAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SignSolanaHashWithEndUserAccountResponse, error) -// StatusCode returns HTTPResponse.StatusCode -func (r CreateOnrampSessionResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} + SignSolanaHashWithEndUserAccountWithResponse(ctx context.Context, projectId string, userId string, params *SignSolanaHashWithEndUserAccountParams, body SignSolanaHashWithEndUserAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*SignSolanaHashWithEndUserAccountResponse, 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"` + // SignSolanaMessageWithEndUserAccountWithBodyWithResponse request with any body + SignSolanaMessageWithEndUserAccountWithBodyWithResponse(ctx context.Context, projectId string, userId string, params *SignSolanaMessageWithEndUserAccountParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SignSolanaMessageWithEndUserAccountResponse, error) - // Policies The list of policies. - Policies []Policy `json:"policies"` - } + 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 *CreateEvmEip7702Delegation201Response + 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 *SendEvmTransaction200Response + 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 *SignEvmHash200Response + 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 *SignEvmMessage200Response + 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 *SignEvmTransaction200Response + 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 *SignEvmTypedData200Response + 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 *SendSolanaTransaction200Response + 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 *SignSolanaMessage200Response + 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 *SignSolanaTransaction200Response + 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 *CreateEvmEip7702Delegation201Response + 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 *SendEvmTransaction200Response + 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 *SignEvmHash200Response + 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 *SignEvmMessage200Response + 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 *SignEvmTransaction200Response + 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 *SignEvmTypedData200Response + 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 *SendSolanaTransaction200Response + 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 *SignSolanaMessage200Response + 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 *SignSolanaTransaction200Response + 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 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 ListPoliciesResponse) Status() string { +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 } @@ -15991,1648 +19573,2341 @@ func (r ListPoliciesResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ListPoliciesResponse) StatusCode() int { +func (r VerifyX402PaymentResponse) 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 +// 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) } -// Status returns HTTPResponse.Status -func (r CreatePolicyResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +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 http.StatusText(0) + return ParseSignSolanaTransactionWithEndUserAccountResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r CreatePolicyResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// 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 0 + return ParseSendSolanaAssetWithEndUserAccountResponse(rsp) } -type DeletePolicyResponse struct { - Body []byte - HTTPResponse *http.Response - JSON400 *Error - JSON404 *Error - JSON409 *AlreadyExistsError - JSON422 *IdempotencyError - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError +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) } -// Status returns HTTPResponse.Status -func (r DeletePolicyResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// 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 http.StatusText(0) + return ParseListEndUsersResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r DeletePolicyResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// 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 0 + return ParseCreateEndUserResponse(rsp) } -type GetPolicyByIdResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *Policy - JSON404 *Error - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError +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) } -// Status returns HTTPResponse.Status -func (r GetPolicyByIdResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// 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 http.StatusText(0) + return ParseValidateEndUserAccessTokenResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r GetPolicyByIdResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +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 0 + return ParseValidateEndUserAccessTokenResponse(rsp) } -type UpdatePolicyResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *Policy - JSON400 *Error - JSON404 *Error - JSON409 *AlreadyExistsError - JSON422 *IdempotencyError - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError +// 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) } -// Status returns HTTPResponse.Status -func (r UpdatePolicyResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +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 http.StatusText(0) + return ParseImportEndUserResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r UpdatePolicyResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// 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 0 + return ParseGetEndUserResponse(rsp) } -type ListSolanaAccountsResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - // Accounts The list of Solana accounts. - Accounts []SolanaAccount `json:"accounts"` +// 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) +} - // NextPageToken The token for the next page of items, if any. - NextPageToken *string `json:"nextPageToken,omitempty"` +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 } - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError + return ParseAddEndUserEvmAccountResponse(rsp) } -// Status returns HTTPResponse.Status -func (r ListSolanaAccountsResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// 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 http.StatusText(0) + return ParseAddEndUserEvmSmartAccountResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r ListSolanaAccountsResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +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 0 + return ParseAddEndUserEvmSmartAccountResponse(rsp) } -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 +// 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) } -// Status returns HTTPResponse.Status -func (r CreateSolanaAccountResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +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 http.StatusText(0) + return ParseAddEndUserSolanaAccountResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r CreateSolanaAccountResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// 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 0 + return ParseListEvmAccountsResponse(rsp) } -type GetSolanaAccountByNameResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *SolanaAccount - JSON400 *Error - JSON404 *Error - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError +// 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) } -// Status returns HTTPResponse.Status -func (r GetSolanaAccountByNameResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +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 http.StatusText(0) + return ParseCreateEvmAccountResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r GetSolanaAccountByNameResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// 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 0 + 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) } -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"` +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 } - JSON400 *Error - JSON401 *Error - JSON402 *PaymentMethodRequiredError - JSON404 *Error - JSON422 *IdempotencyError - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError + return ParseExportEvmAccountByNameResponse(rsp) } -// Status returns HTTPResponse.Status -func (r ExportSolanaAccountByNameResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// 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 http.StatusText(0) + return ParseImportEvmAccountResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r ExportSolanaAccountByNameResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +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 0 + return ParseImportEvmAccountResponse(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 +// 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) } -// Status returns HTTPResponse.Status -func (r ImportSolanaAccountResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// 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 ImportSolanaAccountResponse) 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 SendSolanaTransactionResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - // TransactionSignature The base58 encoded transaction signature. - TransactionSignature string `json:"transactionSignature"` +// 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 } - JSON400 *Error - JSON401 *Error - JSON402 *PaymentMethodRequiredError - JSON403 *Error - JSON404 *Error - JSON422 *IdempotencyError - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError + return ParseCreateEvmEip7702DelegationResponse(rsp) } -// Status returns HTTPResponse.Status -func (r SendSolanaTransactionResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +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 http.StatusText(0) + return ParseCreateEvmEip7702DelegationResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r SendSolanaTransactionResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// 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 0 + return ParseExportEvmAccountResponse(rsp) } -type GetSolanaAccountResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *SolanaAccount - JSON400 *Error - JSON404 *Error - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError +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) } -// Status returns HTTPResponse.Status -func (r GetSolanaAccountResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// 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 http.StatusText(0) + return ParseSendEvmTransactionResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r GetSolanaAccountResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +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 0 + return ParseSendEvmTransactionResponse(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 +// 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) } -// Status returns HTTPResponse.Status -func (r UpdateSolanaAccountResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +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 http.StatusText(0) + return ParseSignEvmHashResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r UpdateSolanaAccountResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// 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 0 + return ParseSignEvmMessageResponse(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) 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 } - JSON400 *Error - JSON401 *Error - JSON402 *PaymentMethodRequiredError - JSON404 *Error - JSON422 *IdempotencyError - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError + return ParseSignEvmMessageResponse(rsp) } -// Status returns HTTPResponse.Status -func (r ExportSolanaAccountResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// 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 http.StatusText(0) + return ParseSignEvmTransactionResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r ExportSolanaAccountResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +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 0 + return ParseSignEvmTransactionResponse(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"` - } - JSON400 *Error - JSON401 *Error - JSON402 *PaymentMethodRequiredError - JSON404 *Error - JSON409 *AlreadyExistsError - JSON422 *IdempotencyError - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError +// 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) } -// Status returns HTTPResponse.Status -func (r SignSolanaMessageResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +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 http.StatusText(0) + return ParseSignEvmTypedDataResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r SignSolanaMessageResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// 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 0 + return ParseGetEvmEip7702DelegationOperationByIdResponse(rsp) } -type SignSolanaTransactionResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - // SignedTransaction The base64 encoded signed transaction. - SignedTransaction string `json:"signedTransaction"` +// 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 } - JSON400 *Error - JSON401 *Error - JSON402 *PaymentMethodRequiredError - JSON403 *Error - JSON404 *Error - JSON409 *AlreadyExistsError - JSON422 *IdempotencyError - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError + return ParseRequestEvmFaucetResponse(rsp) } -// Status returns HTTPResponse.Status -func (r SignSolanaTransactionResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +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 http.StatusText(0) + return ParseRequestEvmFaucetResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r SignSolanaTransactionResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// 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 0 + return ParseListEvmSmartAccountsResponse(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"` +// 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 } - JSON400 *Error - JSON403 *Error - JSON429 *Error - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError + return ParseCreateEvmSmartAccountResponse(rsp) } -// Status returns HTTPResponse.Status -func (r RequestSolanaFaucetResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +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 http.StatusText(0) + return ParseCreateEvmSmartAccountResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r RequestSolanaFaucetResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// 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 0 + return ParseGetEvmSmartAccountByNameResponse(rsp) } -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"` +// 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 } - JSON400 *Error - JSON404 *Error - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError + return ParseGetEvmSmartAccountResponse(rsp) } -// Status returns HTTPResponse.Status -func (r ListSolanaTokenBalancesResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// 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 http.StatusText(0) + return ParseUpdateEvmSmartAccountResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r ListSolanaTokenBalancesResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +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 0 + return ParseUpdateEvmSmartAccountResponse(rsp) } -type SettleX402PaymentResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *X402SettleResponse - JSON400 *X402SettleError - JSON402 *PaymentMethodRequiredError - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError +// 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) } -// Status returns HTTPResponse.Status -func (r SettleX402PaymentResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +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 http.StatusText(0) + return ParseCreateSpendPermissionResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r SettleX402PaymentResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// 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 0 + return ParseListSpendPermissionsResponse(rsp) } -type SupportedX402PaymentKindsResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *X402SupportedPaymentKindsResponse - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError +// 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) } -// Status returns HTTPResponse.Status -func (r SupportedX402PaymentKindsResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +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 http.StatusText(0) + return ParseRevokeSpendPermissionResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r SupportedX402PaymentKindsResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// 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 0 + return ParsePrepareUserOperationResponse(rsp) } -type VerifyX402PaymentResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *X402VerifyResponse - JSON400 *X402VerifyInvalidError - JSON500 *InternalServerError - JSON502 *BadGatewayError - JSON503 *ServiceUnavailableError +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 ParsePrepareUserOperationResponse(rsp) } -// Status returns HTTPResponse.Status -func (r VerifyX402PaymentResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// 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 http.StatusText(0) + return ParsePrepareAndSendUserOperationResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r VerifyX402PaymentResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +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 0 + return ParsePrepareAndSendUserOperationResponse(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...) +// 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 ParseListDataTokenBalancesResponse(rsp) + return ParseGetUserOperationResponse(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...) +// 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 ParseListTokensForAccountResponse(rsp) + return ParseSendUserOperationResponse(rsp) } -// GetSQLGrammarWithResponse request returning *GetSQLGrammarResponse -func (c *ClientWithResponses) GetSQLGrammarWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetSQLGrammarResponse, error) { - rsp, err := c.GetSQLGrammar(ctx, reqEditors...) +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 ParseGetSQLGrammarResponse(rsp) + return ParseSendUserOperationResponse(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...) +// 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 ParseRunSQLQueryResponse(rsp) + return ParseCreateEvmSwapQuoteResponse(rsp) } -func (c *ClientWithResponses) RunSQLQueryWithResponse(ctx context.Context, body RunSQLQueryJSONRequestBody, reqEditors ...RequestEditorFn) (*RunSQLQueryResponse, error) { - rsp, err := c.RunSQLQuery(ctx, body, reqEditors...) +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 ParseRunSQLQueryResponse(rsp) + return ParseCreateEvmSwapQuoteResponse(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...) +// 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 ParseListWebhookSubscriptionsResponse(rsp) + return ParseGetEvmSwapPriceResponse(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...) +// 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 ParseCreateWebhookSubscriptionResponse(rsp) + return ParseListEvmTokenBalancesResponse(rsp) } -func (c *ClientWithResponses) CreateWebhookSubscriptionWithResponse(ctx context.Context, body CreateWebhookSubscriptionJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateWebhookSubscriptionResponse, error) { - rsp, err := c.CreateWebhookSubscription(ctx, body, reqEditors...) +// 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 ParseCreateWebhookSubscriptionResponse(rsp) + return ParseGetOnrampUserLimitsResponse(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...) +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 ParseDeleteWebhookSubscriptionResponse(rsp) + return ParseGetOnrampUserLimitsResponse(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...) +// 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 ParseGetWebhookSubscriptionResponse(rsp) + return ParseCreateOnrampOrderResponse(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...) +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 ParseUpdateWebhookSubscriptionResponse(rsp) + return ParseCreateOnrampOrderResponse(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...) +// 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 ParseUpdateWebhookSubscriptionResponse(rsp) + return ParseGetOnrampOrderByIdResponse(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...) +// 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 ParseListEndUsersResponse(rsp) + return ParseCreateOnrampSessionResponse(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...) +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 ParseCreateEndUserResponse(rsp) + return ParseCreateOnrampSessionResponse(rsp) } -func (c *ClientWithResponses) CreateEndUserWithResponse(ctx context.Context, params *CreateEndUserParams, body CreateEndUserJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateEndUserResponse, error) { - rsp, err := c.CreateEndUser(ctx, params, body, reqEditors...) +// 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 ParseCreateEndUserResponse(rsp) + return ParseListPoliciesResponse(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...) +// 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 ParseValidateEndUserAccessTokenResponse(rsp) + return ParseCreatePolicyResponse(rsp) } -func (c *ClientWithResponses) ValidateEndUserAccessTokenWithResponse(ctx context.Context, body ValidateEndUserAccessTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*ValidateEndUserAccessTokenResponse, error) { - rsp, err := c.ValidateEndUserAccessToken(ctx, body, reqEditors...) +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 ParseValidateEndUserAccessTokenResponse(rsp) + return ParseCreatePolicyResponse(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...) +// 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 ParseImportEndUserResponse(rsp) + return ParseDeletePolicyResponse(rsp) } -func (c *ClientWithResponses) ImportEndUserWithResponse(ctx context.Context, params *ImportEndUserParams, body ImportEndUserJSONRequestBody, reqEditors ...RequestEditorFn) (*ImportEndUserResponse, error) { - rsp, err := c.ImportEndUser(ctx, params, body, reqEditors...) +// 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 ParseImportEndUserResponse(rsp) + return ParseGetPolicyByIdResponse(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...) +// 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 ParseGetEndUserResponse(rsp) + return ParseUpdatePolicyResponse(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...) +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 ParseAddEndUserEvmAccountResponse(rsp) + return ParseUpdatePolicyResponse(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...) +// 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 ParseAddEndUserEvmAccountResponse(rsp) + return ParseListSolanaAccountsResponse(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...) +// 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 ParseAddEndUserEvmSmartAccountResponse(rsp) + return ParseCreateSolanaAccountResponse(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...) +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 ParseAddEndUserEvmSmartAccountResponse(rsp) + return ParseCreateSolanaAccountResponse(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...) +// 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 ParseAddEndUserSolanaAccountResponse(rsp) + return ParseGetSolanaAccountByNameResponse(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...) +// 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 ParseAddEndUserSolanaAccountResponse(rsp) + return ParseExportSolanaAccountByNameResponse(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...) +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 ParseListEvmAccountsResponse(rsp) + return ParseExportSolanaAccountByNameResponse(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...) +// 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 ParseCreateEvmAccountResponse(rsp) + return ParseImportSolanaAccountResponse(rsp) } -func (c *ClientWithResponses) CreateEvmAccountWithResponse(ctx context.Context, params *CreateEvmAccountParams, body CreateEvmAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateEvmAccountResponse, error) { - rsp, err := c.CreateEvmAccount(ctx, params, body, reqEditors...) +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 ParseCreateEvmAccountResponse(rsp) + return ParseImportSolanaAccountResponse(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...) +// 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 ParseGetEvmAccountByNameResponse(rsp) + return ParseSendSolanaTransactionResponse(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...) +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 ParseExportEvmAccountByNameResponse(rsp) + return ParseSendSolanaTransactionResponse(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...) +// 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 ParseExportEvmAccountByNameResponse(rsp) + return ParseGetSolanaAccountResponse(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...) +// 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 ParseImportEvmAccountResponse(rsp) + return ParseUpdateSolanaAccountResponse(rsp) } -func (c *ClientWithResponses) ImportEvmAccountWithResponse(ctx context.Context, params *ImportEvmAccountParams, body ImportEvmAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*ImportEvmAccountResponse, error) { - rsp, err := c.ImportEvmAccount(ctx, params, 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 ParseImportEvmAccountResponse(rsp) + return ParseUpdateSolanaAccountResponse(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...) +// 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 ParseGetEvmAccountResponse(rsp) + return ParseExportSolanaAccountResponse(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...) +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 ParseUpdateEvmAccountResponse(rsp) + return ParseExportSolanaAccountResponse(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...) +// 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 ParseUpdateEvmAccountResponse(rsp) + return ParseSignSolanaMessageResponse(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...) +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 ParseCreateEvmEip7702DelegationResponse(rsp) + return ParseSignSolanaMessageResponse(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...) +// 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 ParseCreateEvmEip7702DelegationResponse(rsp) + return ParseSignSolanaTransactionResponse(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...) +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 ParseExportEvmAccountResponse(rsp) + return ParseSignSolanaTransactionResponse(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...) +// 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 ParseExportEvmAccountResponse(rsp) + return ParseRequestSolanaFaucetResponse(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...) +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 ParseSendEvmTransactionResponse(rsp) + return ParseRequestSolanaFaucetResponse(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...) +// 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 ParseSendEvmTransactionResponse(rsp) + return ParseListSolanaTokenBalancesResponse(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...) +// 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 ParseSignEvmHashResponse(rsp) + return ParseSettleX402PaymentResponse(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...) +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 ParseSignEvmHashResponse(rsp) + return ParseSettleX402PaymentResponse(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...) +// 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 ParseSignEvmMessageResponse(rsp) + return ParseSupportedX402PaymentKindsResponse(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...) +// 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 ParseSignEvmMessageResponse(rsp) + return ParseVerifyX402PaymentResponse(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...) +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 ParseSignEvmTransactionResponse(rsp) + return ParseVerifyX402PaymentResponse(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...) +// 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 ParseSignEvmTransactionResponse(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 } -// 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...) +// 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 ParseSignEvmTypedDataResponse(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 } -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...) +// 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 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 + 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 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) + return response, nil } -func (c *ClientWithResponses) RequestEvmFaucetWithResponse(ctx context.Context, body RequestEvmFaucetJSONRequestBody, reqEditors ...RequestEditorFn) (*RequestEvmFaucetResponse, error) { - rsp, err := c.RequestEvmFaucet(ctx, 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 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 + response := &RunSQLQueryResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - 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) -} + 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 -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) -} + 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 -// 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) -} + 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 -// 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) -} + 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 -// 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) -} + 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 -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) -} + 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 -// 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 == 499: + var dest ClientClosedRequestError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON499 = &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 == 504: + var dest TimedOutError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON504 = &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) -} -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) + return response, nil } -// 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...) +// 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 ParsePrepareUserOperationResponse(rsp) -} -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 + response := &ListWebhookSubscriptionsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - 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 - } - return ParsePrepareAndSendUserOperationResponse(rsp) -} + 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 -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) -} + 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 -// 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 == 401: + var dest UnauthorizedError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &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 == 429: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON429 = &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 == 500: + var dest InternalServerError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &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) -} -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) + return response, nil } -// GetEvmSwapPriceWithResponse request returning *GetEvmSwapPriceResponse -func (c *ClientWithResponses) GetEvmSwapPriceWithResponse(ctx context.Context, params *GetEvmSwapPriceParams, reqEditors ...RequestEditorFn) (*GetEvmSwapPriceResponse, error) { - rsp, err := c.GetEvmSwapPrice(ctx, params, 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 ParseGetEvmSwapPriceResponse(rsp) -} -// 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 + response := &CreateWebhookSubscriptionResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - 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 + 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 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...) +// 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 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 := &DeleteWebhookSubscriptionResponse{ + 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 + 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 + + 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 ParseCreateOnrampOrderResponse(rsp) + + return response, nil } -// GetOnrampOrderByIdWithResponse request returning *GetOnrampOrderByIdResponse -func (c *ClientWithResponses) GetOnrampOrderByIdWithResponse(ctx context.Context, orderId string, reqEditors ...RequestEditorFn) (*GetOnrampOrderByIdResponse, error) { - rsp, err := c.GetOnrampOrderById(ctx, orderId, 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 ParseGetOnrampOrderByIdResponse(rsp) -} -// 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 + response := &GetWebhookSubscriptionResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseCreateOnrampSessionResponse(rsp) -} -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 + 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 == 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 ParseCreateOnrampSessionResponse(rsp) + + return response, nil } -// ListPoliciesWithResponse request returning *ListPoliciesResponse -func (c *ClientWithResponses) ListPoliciesWithResponse(ctx context.Context, params *ListPoliciesParams, reqEditors ...RequestEditorFn) (*ListPoliciesResponse, error) { - rsp, err := c.ListPolicies(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 ParseListPoliciesResponse(rsp) -} -// 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 + response := &UpdateWebhookSubscriptionResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseCreatePolicyResponse(rsp) -} -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 + 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 ParseCreatePolicyResponse(rsp) + + return response, nil } -// 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...) +// 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 ParseDeletePolicyResponse(rsp) -} -// 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 + response := &RevokeDelegationForEndUserResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseGetPolicyByIdResponse(rsp) -} -// 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 + 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 + + 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 ParseUpdatePolicyResponse(rsp) + + return response, nil } -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...) +// 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 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 + response := &CreateEvmEip7702DelegationWithEndUserAccountResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - 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 + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest CreateEvmEip7702Delegation201Response + 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 == 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 Error + 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 == 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 + } - 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...) +// 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 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 := &SendEvmTransactionWithEndUserAccountResponse{ + 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 + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest SendEvmTransaction200Response + 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 ParseExportSolanaAccountByNameResponse(rsp) -} -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) + return response, nil } -// 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...) +// 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 ParseImportSolanaAccountResponse(rsp) -} -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 + response := &SignEvmHashWithEndUserAccountResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseImportSolanaAccountResponse(rsp) -} -// 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) -} + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest SignEvmHash200Response + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &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 == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &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 == 401: + var dest UnauthorizedError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &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 == 402: + var dest PaymentMethodRequiredError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON402 = &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) -} + 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 -// 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 ParseExportSolanaAccountResponse(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) 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 ParseExportSolanaAccountResponse(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 -// 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 ParseSignSolanaMessageResponse(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) 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) -} + 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 -// 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 ParseSignSolanaTransactionResponse(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) 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 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) + return response, nil } -func (c *ClientWithResponses) RequestSolanaFaucetWithResponse(ctx context.Context, body RequestSolanaFaucetJSONRequestBody, reqEditors ...RequestEditorFn) (*RequestSolanaFaucetResponse, error) { - rsp, err := c.RequestSolanaFaucet(ctx, 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 ParseRequestSolanaFaucetResponse(rsp) -} -// 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 + response := &SignEvmMessageWithEndUserAccountResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseListSolanaTokenBalancesResponse(rsp) -} -// 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 + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest SignEvmMessage200Response + 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 == 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 ParseSettleX402PaymentResponse(rsp) -} -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) + return response, nil } -// SupportedX402PaymentKindsWithResponse request returning *SupportedX402PaymentKindsResponse -func (c *ClientWithResponses) SupportedX402PaymentKindsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*SupportedX402PaymentKindsResponse, error) { - rsp, err := c.SupportedX402PaymentKinds(ctx, 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 ParseSupportedX402PaymentKindsResponse(rsp) -} -// 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 + response := &SignEvmTransactionWithEndUserAccountResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseVerifyX402PaymentResponse(rsp) -} -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 + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest SignEvmTransaction200Response + 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 ParseVerifyX402PaymentResponse(rsp) + + return response, nil } -// ParseListDataTokenBalancesResponse parses an HTTP response from a ListDataTokenBalancesWithResponse call -func ParseListDataTokenBalancesResponse(rsp *http.Response) (*ListDataTokenBalancesResponse, error) { +// 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 } - response := &ListDataTokenBalancesResponse{ + response := &SignEvmTypedDataWithEndUserAccountResponse{ 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 SignEvmTypedData200Response if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -17645,6 +21920,20 @@ 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 == 404: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -17652,6 +21941,13 @@ func ParseListDataTokenBalancesResponse(rsp *http.Response) (*ListDataTokenBalan } 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 if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -17678,22 +21974,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) { +// 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 := &ListTokensForAccountResponse{ + response := &SendUserOperationWithEndUserAccountResponse{ 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,6 +22009,27 @@ func ParseListTokensForAccountResponse(rsp *http.Response) (*ListTokensForAccoun } 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 == 429: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -17727,32 +22044,53 @@ 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) { +// 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 := &GetSQLGrammarResponse{ + response := &RevokeSpendPermissionWithEndUserAccountResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest string + var dest EvmUserOperation 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 +22098,12 @@ 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 == 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 @@ -17774,41 +22112,54 @@ 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.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 } -// ParseRunSQLQueryResponse parses an HTTP response from a RunSQLQueryWithResponse call -func ParseRunSQLQueryResponse(rsp *http.Response) (*RunSQLQueryResponse, 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 := &RunSQLQueryResponse{ + response := &SendEvmAssetWithEndUserAccountResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest OnchainDataResult + 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 InvalidSQLQueryError + var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -17821,26 +22172,26 @@ func ParseRunSQLQueryResponse(rsp *http.Response) (*RunSQLQueryResponse, error) } response.JSON401 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 408: - 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.JSON408 = &dest + response.JSON402 = &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 +22200,41 @@ 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) { +// 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 := &ListWebhookSubscriptionsResponse{ + response := &SendSolanaTransactionWithEndUserAccountResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest WebhookSubscriptionListResponse + var dest SendSolanaTransaction200Response if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -17896,12 +22254,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 == 403: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON429 = &dest + 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 == 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 +22289,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) { +// 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 := &CreateWebhookSubscriptionResponse{ + response := &SignSolanaHashWithEndUserAccountResponse{ 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 hash, 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,12 +22346,33 @@ func ParseCreateWebhookSubscriptionResponse(rsp *http.Response) (*CreateWebhookS } 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 @@ -17964,25 +22381,53 @@ func ParseCreateWebhookSubscriptionResponse(rsp *http.Response) (*CreateWebhookS } 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 } -// ParseDeleteWebhookSubscriptionResponse parses an HTTP response from a DeleteWebhookSubscriptionWithResponse call -func ParseDeleteWebhookSubscriptionResponse(rsp *http.Response) (*DeleteWebhookSubscriptionResponse, 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 := &DeleteWebhookSubscriptionResponse{ + response := &SignSolanaMessageWithEndUserAccountResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest SignSolanaMessage200Response + 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 { @@ -17990,6 +22435,13 @@ func ParseDeleteWebhookSubscriptionResponse(rsp *http.Response) (*DeleteWebhookS } 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 { @@ -17997,12 +22449,19 @@ func ParseDeleteWebhookSubscriptionResponse(rsp *http.Response) (*DeleteWebhookS } 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 @@ -18011,32 +22470,53 @@ func ParseDeleteWebhookSubscriptionResponse(rsp *http.Response) (*DeleteWebhookS } 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 } -// 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 SignSolanaTransaction200Response 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 +22524,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 +22545,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 +22566,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 +22623,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 +22637,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 +22651,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 @@ -19204,10 +23743,7 @@ func ParseCreateEvmEip7702DelegationResponse(rsp *http.Response) (*CreateEvmEip7 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"` - } + var dest CreateEvmEip7702Delegation201Response if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -19381,10 +23917,7 @@ func ParseSendEvmTransactionResponse(rsp *http.Response) (*SendEvmTransactionRes 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"` - } + var dest SendEvmTransaction200Response if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -19480,10 +24013,7 @@ func ParseSignEvmHashResponse(rsp *http.Response) (*SignEvmHashResponse, error) 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"` - } + var dest SignEvmHash200Response if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -19565,10 +24095,7 @@ func ParseSignEvmMessageResponse(rsp *http.Response) (*SignEvmMessageResponse, e 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"` - } + var dest SignEvmMessage200Response if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -19650,10 +24177,7 @@ func ParseSignEvmTransactionResponse(rsp *http.Response) (*SignEvmTransactionRes 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"` - } + var dest SignEvmTransaction200Response if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -19749,10 +24273,7 @@ func ParseSignEvmTypedDataResponse(rsp *http.Response) (*SignEvmTypedDataRespons 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"` - } + var dest SignEvmTypedData200Response if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -21873,10 +26394,7 @@ func ParseSendSolanaTransactionResponse(rsp *http.Response) (*SendSolanaTransact switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest struct { - // TransactionSignature The base58 encoded transaction signature. - TransactionSignature string `json:"transactionSignature"` - } + var dest SendSolanaTransaction200Response if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -22186,10 +26704,7 @@ func ParseSignSolanaMessageResponse(rsp *http.Response) (*SignSolanaMessageRespo switch { 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"` - } + var dest SignSolanaMessage200Response if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -22278,10 +26793,7 @@ func ParseSignSolanaTransactionResponse(rsp *http.Response) (*SignSolanaTransact switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest struct { - // SignedTransaction The base64 encoded signed transaction. - SignedTransaction string `json:"signedTransaction"` - } + var dest SignSolanaTransaction200Response if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } diff --git a/java/changelog.d/632.feature.md b/java/changelog.d/632.feature.md new file mode 100644 index 000000000..2249e1d48 --- /dev/null +++ b/java/changelog.d/632.feature.md @@ -0,0 +1 @@ +Added EndUserClient with delegated signing and sending methods for EVM and Solana operations diff --git a/java/src/main/java/com/coinbase/cdp/CdpClient.java b/java/src/main/java/com/coinbase/cdp/CdpClient.java index 161cfe36e..df7cf11a7 100644 --- a/java/src/main/java/com/coinbase/cdp/CdpClient.java +++ b/java/src/main/java/com/coinbase/cdp/CdpClient.java @@ -8,6 +8,7 @@ import com.coinbase.cdp.auth.TokenProvider; import com.coinbase.cdp.auth.WalletJwtGenerator; import com.coinbase.cdp.auth.WalletJwtOptions; +import com.coinbase.cdp.client.enduser.EndUserClient; import com.coinbase.cdp.client.evm.EvmClient; import com.coinbase.cdp.client.policies.PoliciesClient; import com.coinbase.cdp.client.solana.SolanaClient; @@ -36,6 +37,7 @@ *

  • {@code cdp.evm()} - EVM account operations *
  • {@code cdp.solana()} - Solana account operations *
  • {@code cdp.policies()} - Policy management + *
  • {@code cdp.endUser()} - End user account and delegation operations * * *

    Example usage: @@ -107,12 +109,14 @@ public class CdpClient implements Closeable { private final ObjectMapper objectMapper; private final CdpTokenGenerator tokenGenerator; private final TokenProvider tokenProvider; + private final String projectId; private volatile boolean closed = false; // Lazily initialized namespace clients private volatile EvmClient evmClient; private volatile SolanaClient solanaClient; private volatile PoliciesClient policiesClient; + private volatile EndUserClient endUserClient; private final Object namespaceLock = new Object(); // Package-private constructor for credential-based authentication (used by builder) @@ -126,15 +130,17 @@ public class CdpClient implements Closeable { options.walletSecret(), options.expiresIn()); this.tokenProvider = null; + this.projectId = options.projectId().orElse(null); this.apiClient = buildApiClient(options); } // Package-private constructor for TokenProvider-based authentication (used by builder) - CdpClient(TokenProvider tokenProvider, HttpClientConfig config) { + CdpClient(TokenProvider tokenProvider, HttpClientConfig config, String projectId) { this.options = null; this.objectMapper = ApiClient.createDefaultObjectMapper(); this.tokenGenerator = null; this.tokenProvider = tokenProvider; + this.projectId = projectId; this.apiClient = buildApiClientWithTokens(tokenProvider, config); } @@ -147,6 +153,7 @@ public class CdpClient implements Closeable { *

  • {@code CDP_API_KEY_ID} - Required *
  • {@code CDP_API_KEY_SECRET} - Required *
  • {@code CDP_WALLET_SECRET} - Optional (required for write operations) + *
  • {@code CDP_PROJECT_ID} - Optional (required for end user delegation operations) * * * @return a new CDP client @@ -320,6 +327,49 @@ public PoliciesClient policies() { return policiesClient; } + /** + * Returns the End User namespace client. + * + *

    Use this client for end user account management and delegated operations: + * + *

    {@code
    +   * EndUser endUser = cdp.endUser().createEndUser(
    +   *     new CreateEndUserRequest()
    +   *         .addAuthenticationMethodsItem(
    +   *             new AuthenticationMethod().type("email").email("user@example.com"))
    +   * );
    +   * }
    + * + * @return the End User client + * @throws IllegalStateException if the client has been closed + */ + public EndUserClient endUser() { + checkNotClosed(); + if (endUserClient == null) { + synchronized (namespaceLock) { + if (endUserClient == null) { + if (tokenProvider != null) { + endUserClient = new EndUserClient(apiClient, tokenProvider, projectId); + } else { + endUserClient = new EndUserClient(this); + } + } + } + } + return endUserClient; + } + + /** + * Returns the configured CDP project ID, or null if not configured. + * + *

    The project ID is required for end user delegation operations (signing, sending). + * + * @return the project ID, or null + */ + public String getProjectId() { + return projectId; + } + /** * Generates a wallet JWT for write operations that require the X-Wallet-Auth header. * diff --git a/java/src/main/java/com/coinbase/cdp/CdpClientBuilder.java b/java/src/main/java/com/coinbase/cdp/CdpClientBuilder.java index 569dc8c20..4c93344d8 100644 --- a/java/src/main/java/com/coinbase/cdp/CdpClientBuilder.java +++ b/java/src/main/java/com/coinbase/cdp/CdpClientBuilder.java @@ -53,6 +53,7 @@ public final class CdpClientBuilder { private String apiKeyId; private String apiKeySecret; private Optional walletSecret = Optional.empty(); + private Optional projectId = Optional.empty(); private TokenProvider tokenProvider; // JWT options (only for credential mode) @@ -101,6 +102,19 @@ public CdpClientBuilder walletSecret(String walletSecret) { return this; } + /** + * Sets the CDP project ID. + * + *

    Required for end user delegation operations (signing, sending). + * + * @param projectId the CDP project ID + * @return this builder + */ + public CdpClientBuilder projectId(String projectId) { + this.projectId = Optional.ofNullable(projectId).filter(s -> !s.isBlank()); + return this; + } + /** * Sets a pre-generated TokenProvider for authentication. * @@ -258,6 +272,7 @@ private CdpClient buildWithCredentials() { apiKeyId, apiKeySecret, walletSecret, + projectId, debugging, basePath, expiresIn, @@ -270,6 +285,6 @@ private CdpClient buildWithCredentials() { private CdpClient buildWithTokenProvider() { HttpClientConfig config = new HttpClientConfig(basePath, retryConfig, httpClientBuilder, debugging); - return new CdpClient(tokenProvider, config); + return new CdpClient(tokenProvider, config, projectId.orElse(null)); } } diff --git a/java/src/main/java/com/coinbase/cdp/CdpClientOptions.java b/java/src/main/java/com/coinbase/cdp/CdpClientOptions.java index d97ee5999..c054b8bad 100644 --- a/java/src/main/java/com/coinbase/cdp/CdpClientOptions.java +++ b/java/src/main/java/com/coinbase/cdp/CdpClientOptions.java @@ -26,6 +26,7 @@ public record CdpClientOptions( String apiKeyId, String apiKeySecret, Optional walletSecret, + Optional projectId, boolean debugging, String basePath, long expiresIn, @@ -57,6 +58,9 @@ public record CdpClientOptions( if (walletSecret == null) { walletSecret = Optional.empty(); } + if (projectId == null) { + projectId = Optional.empty(); + } if (basePath == null || basePath.isBlank()) { basePath = DEFAULT_BASE_PATH; } @@ -101,6 +105,7 @@ public static CdpClientOptions fromEnvironment() { String apiKeyId = getEnvOrProperty("CDP_API_KEY_ID"); String apiKeySecret = getEnvOrProperty("CDP_API_KEY_SECRET"); String walletSecret = getEnvOrProperty("CDP_WALLET_SECRET"); + String projectId = getEnvOrProperty("CDP_PROJECT_ID"); if (apiKeyId == null || apiKeyId.isBlank()) { throw new IllegalArgumentException("CDP_API_KEY_ID environment variable is required"); @@ -113,6 +118,7 @@ public static CdpClientOptions fromEnvironment() { .apiKeyId(apiKeyId) .apiKeySecret(apiKeySecret) .walletSecret(walletSecret) + .projectId(projectId) .build(); } @@ -137,6 +143,7 @@ public static class Builder { private String apiKeyId; private String apiKeySecret; private Optional walletSecret = Optional.empty(); + private Optional projectId = Optional.empty(); private boolean debugging = false; private String basePath = DEFAULT_BASE_PATH; private long expiresIn = DEFAULT_EXPIRES_IN; @@ -177,6 +184,17 @@ public Builder walletSecret(String secret) { return this; } + /** + * Sets the CDP project ID. Required for end user delegation operations (signing, sending). + * + * @param projectId the CDP project ID + * @return this builder + */ + public Builder projectId(String projectId) { + this.projectId = Optional.ofNullable(projectId).filter(s -> !s.isBlank()); + return this; + } + /** * Sets whether to enable debug logging. * @@ -294,6 +312,7 @@ public CdpClientOptions build() { apiKeyId, apiKeySecret, walletSecret, + projectId, debugging, basePath, expiresIn, diff --git a/java/src/main/java/com/coinbase/cdp/client/enduser/EndUserClient.java b/java/src/main/java/com/coinbase/cdp/client/enduser/EndUserClient.java new file mode 100644 index 000000000..5b4df3ebc --- /dev/null +++ b/java/src/main/java/com/coinbase/cdp/client/enduser/EndUserClient.java @@ -0,0 +1,1125 @@ +package com.coinbase.cdp.client.enduser; + +import com.coinbase.cdp.CdpClient; +import com.coinbase.cdp.auth.TokenProvider; +import com.coinbase.cdp.client.enduser.EndUserClientOptions.ImportEndUserOptions; +import com.coinbase.cdp.client.enduser.EndUserClientOptions.ListEndUsersOptions; +import com.coinbase.cdp.openapi.ApiClient; +import com.coinbase.cdp.openapi.ApiException; +import com.coinbase.cdp.openapi.api.EmbeddedWalletsCoreFunctionalityApi; +import com.coinbase.cdp.openapi.api.EndUserAccountsApi; +import com.coinbase.cdp.openapi.model.AddEndUserEvmAccount201Response; +import com.coinbase.cdp.openapi.model.AddEndUserEvmSmartAccount201Response; +import com.coinbase.cdp.openapi.model.AddEndUserEvmSmartAccountRequest; +import com.coinbase.cdp.openapi.model.AddEndUserSolanaAccount201Response; +import com.coinbase.cdp.openapi.model.CreateEndUserRequest; +import com.coinbase.cdp.openapi.model.CreateEvmEip7702Delegation201Response; +import com.coinbase.cdp.openapi.model.CreateEvmEip7702DelegationWithEndUserAccountRequest; +import com.coinbase.cdp.openapi.model.EndUser; +import com.coinbase.cdp.openapi.model.EvmUserOperation; +import com.coinbase.cdp.openapi.model.ImportEndUserRequest; +import com.coinbase.cdp.openapi.model.ListEndUsers200Response; +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.SendEvmTransaction200Response; +import com.coinbase.cdp.openapi.model.SendEvmTransactionWithEndUserAccountRequest; +import com.coinbase.cdp.openapi.model.SendSolanaAssetWithEndUserAccount200Response; +import com.coinbase.cdp.openapi.model.SendSolanaAssetWithEndUserAccountRequest; +import com.coinbase.cdp.openapi.model.SendSolanaTransaction200Response; +import com.coinbase.cdp.openapi.model.SendSolanaTransactionWithEndUserAccountRequest; +import com.coinbase.cdp.openapi.model.SendUserOperationWithEndUserAccountRequest; +import com.coinbase.cdp.openapi.model.SignEvmHash200Response; +import com.coinbase.cdp.openapi.model.SignEvmHashWithEndUserAccountRequest; +import com.coinbase.cdp.openapi.model.SignEvmMessage200Response; +import com.coinbase.cdp.openapi.model.SignEvmMessageWithEndUserAccountRequest; +import com.coinbase.cdp.openapi.model.SignEvmTransaction200Response; +import com.coinbase.cdp.openapi.model.SignEvmTransactionWithEndUserAccountRequest; +import com.coinbase.cdp.openapi.model.SignEvmTypedData200Response; +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.SignSolanaMessage200Response; +import com.coinbase.cdp.openapi.model.SignSolanaMessageWithEndUserAccountRequest; +import com.coinbase.cdp.openapi.model.SignSolanaTransaction200Response; +import com.coinbase.cdp.openapi.model.SignSolanaTransactionWithEndUserAccountRequest; +import com.coinbase.cdp.openapi.model.ValidateEndUserAccessTokenRequest; +import java.security.KeyFactory; +import java.security.PublicKey; +import java.security.spec.X509EncodedKeySpec; +import java.util.Base64; +import java.util.UUID; +import javax.crypto.Cipher; + +/** + * The namespace client for end user operations. + * + *

    Provides high-level methods for creating, managing, and performing delegated operations on + * behalf of end users. End users are entities that can own CDP EVM accounts, EVM smart accounts, + * and/or Solana accounts. + * + *

    Delegation operations (signing, sending) require a project ID to be configured. + * + *

    Usage patterns: + * + *

    {@code
    + * // Pattern 1: From environment variables (reads CDP_PROJECT_ID)
    + * try (CdpClient cdp = CdpClient.create()) {
    + *     EndUser endUser = cdp.endUser().createEndUser(
    + *         new CreateEndUserRequest()
    + *             .addAuthenticationMethodsItem(...)
    + *     );
    + * }
    + *
    + * // Pattern 2: With credentials and project ID
    + * try (CdpClient cdp = CdpClient.builder()
    + *         .credentials("api-key-id", "api-key-secret")
    + *         .walletSecret("wallet-secret")
    + *         .projectId("my-project-id")
    + *         .build()) {
    + *     EndUser endUser = cdp.endUser().createEndUser(
    + *         new CreateEndUserRequest()
    + *             .addAuthenticationMethodsItem(...)
    + *     );
    + * }
    + * }
    + */ +public class EndUserClient { + + /** The public RSA key used to encrypt private keys when importing accounts. */ + private static final String IMPORT_ACCOUNT_PUBLIC_RSA_KEY = + "-----BEGIN PUBLIC KEY-----\n" + + "MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA2Fxydgm/ryYk0IexQIuL\n" + + "9DKyiIk2WmS36AZ83a9Z0QX53qdveg08b05g1Qr+o+COoYOT/FDi8anRGAs7rIyS\n" + + "uigrjHR6VrmFjnGrrTr3MINwC9cYQFHwET8YVGRq+BB3iFTB1kIb9XJ/vT2sk1xP\n" + + "hJ6JihEwSl4DgbeVjqw59wYqrNg355oa8EdFqkmfGU2tpbM56F8iv1F+shwkGo3y\n" + + "GhW/UOQ5OLauXvsqo8ranwsK+lqFblLEMlNtn1VSJeO2vMxryeKFrY2ob8VqGchC\n" + + "ftPJiLWs2Du6juw4C1rOWwSMlXzZ6cNMHkxdTcEHMr3C2TEHgzjZY41whMwNTB8q\n" + + "/pxXnIbH77caaviRs4R/POe8cSsznalXj85LULvFWOIHp0w+jEYSii9Rp9XtHWAH\n" + + "nrK/O/SVDtT1ohp2F+Zg1mojTgKfLOyGdOUXTi95naDTuG770rSjHdL80tJBz1Fd\n" + + "+1pzGTGXGHLZQLX5YZm5iuy2cebWfF09VjIoCIlDB2++tr4M+O0Z1X1ZE0J5Ackq\n" + + "rOluAFalaKynyH3KMyRg+NuLmibu5OmcMjCLK3D4X1YLiN2OK8/bbpEL8JYroDwb\n" + + "EXIUW5mGS06YxfSUsxHzL9Tj00+GMm/Gvl0+4/+Vn8IXVHjQOSPNEy3EnqCiH/OW\n" + + "8v0IMC32CeGrX7mGbU+MzlsCAwEAAQ==\n" + + "-----END PUBLIC KEY-----"; + + private final CdpClient cdpClient; + private final TokenProvider tokenProvider; + private final String projectId; + private final EndUserAccountsApi endUserAccountsApi; + private final EmbeddedWalletsCoreFunctionalityApi embeddedWalletsApi; + + /** + * Creates a new End User client for instance-based usage. + * + * @param cdpClient the parent CDP client + */ + public EndUserClient(CdpClient cdpClient) { + this.cdpClient = cdpClient; + this.tokenProvider = null; + this.projectId = cdpClient.getProjectId(); + ApiClient apiClient = cdpClient.getApiClient(); + this.endUserAccountsApi = new EndUserAccountsApi(apiClient); + this.embeddedWalletsApi = new EmbeddedWalletsCoreFunctionalityApi(apiClient); + } + + /** + * Creates a new End User client for static factory usage with pre-generated tokens. + * + * @param apiClient the pre-configured API client with tokens + * @param tokenProvider the token provider containing pre-generated tokens + * @param projectId the CDP project ID (required for delegation operations) + */ + public EndUserClient(ApiClient apiClient, TokenProvider tokenProvider, String projectId) { + this.cdpClient = null; + this.tokenProvider = tokenProvider; + this.projectId = projectId; + this.endUserAccountsApi = new EndUserAccountsApi(apiClient); + this.embeddedWalletsApi = new EmbeddedWalletsCoreFunctionalityApi(apiClient); + } + + // ==================== End User CRUD ==================== + + /** + * Creates a new end user with default options. + * + * @return the created end user + * @throws ApiException if the API call fails + */ + public EndUser createEndUser() throws ApiException { + return createEndUser(new CreateEndUserRequest()); + } + + /** + * Creates a new end user. + * + * @param request the end user creation request + * @return the created end user + * @throws ApiException if the API call fails + */ + public EndUser createEndUser(CreateEndUserRequest request) throws ApiException { + return createEndUser(request, null); + } + + /** + * Creates a new end user with idempotency key. + * + * @param request the end user creation request + * @param idempotencyKey optional idempotency key + * @return the created end user + * @throws ApiException if the API call fails + */ + public EndUser createEndUser(CreateEndUserRequest request, String idempotencyKey) + throws ApiException { + if (request.getUserId() == null || request.getUserId().isBlank()) { + request.userId(UUID.randomUUID().toString()); + } + String walletJwt = generateWalletJwt("POST", "/v2/end-users", request); + return endUserAccountsApi.createEndUser(walletJwt, idempotencyKey, request); + } + + /** + * Gets an end user by their unique identifier. + * + * @param userId the unique identifier of the end user + * @return the end user + * @throws ApiException if the API call fails + */ + public EndUser getEndUser(String userId) throws ApiException { + return endUserAccountsApi.getEndUser(userId); + } + + /** + * Lists end users with default options. + * + * @return the list response + * @throws ApiException if the API call fails + */ + public ListEndUsers200Response listEndUsers() throws ApiException { + return listEndUsers(ListEndUsersOptions.builder().build()); + } + + /** + * Lists end users with pagination and sorting. + * + * @param options the list options + * @return the list response + * @throws ApiException if the API call fails + */ + public ListEndUsers200Response listEndUsers(ListEndUsersOptions options) throws ApiException { + return endUserAccountsApi.listEndUsers(options.pageSize(), options.pageToken(), options.sort()); + } + + /** + * Validates an end user's access token. Throws an error if the access token is invalid. + * + * @param request the validation request containing the access token + * @return the end user if the access token is valid + * @throws ApiException if the API call fails or the token is invalid + */ + public EndUser validateAccessToken(ValidateEndUserAccessTokenRequest request) + throws ApiException { + return endUserAccountsApi.validateEndUserAccessToken(request); + } + + /** + * Imports an existing private key for an end user. + * + *

    The private key is encrypted with RSA-OAEP before being sent to the API. + * + * @param options the import options containing private key, key type, and authentication methods + * @return the imported end user + * @throws ApiException if the API call fails + * @throws IllegalArgumentException if the private key format is invalid + */ + public EndUser importEndUser(ImportEndUserOptions options) throws ApiException { + return importEndUser(options, null); + } + + /** + * Imports an existing private key for an end user with idempotency key. + * + *

    The private key is encrypted with RSA-OAEP before being sent to the API. + * + * @param options the import options containing private key, key type, and authentication methods + * @param idempotencyKey optional idempotency key + * @return the imported end user + * @throws ApiException if the API call fails + * @throws IllegalArgumentException if the private key format is invalid + */ + public EndUser importEndUser(ImportEndUserOptions options, String idempotencyKey) + throws ApiException { + String userId = options.userId() != null ? options.userId() : UUID.randomUUID().toString(); + + byte[] privateKeyBytes = decodePrivateKey(options.privateKey(), options.keyType()); + + String encryptionKey = + options.encryptionPublicKey() != null + ? options.encryptionPublicKey() + : IMPORT_ACCOUNT_PUBLIC_RSA_KEY; + + String encryptedPrivateKey = encryptWithRsa(privateKeyBytes, encryptionKey); + + ImportEndUserRequest request = + new ImportEndUserRequest() + .userId(userId) + .authenticationMethods(options.authenticationMethods()) + .encryptedPrivateKey(encryptedPrivateKey) + .keyType(ImportEndUserRequest.KeyTypeEnum.fromValue(options.keyType())); + + String walletJwt = generateWalletJwt("POST", "/v2/end-users/import", request); + return endUserAccountsApi.importEndUser(walletJwt, idempotencyKey, request); + } + + // ==================== Account Management ==================== + + /** + * Adds an EVM EOA (Externally Owned Account) to an existing end user. End users can have up to 10 + * EVM accounts. + * + * @param userId the unique identifier of the end user + * @return the newly created EVM EOA account + * @throws ApiException if the API call fails + */ + public AddEndUserEvmAccount201Response addEvmAccount(String userId) throws ApiException { + return addEvmAccount(userId, null); + } + + /** + * Adds an EVM EOA to an existing end user with idempotency key. + * + * @param userId the unique identifier of the end user + * @param idempotencyKey optional idempotency key + * @return the newly created EVM EOA account + * @throws ApiException if the API call fails + */ + public AddEndUserEvmAccount201Response addEvmAccount(String userId, String idempotencyKey) + throws ApiException { + String walletJwt = generateWalletJwt("POST", "/v2/end-users/" + userId + "/evm/accounts", null); + return endUserAccountsApi.addEndUserEvmAccount(userId, walletJwt, idempotencyKey, null); + } + + /** + * Adds an EVM smart account to an existing end user. This also creates a new EVM EOA account to + * serve as the owner of the smart account. + * + * @param userId the unique identifier of the end user + * @param request the smart account creation request + * @return the newly created EVM smart account + * @throws ApiException if the API call fails + */ + public AddEndUserEvmSmartAccount201Response addEvmSmartAccount( + String userId, AddEndUserEvmSmartAccountRequest request) throws ApiException { + return addEvmSmartAccount(userId, request, null); + } + + /** + * Adds an EVM smart account to an existing end user with idempotency key. + * + * @param userId the unique identifier of the end user + * @param request the smart account creation request + * @param idempotencyKey optional idempotency key + * @return the newly created EVM smart account + * @throws ApiException if the API call fails + */ + public AddEndUserEvmSmartAccount201Response addEvmSmartAccount( + String userId, AddEndUserEvmSmartAccountRequest request, String idempotencyKey) + throws ApiException { + String walletJwt = + generateWalletJwt("POST", "/v2/end-users/" + userId + "/evm/smart-accounts", request); + return endUserAccountsApi.addEndUserEvmSmartAccount(userId, walletJwt, idempotencyKey, request); + } + + /** + * Adds a Solana account to an existing end user. End users can have up to 10 Solana accounts. + * + * @param userId the unique identifier of the end user + * @return the newly created Solana account + * @throws ApiException if the API call fails + */ + public AddEndUserSolanaAccount201Response addSolanaAccount(String userId) throws ApiException { + return addSolanaAccount(userId, null); + } + + /** + * Adds a Solana account to an existing end user with idempotency key. + * + * @param userId the unique identifier of the end user + * @param idempotencyKey optional idempotency key + * @return the newly created Solana account + * @throws ApiException if the API call fails + */ + public AddEndUserSolanaAccount201Response addSolanaAccount(String userId, String idempotencyKey) + throws ApiException { + String walletJwt = + generateWalletJwt("POST", "/v2/end-users/" + userId + "/solana/accounts", null); + return endUserAccountsApi.addEndUserSolanaAccount(userId, walletJwt, idempotencyKey, null); + } + + // ==================== Delegation Management ==================== + + /** + * 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 userId the unique identifier of the end user + * @throws ApiException if the API call fails + */ + public void revokeDelegation(String userId) throws ApiException { + revokeDelegation(userId, null); + } + + /** + * Revokes all active delegations for the specified end user with idempotency key. + * + * @param userId the unique identifier of the end user + * @param idempotencyKey optional idempotency key + * @throws ApiException if the API call fails + */ + public void revokeDelegation(String userId, String idempotencyKey) throws ApiException { + String pid = requireProjectId(); + String walletJwt = + generateWalletJwt( + "POST", + "/v2/embedded-wallet-api/projects/" + pid + "/end-users/" + userId + "/delegations", + null); + embeddedWalletsApi.revokeDelegationForEndUser( + pid, userId, new RevokeDelegationForEndUserRequest(), walletJwt, null, idempotencyKey); + } + + /** + * Revokes a spend permission for an end user's smart account. + * + * @param userId the unique identifier of the end user + * @param address the smart account address + * @param request the revoke request + * @return the user operation + * @throws ApiException if the API call fails + */ + public EvmUserOperation revokeSpendPermission( + String userId, String address, RevokeSpendPermissionRequest request) throws ApiException { + return revokeSpendPermission(userId, address, request, null); + } + + /** + * Revokes a spend permission for an end user's smart account with idempotency key. + * + * @param userId the unique identifier of the end user + * @param address the smart account address + * @param request the revoke request + * @param idempotencyKey optional idempotency key + * @return the user operation + * @throws ApiException if the API call fails + */ + public EvmUserOperation revokeSpendPermission( + String userId, String address, RevokeSpendPermissionRequest request, String idempotencyKey) + throws ApiException { + String pid = requireProjectId(); + String walletJwt = + generateWalletJwt( + "POST", + "/v2/embedded-wallet-api/projects/" + + pid + + "/end-users/" + + userId + + "/evm/smart-accounts/" + + address + + "/spend-permissions/revoke", + request); + return embeddedWalletsApi.revokeSpendPermissionWithEndUserAccount( + pid, userId, address, request, walletJwt, idempotencyKey); + } + + // ==================== Delegated EVM Sign Operations ==================== + + /** + * Signs an EVM hash on behalf of an end user using a delegation. + * + * @param userId the unique identifier of the end user + * @param request the sign request containing hash and address + * @return the signature response + * @throws ApiException if the API call fails + */ + public SignEvmHash200Response signEvmHash( + String userId, SignEvmHashWithEndUserAccountRequest request) throws ApiException { + return signEvmHash(userId, request, null); + } + + /** + * Signs an EVM hash on behalf of an end user with idempotency key. + * + * @param userId the unique identifier of the end user + * @param request the sign request containing hash and address + * @param idempotencyKey optional idempotency key + * @return the signature response + * @throws ApiException if the API call fails + */ + public SignEvmHash200Response signEvmHash( + String userId, SignEvmHashWithEndUserAccountRequest request, String idempotencyKey) + throws ApiException { + String pid = requireProjectId(); + String walletJwt = + generateWalletJwt( + "POST", + "/v2/embedded-wallet-api/projects/" + pid + "/end-users/" + userId + "/evm/sign/hash", + request); + return embeddedWalletsApi.signEvmHashWithEndUserAccount( + pid, userId, walletJwt, idempotencyKey, null, request); + } + + /** + * Signs an EVM transaction on behalf of an end user using a delegation. + * + * @param userId the unique identifier of the end user + * @param request the sign request containing address and transaction + * @return the signed transaction response + * @throws ApiException if the API call fails + */ + public SignEvmTransaction200Response signEvmTransaction( + String userId, SignEvmTransactionWithEndUserAccountRequest request) throws ApiException { + return signEvmTransaction(userId, request, null); + } + + /** + * Signs an EVM transaction on behalf of an end user with idempotency key. + * + * @param userId the unique identifier of the end user + * @param request the sign request containing address and transaction + * @param idempotencyKey optional idempotency key + * @return the signed transaction response + * @throws ApiException if the API call fails + */ + public SignEvmTransaction200Response signEvmTransaction( + String userId, SignEvmTransactionWithEndUserAccountRequest request, String idempotencyKey) + throws ApiException { + String pid = requireProjectId(); + String walletJwt = + generateWalletJwt( + "POST", + "/v2/embedded-wallet-api/projects/" + + pid + + "/end-users/" + + userId + + "/evm/sign/transaction", + request); + return embeddedWalletsApi.signEvmTransactionWithEndUserAccount( + pid, userId, walletJwt, idempotencyKey, null, request); + } + + /** + * Signs an EVM message (EIP-191) on behalf of an end user using a delegation. + * + * @param userId the unique identifier of the end user + * @param request the sign request containing address and message + * @return the signature response + * @throws ApiException if the API call fails + */ + public SignEvmMessage200Response signEvmMessage( + String userId, SignEvmMessageWithEndUserAccountRequest request) throws ApiException { + return signEvmMessage(userId, request, null); + } + + /** + * Signs an EVM message (EIP-191) on behalf of an end user with idempotency key. + * + * @param userId the unique identifier of the end user + * @param request the sign request containing address and message + * @param idempotencyKey optional idempotency key + * @return the signature response + * @throws ApiException if the API call fails + */ + public SignEvmMessage200Response signEvmMessage( + String userId, SignEvmMessageWithEndUserAccountRequest request, String idempotencyKey) + throws ApiException { + String pid = requireProjectId(); + String walletJwt = + generateWalletJwt( + "POST", + "/v2/embedded-wallet-api/projects/" + + pid + + "/end-users/" + + userId + + "/evm/sign/message", + request); + return embeddedWalletsApi.signEvmMessageWithEndUserAccount( + pid, userId, walletJwt, idempotencyKey, null, request); + } + + /** + * Signs EVM EIP-712 typed data on behalf of an end user using a delegation. + * + * @param userId the unique identifier of the end user + * @param request the sign request containing address and typed data + * @return the signature response + * @throws ApiException if the API call fails + */ + public SignEvmTypedData200Response signEvmTypedData( + String userId, SignEvmTypedDataWithEndUserAccountRequest request) throws ApiException { + return signEvmTypedData(userId, request, null); + } + + /** + * Signs EVM EIP-712 typed data on behalf of an end user with idempotency key. + * + * @param userId the unique identifier of the end user + * @param request the sign request containing address and typed data + * @param idempotencyKey optional idempotency key + * @return the signature response + * @throws ApiException if the API call fails + */ + public SignEvmTypedData200Response signEvmTypedData( + String userId, SignEvmTypedDataWithEndUserAccountRequest request, String idempotencyKey) + throws ApiException { + String pid = requireProjectId(); + String walletJwt = + generateWalletJwt( + "POST", + "/v2/embedded-wallet-api/projects/" + + pid + + "/end-users/" + + userId + + "/evm/sign/typed-data", + request); + return embeddedWalletsApi.signEvmTypedDataWithEndUserAccount( + pid, userId, walletJwt, idempotencyKey, null, request); + } + + // ==================== Delegated EVM Send Operations ==================== + + /** + * Sends an EVM transaction on behalf of an end user using a delegation. + * + * @param userId the unique identifier of the end user + * @param request the send request containing address, transaction, and network + * @return the transaction response + * @throws ApiException if the API call fails + */ + public SendEvmTransaction200Response sendEvmTransaction( + String userId, SendEvmTransactionWithEndUserAccountRequest request) throws ApiException { + return sendEvmTransaction(userId, request, null); + } + + /** + * Sends an EVM transaction on behalf of an end user with idempotency key. + * + * @param userId the unique identifier of the end user + * @param request the send request containing address, transaction, and network + * @param idempotencyKey optional idempotency key + * @return the transaction response + * @throws ApiException if the API call fails + */ + public SendEvmTransaction200Response sendEvmTransaction( + String userId, SendEvmTransactionWithEndUserAccountRequest request, String idempotencyKey) + throws ApiException { + String pid = requireProjectId(); + String walletJwt = + generateWalletJwt( + "POST", + "/v2/embedded-wallet-api/projects/" + + pid + + "/end-users/" + + userId + + "/evm/send/transaction", + request); + return embeddedWalletsApi.sendEvmTransactionWithEndUserAccount( + pid, userId, walletJwt, idempotencyKey, null, request); + } + + /** + * Sends an EVM asset (e.g. USDC) on behalf of an end user using a delegation. + * + * @param userId the unique identifier of the end user + * @param address the EVM address to send from + * @param asset the asset to send (e.g., "usdc") + * @param request the send request containing to, amount, network, and paymaster options + * @return the send response + * @throws ApiException if the API call fails + */ + public SendEvmAssetWithEndUserAccount200Response sendEvmAsset( + String userId, String address, String asset, SendEvmAssetWithEndUserAccountRequest request) + throws ApiException { + return sendEvmAsset(userId, address, asset, request, null); + } + + /** + * Sends an EVM asset on behalf of an end user with idempotency key. + * + * @param userId the unique identifier of the end user + * @param address the EVM address to send from + * @param asset the asset to send (e.g., "usdc") + * @param request the send request containing to, amount, network, and paymaster options + * @param idempotencyKey optional idempotency key + * @return the send response + * @throws ApiException if the API call fails + */ + public SendEvmAssetWithEndUserAccount200Response sendEvmAsset( + String userId, + String address, + String asset, + SendEvmAssetWithEndUserAccountRequest request, + String idempotencyKey) + throws ApiException { + String pid = requireProjectId(); + String walletJwt = + generateWalletJwt( + "POST", + "/v2/embedded-wallet-api/projects/" + + pid + + "/end-users/" + + userId + + "/evm/" + + address + + "/send/" + + asset, + request); + return embeddedWalletsApi.sendEvmAssetWithEndUserAccount( + pid, userId, address, asset, walletJwt, idempotencyKey, null, request); + } + + /** + * Sends a user operation on behalf of an end user using a delegation. + * + * @param userId the unique identifier of the end user + * @param address the EVM smart account address + * @param request the user operation request containing network, calls, and paymaster options + * @return the user operation result + * @throws ApiException if the API call fails + */ + public EvmUserOperation sendUserOperation( + String userId, String address, SendUserOperationWithEndUserAccountRequest request) + throws ApiException { + return sendUserOperation(userId, address, request, null); + } + + /** + * Sends a user operation on behalf of an end user with idempotency key. + * + * @param userId the unique identifier of the end user + * @param address the EVM smart account address + * @param request the user operation request containing network, calls, and paymaster options + * @param idempotencyKey optional idempotency key + * @return the user operation result + * @throws ApiException if the API call fails + */ + public EvmUserOperation sendUserOperation( + String userId, + String address, + SendUserOperationWithEndUserAccountRequest request, + String idempotencyKey) + throws ApiException { + String pid = requireProjectId(); + String walletJwt = + generateWalletJwt( + "POST", + "/v2/embedded-wallet-api/projects/" + + pid + + "/end-users/" + + userId + + "/evm/smart-accounts/" + + address + + "/user-operations", + request); + return embeddedWalletsApi.sendUserOperationWithEndUserAccount( + pid, userId, address, idempotencyKey, walletJwt, null, request); + } + + // ==================== Delegated EVM EIP-7702 Delegation ==================== + + /** + * Creates an EVM EIP-7702 delegation on behalf of an end user. + * + * @param userId the unique identifier of the end user + * @param request the delegation request containing address, network, and spend permission options + * @return the delegation result + * @throws ApiException if the API call fails + */ + public CreateEvmEip7702Delegation201Response createEvmEip7702Delegation( + String userId, CreateEvmEip7702DelegationWithEndUserAccountRequest request) + throws ApiException { + return createEvmEip7702Delegation(userId, request, null); + } + + /** + * Creates an EVM EIP-7702 delegation on behalf of an end user with idempotency key. + * + * @param userId the unique identifier of the end user + * @param request the delegation request containing address, network, and spend permission options + * @param idempotencyKey optional idempotency key + * @return the delegation result + * @throws ApiException if the API call fails + */ + public CreateEvmEip7702Delegation201Response createEvmEip7702Delegation( + String userId, + CreateEvmEip7702DelegationWithEndUserAccountRequest request, + String idempotencyKey) + throws ApiException { + String pid = requireProjectId(); + String walletJwt = + generateWalletJwt( + "POST", + "/v2/embedded-wallet-api/projects/" + + pid + + "/end-users/" + + userId + + "/evm/eip7702/delegation", + request); + return embeddedWalletsApi.createEvmEip7702DelegationWithEndUserAccount( + pid, userId, request, walletJwt, idempotencyKey, null); + } + + // ==================== Delegated Solana Sign Operations ==================== + + /** + * Signs a Solana hash on behalf of an end user using a delegation. + * + * @param userId the unique identifier of the end user + * @param request the sign request containing hash and address + * @return the signature response + * @throws ApiException if the API call fails + */ + public SignSolanaHashWithEndUserAccount200Response signSolanaHash( + String userId, SignSolanaHashWithEndUserAccountRequest request) throws ApiException { + return signSolanaHash(userId, request, null); + } + + /** + * Signs a Solana hash on behalf of an end user with idempotency key. + * + * @param userId the unique identifier of the end user + * @param request the sign request containing hash and address + * @param idempotencyKey optional idempotency key + * @return the signature response + * @throws ApiException if the API call fails + */ + public SignSolanaHashWithEndUserAccount200Response signSolanaHash( + String userId, SignSolanaHashWithEndUserAccountRequest request, String idempotencyKey) + throws ApiException { + String pid = requireProjectId(); + String walletJwt = + generateWalletJwt( + "POST", + "/v2/embedded-wallet-api/projects/" + + pid + + "/end-users/" + + userId + + "/solana/sign/hash", + request); + return embeddedWalletsApi.signSolanaHashWithEndUserAccount( + pid, userId, walletJwt, idempotencyKey, null, request); + } + + /** + * Signs a Solana message on behalf of an end user using a delegation. + * + * @param userId the unique identifier of the end user + * @param request the sign request containing address and message + * @return the signature response + * @throws ApiException if the API call fails + */ + public SignSolanaMessage200Response signSolanaMessage( + String userId, SignSolanaMessageWithEndUserAccountRequest request) throws ApiException { + return signSolanaMessage(userId, request, null); + } + + /** + * Signs a Solana message on behalf of an end user with idempotency key. + * + * @param userId the unique identifier of the end user + * @param request the sign request containing address and message + * @param idempotencyKey optional idempotency key + * @return the signature response + * @throws ApiException if the API call fails + */ + public SignSolanaMessage200Response signSolanaMessage( + String userId, SignSolanaMessageWithEndUserAccountRequest request, String idempotencyKey) + throws ApiException { + String pid = requireProjectId(); + String walletJwt = + generateWalletJwt( + "POST", + "/v2/embedded-wallet-api/projects/" + + pid + + "/end-users/" + + userId + + "/solana/sign/message", + request); + return embeddedWalletsApi.signSolanaMessageWithEndUserAccount( + pid, userId, walletJwt, idempotencyKey, null, request); + } + + /** + * Signs a Solana transaction on behalf of an end user using a delegation. + * + * @param userId the unique identifier of the end user + * @param request the sign request containing address and transaction + * @return the signed transaction response + * @throws ApiException if the API call fails + */ + public SignSolanaTransaction200Response signSolanaTransaction( + String userId, SignSolanaTransactionWithEndUserAccountRequest request) throws ApiException { + return signSolanaTransaction(userId, request, null); + } + + /** + * Signs a Solana transaction on behalf of an end user with idempotency key. + * + * @param userId the unique identifier of the end user + * @param request the sign request containing address and transaction + * @param idempotencyKey optional idempotency key + * @return the signed transaction response + * @throws ApiException if the API call fails + */ + public SignSolanaTransaction200Response signSolanaTransaction( + String userId, SignSolanaTransactionWithEndUserAccountRequest request, String idempotencyKey) + throws ApiException { + String pid = requireProjectId(); + String walletJwt = + generateWalletJwt( + "POST", + "/v2/embedded-wallet-api/projects/" + + pid + + "/end-users/" + + userId + + "/solana/sign/transaction", + request); + return embeddedWalletsApi.signSolanaTransactionWithEndUserAccount( + pid, userId, walletJwt, idempotencyKey, null, request); + } + + // ==================== Delegated Solana Send Operations ==================== + + /** + * Sends a Solana transaction on behalf of an end user using a delegation. + * + * @param userId the unique identifier of the end user + * @param request the send request containing address, transaction, and network + * @return the transaction response + * @throws ApiException if the API call fails + */ + public SendSolanaTransaction200Response sendSolanaTransaction( + String userId, SendSolanaTransactionWithEndUserAccountRequest request) throws ApiException { + return sendSolanaTransaction(userId, request, null); + } + + /** + * Sends a Solana transaction on behalf of an end user with idempotency key. + * + * @param userId the unique identifier of the end user + * @param request the send request containing address, transaction, and network + * @param idempotencyKey optional idempotency key + * @return the transaction response + * @throws ApiException if the API call fails + */ + public SendSolanaTransaction200Response sendSolanaTransaction( + String userId, SendSolanaTransactionWithEndUserAccountRequest request, String idempotencyKey) + throws ApiException { + String pid = requireProjectId(); + String walletJwt = + generateWalletJwt( + "POST", + "/v2/embedded-wallet-api/projects/" + + pid + + "/end-users/" + + userId + + "/solana/send/transaction", + request); + return embeddedWalletsApi.sendSolanaTransactionWithEndUserAccount( + pid, userId, walletJwt, idempotencyKey, null, request); + } + + /** + * Sends a Solana asset (e.g. USDC) on behalf of an end user using a delegation. + * + * @param userId the unique identifier of the end user + * @param address the Solana address to send from + * @param asset the asset to send (e.g., "usdc") + * @param request the send request containing to, amount, network, and options + * @return the send response + * @throws ApiException if the API call fails + */ + public SendSolanaAssetWithEndUserAccount200Response sendSolanaAsset( + String userId, String address, String asset, SendSolanaAssetWithEndUserAccountRequest request) + throws ApiException { + return sendSolanaAsset(userId, address, asset, request, null); + } + + /** + * Sends a Solana asset on behalf of an end user with idempotency key. + * + * @param userId the unique identifier of the end user + * @param address the Solana address to send from + * @param asset the asset to send (e.g., "usdc") + * @param request the send request containing to, amount, network, and options + * @param idempotencyKey optional idempotency key + * @return the send response + * @throws ApiException if the API call fails + */ + public SendSolanaAssetWithEndUserAccount200Response sendSolanaAsset( + String userId, + String address, + String asset, + SendSolanaAssetWithEndUserAccountRequest request, + String idempotencyKey) + throws ApiException { + String pid = requireProjectId(); + String walletJwt = + generateWalletJwt( + "POST", + "/v2/embedded-wallet-api/projects/" + + pid + + "/end-users/" + + userId + + "/solana/" + + address + + "/send/" + + asset, + request); + return embeddedWalletsApi.sendSolanaAssetWithEndUserAccount( + pid, userId, address, asset, walletJwt, idempotencyKey, null, request); + } + + // ==================== Internal Helpers ==================== + + /** + * Returns the configured project ID or throws if not configured. + * + * @return the project ID + * @throws IllegalStateException if project ID is not configured + */ + private String requireProjectId() { + if (projectId == null || projectId.isBlank()) { + throw new IllegalStateException( + "Missing required project ID for delegation operation. " + + "Set the CDP_PROJECT_ID environment variable or pass projectId to the CdpClient builder."); + } + return projectId; + } + + private String generateWalletJwt(String method, String path, Object requestBody) { + if (cdpClient != null) { + return cdpClient.generateWalletJwt(method, path, requestBody); + } + // Use pre-generated wallet JWT from TokenProvider for static factory pattern + if (tokenProvider != null) { + return tokenProvider.walletAuthToken().orElse(null); + } + return null; + } + + /** + * Decodes a private key string to raw bytes based on the key type. + * + * @param privateKey the private key string + * @param keyType "evm" or "solana" + * @return the decoded private key bytes + */ + private static byte[] decodePrivateKey(String privateKey, String keyType) { + if ("evm".equals(keyType)) { + String hex = privateKey.startsWith("0x") ? privateKey.substring(2) : privateKey; + if (!hex.matches("[0-9a-fA-F]+")) { + throw new IllegalArgumentException("EVM private key must be a valid hexadecimal string"); + } + return hexToBytes(hex); + } else if ("solana".equals(keyType)) { + // Solana: base58 encoded string + byte[] decoded = decodeBase58(privateKey); + if (decoded.length != 32 && decoded.length != 64) { + throw new IllegalArgumentException("Invalid Solana private key length"); + } + // Truncate 64-byte keys to 32 bytes (seed only) + if (decoded.length == 64) { + byte[] seed = new byte[32]; + System.arraycopy(decoded, 0, seed, 0, 32); + return seed; + } + return decoded; + } else { + throw new IllegalArgumentException("Unsupported key type: " + keyType); + } + } + + /** + * Encrypts data with RSA-OAEP using SHA-256. + * + * @param data the data to encrypt + * @param publicKeyPem the RSA public key in PEM format + * @return the encrypted data as a base64 string + */ + private static String encryptWithRsa(byte[] data, String publicKeyPem) { + try { + String keyContent = + publicKeyPem + .replace("-----BEGIN PUBLIC KEY-----", "") + .replace("-----END PUBLIC KEY-----", "") + .replaceAll("\\s+", ""); + + byte[] keyBytes = Base64.getDecoder().decode(keyContent); + X509EncodedKeySpec keySpec = new X509EncodedKeySpec(keyBytes); + KeyFactory keyFactory = KeyFactory.getInstance("RSA"); + PublicKey publicKey = keyFactory.generatePublic(keySpec); + + Cipher cipher = Cipher.getInstance("RSA/ECB/OAEPWithSHA-256AndMGF1Padding"); + cipher.init(Cipher.ENCRYPT_MODE, publicKey); + + byte[] encrypted = cipher.doFinal(data); + return Base64.getEncoder().encodeToString(encrypted); + } catch (Exception e) { + throw new RuntimeException("Failed to encrypt private key with RSA", e); + } + } + + /** + * Converts a hex string to a byte array. + * + * @param hex the hex string (without 0x prefix) + * @return the byte array + */ + private static byte[] hexToBytes(String hex) { + int len = hex.length(); + byte[] data = new byte[len / 2]; + for (int i = 0; i < len; i += 2) { + data[i / 2] = + (byte) + ((Character.digit(hex.charAt(i), 16) << 4) + Character.digit(hex.charAt(i + 1), 16)); + } + return data; + } + + /** + * Decodes a base58-encoded string to bytes. + * + * @param input the base58 string + * @return the decoded bytes + */ + private static byte[] decodeBase58(String input) { + String alphabet = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"; + + java.math.BigInteger result = java.math.BigInteger.ZERO; + java.math.BigInteger base = java.math.BigInteger.valueOf(58); + + for (int i = 0; i < input.length(); i++) { + int digit = alphabet.indexOf(input.charAt(i)); + if (digit < 0) { + throw new IllegalArgumentException("Invalid base58 character: " + input.charAt(i)); + } + result = result.multiply(base).add(java.math.BigInteger.valueOf(digit)); + } + + // Count leading zeros (1's in base58) + int leadingZeros = 0; + for (int i = 0; i < input.length() && input.charAt(i) == '1'; i++) { + leadingZeros++; + } + + byte[] decoded = result.toByteArray(); + // Remove the leading zero byte that BigInteger may add for sign + boolean stripSignByte = decoded.length > 1 && decoded[0] == 0; + int stripOffset = stripSignByte ? 1 : 0; + + byte[] output = new byte[leadingZeros + decoded.length - stripOffset]; + System.arraycopy(decoded, stripOffset, output, leadingZeros, decoded.length - stripOffset); + + return output; + } +} diff --git a/java/src/main/java/com/coinbase/cdp/client/enduser/EndUserClientOptions.java b/java/src/main/java/com/coinbase/cdp/client/enduser/EndUserClientOptions.java new file mode 100644 index 000000000..986ddd524 --- /dev/null +++ b/java/src/main/java/com/coinbase/cdp/client/enduser/EndUserClientOptions.java @@ -0,0 +1,175 @@ +package com.coinbase.cdp.client.enduser; + +import com.coinbase.cdp.openapi.model.AuthenticationMethods; +import java.util.ArrayList; +import java.util.List; + +/** + * Options records for End User client operations. + * + *

    For operations that accept request bodies, use the generated OpenAPI request types directly + * (e.g., {@code CreateEndUserRequest}, {@code ImportEndUserRequest}). This file contains only + * options for operations that don't have corresponding request types, such as list operations with + * query parameters. + */ +public final class EndUserClientOptions { + private EndUserClientOptions() {} + + // ==================== Pagination / List Options ==================== + + /** Options for listing end users. */ + public record ListEndUsersOptions(Integer pageSize, String pageToken, List sort) { + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Integer pageSize; + private String pageToken; + private List sort; + + /** + * Sets the number of end users per page. + * + * @param size the page size (default: 20) + * @return this builder + */ + public Builder pageSize(Integer size) { + this.pageSize = size; + return this; + } + + /** + * Sets the page token for pagination. + * + * @param token the page token + * @return this builder + */ + public Builder pageToken(String token) { + this.pageToken = token; + return this; + } + + /** + * Sets the sort order. + * + *

    Example: {@code List.of("createdAt=desc")} + * + * @param sort the sort criteria + * @return this builder + */ + public Builder sort(List sort) { + this.sort = sort != null ? new ArrayList<>(sort) : null; + return this; + } + + public ListEndUsersOptions build() { + return new ListEndUsersOptions(pageSize, pageToken, sort); + } + } + } + + /** Options for importing an end user's private key. */ + public record ImportEndUserOptions( + String userId, + String privateKey, + String keyType, + AuthenticationMethods authenticationMethods, + String encryptionPublicKey) { + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String userId; + private String privateKey; + private String keyType; + private AuthenticationMethods authenticationMethods; + private String encryptionPublicKey; + + /** + * Sets the stable, unique identifier for the end user. If not provided, a UUID will be + * generated. + * + * @param userId the user ID + * @return this builder + */ + public Builder userId(String userId) { + this.userId = userId; + return this; + } + + /** + * Sets the private key to import. + * + *

      + *
    • For EVM: hex string (with or without 0x prefix) + *
    • For Solana: base58 encoded string + *
    + * + *

    The SDK will encrypt this before sending to the API. + * + * @param privateKey the private key string + * @return this builder + */ + public Builder privateKey(String privateKey) { + this.privateKey = privateKey; + return this; + } + + /** + * Sets the type of key being imported. + * + * @param keyType "evm" or "solana" + * @return this builder + */ + public Builder keyType(String keyType) { + this.keyType = keyType; + return this; + } + + /** + * Sets the authentication methods for the end user. + * + * @param authenticationMethods the authentication methods + * @return this builder + */ + public Builder authenticationMethods(AuthenticationMethods authenticationMethods) { + this.authenticationMethods = authenticationMethods; + return this; + } + + /** + * Sets an optional RSA public key to encrypt the private key. Defaults to the known CDP + * public key if not provided. + * + * @param encryptionPublicKey the RSA public key in PEM format + * @return this builder + */ + public Builder encryptionPublicKey(String encryptionPublicKey) { + this.encryptionPublicKey = encryptionPublicKey; + return this; + } + + /** + * Builds the import options. + * + * @return the import options + * @throws IllegalArgumentException if required fields are missing + */ + public ImportEndUserOptions build() { + if (privateKey == null || privateKey.isBlank()) { + throw new IllegalArgumentException("privateKey is required"); + } + if (keyType == null || keyType.isBlank()) { + throw new IllegalArgumentException("keyType is required (\"evm\" or \"solana\")"); + } + if (authenticationMethods == null) { + throw new IllegalArgumentException("authenticationMethods is required"); + } + return new ImportEndUserOptions( + userId, privateKey, keyType, authenticationMethods, encryptionPublicKey); + } + } + } +} 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..d808515cc --- /dev/null +++ b/java/src/main/java/com/coinbase/cdp/openapi/api/EmbeddedWalletsCoreFunctionalityApi.java @@ -0,0 +1,1863 @@ +/* + * 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.CreateEvmEip7702Delegation201Response; +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.SendEvmTransaction200Response; +import com.coinbase.cdp.openapi.model.SendEvmTransactionWithEndUserAccountRequest; +import com.coinbase.cdp.openapi.model.SendSolanaAssetWithEndUserAccount200Response; +import com.coinbase.cdp.openapi.model.SendSolanaAssetWithEndUserAccountRequest; +import com.coinbase.cdp.openapi.model.SendSolanaTransaction200Response; +import com.coinbase.cdp.openapi.model.SendSolanaTransactionWithEndUserAccountRequest; +import com.coinbase.cdp.openapi.model.SendUserOperationWithEndUserAccountRequest; +import com.coinbase.cdp.openapi.model.SignEvmHash200Response; +import com.coinbase.cdp.openapi.model.SignEvmHashWithEndUserAccountRequest; +import com.coinbase.cdp.openapi.model.SignEvmMessage200Response; +import com.coinbase.cdp.openapi.model.SignEvmMessageWithEndUserAccountRequest; +import com.coinbase.cdp.openapi.model.SignEvmTransaction200Response; +import com.coinbase.cdp.openapi.model.SignEvmTransactionWithEndUserAccountRequest; +import com.coinbase.cdp.openapi.model.SignEvmTypedData200Response; +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.SignSolanaMessage200Response; +import com.coinbase.cdp.openapi.model.SignSolanaMessageWithEndUserAccountRequest; +import com.coinbase.cdp.openapi.model.SignSolanaTransaction200Response; +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 CreateEvmEip7702Delegation201Response + * @throws ApiException if fails to make API call + */ + public CreateEvmEip7702Delegation201Response 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<CreateEvmEip7702Delegation201Response> + * @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 SendEvmTransaction200Response + * @throws ApiException if fails to make API call + */ + public SendEvmTransaction200Response 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<SendEvmTransaction200Response> + * @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 SendSolanaAssetWithEndUserAccount200Response + * @throws ApiException if fails to make API call + */ + public SendSolanaAssetWithEndUserAccount200Response 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<SendSolanaAssetWithEndUserAccount200Response> + * @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 SendSolanaTransaction200Response + * @throws ApiException if fails to make API call + */ + public SendSolanaTransaction200Response 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<SendSolanaTransaction200Response> + * @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 SignEvmHash200Response + * @throws ApiException if fails to make API call + */ + public SignEvmHash200Response 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<SignEvmHash200Response> + * @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 SignEvmMessage200Response + * @throws ApiException if fails to make API call + */ + public SignEvmMessage200Response 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<SignEvmMessage200Response> + * @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 SignEvmTransaction200Response + * @throws ApiException if fails to make API call + */ + public SignEvmTransaction200Response 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<SignEvmTransaction200Response> + * @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 SignEvmTypedData200Response + * @throws ApiException if fails to make API call + */ + public SignEvmTypedData200Response 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<SignEvmTypedData200Response> + * @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 SignSolanaMessage200Response + * @throws ApiException if fails to make API call + */ + public SignSolanaMessage200Response 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<SignSolanaMessage200Response> + * @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 SignSolanaTransaction200Response + * @throws ApiException if fails to make API call + */ + public SignSolanaTransaction200Response 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<SignSolanaTransaction200Response> + * @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/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/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/CreateEvmEip7702Delegation201Response.java b/java/src/main/java/com/coinbase/cdp/openapi/model/CreateEvmEip7702Delegation201Response.java index 964342cd8..7bdd458ab 100644 --- a/java/src/main/java/com/coinbase/cdp/openapi/model/CreateEvmEip7702Delegation201Response.java +++ b/java/src/main/java/com/coinbase/cdp/openapi/model/CreateEvmEip7702Delegation201Response.java @@ -70,7 +70,7 @@ public void setDelegationOperationId(@jakarta.annotation.Nonnull UUID delegation /** - * Return true if this createEvmEip7702Delegation_201_response object is equal to o. + * Return true if this CreateEvmEip7702Delegation201Response object is equal to o. */ @Override public boolean equals(Object o) { 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..fd4724194 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.Nullable + 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.Nullable + 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.Nullable 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.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 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.Nullable Boolean useCdpPaymaster) { + this.useCdpPaymaster = useCdpPaymaster; + return this; + } + + /** + * Whether to use the CDP Paymaster for the user operation. + * @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 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/SendEvmTransaction200Response.java b/java/src/main/java/com/coinbase/cdp/openapi/model/SendEvmTransaction200Response.java index 2b782bd17..c250afa79 100644 --- a/java/src/main/java/com/coinbase/cdp/openapi/model/SendEvmTransaction200Response.java +++ b/java/src/main/java/com/coinbase/cdp/openapi/model/SendEvmTransaction200Response.java @@ -69,7 +69,7 @@ public void setTransactionHash(@jakarta.annotation.Nonnull String transactionHas /** - * Return true if this sendEvmTransaction_200_response object is equal to o. + * Return true if this SendEvmTransaction200Response object is equal to o. */ @Override public boolean equals(Object o) { 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/SendSolanaAssetWithEndUserAccount200Response.java b/java/src/main/java/com/coinbase/cdp/openapi/model/SendSolanaAssetWithEndUserAccount200Response.java new file mode 100644 index 000000000..52c605f78 --- /dev/null +++ b/java/src/main/java/com/coinbase/cdp/openapi/model/SendSolanaAssetWithEndUserAccount200Response.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; +/** + * SendSolanaAssetWithEndUserAccount200Response + */ +@JsonPropertyOrder({ + SendSolanaAssetWithEndUserAccount200Response.JSON_PROPERTY_TRANSACTION_SIGNATURE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class SendSolanaAssetWithEndUserAccount200Response { + public static final String JSON_PROPERTY_TRANSACTION_SIGNATURE = "transactionSignature"; + @jakarta.annotation.Nonnull + private String transactionSignature; + + public SendSolanaAssetWithEndUserAccount200Response() { + } + + public SendSolanaAssetWithEndUserAccount200Response 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 sendSolanaAssetWithEndUserAccount_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; + } + SendSolanaAssetWithEndUserAccount200Response sendSolanaAssetWithEndUserAccount200Response = (SendSolanaAssetWithEndUserAccount200Response) o; + return Objects.equals(this.transactionSignature, sendSolanaAssetWithEndUserAccount200Response.transactionSignature); + } + + @Override + public int hashCode() { + return Objects.hash(transactionSignature); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SendSolanaAssetWithEndUserAccount200Response {\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 SendSolanaAssetWithEndUserAccount200Response instance; + + public Builder() { + this(new SendSolanaAssetWithEndUserAccount200Response()); + } + + protected Builder(SendSolanaAssetWithEndUserAccount200Response instance) { + this.instance = instance; + } + + public SendSolanaAssetWithEndUserAccount200Response.Builder transactionSignature(String transactionSignature) { + this.instance.transactionSignature = transactionSignature; + return this; + } + + + /** + * returns a built SendSolanaAssetWithEndUserAccount200Response instance. + * + * The builder is not reusable. + */ + public SendSolanaAssetWithEndUserAccount200Response 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 SendSolanaAssetWithEndUserAccount200Response.Builder builder() { + return new SendSolanaAssetWithEndUserAccount200Response.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SendSolanaAssetWithEndUserAccount200Response.Builder toBuilder() { + return new SendSolanaAssetWithEndUserAccount200Response.Builder() + .transactionSignature(getTransactionSignature()); + } + +} + 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/SendSolanaTransaction200Response.java b/java/src/main/java/com/coinbase/cdp/openapi/model/SendSolanaTransaction200Response.java index 4e5bcee1b..6b5461ef7 100644 --- a/java/src/main/java/com/coinbase/cdp/openapi/model/SendSolanaTransaction200Response.java +++ b/java/src/main/java/com/coinbase/cdp/openapi/model/SendSolanaTransaction200Response.java @@ -69,7 +69,7 @@ public void setTransactionSignature(@jakarta.annotation.Nonnull String transacti /** - * Return true if this sendSolanaTransaction_200_response object is equal to o. + * Return true if this SendSolanaTransaction200Response object is equal to o. */ @Override public boolean equals(Object o) { 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/SignEvmHash200Response.java b/java/src/main/java/com/coinbase/cdp/openapi/model/SignEvmHash200Response.java index b13d4dd16..f7dac782e 100644 --- a/java/src/main/java/com/coinbase/cdp/openapi/model/SignEvmHash200Response.java +++ b/java/src/main/java/com/coinbase/cdp/openapi/model/SignEvmHash200Response.java @@ -69,7 +69,7 @@ public void setSignature(@jakarta.annotation.Nonnull String signature) { /** - * Return true if this signEvmHash_200_response object is equal to o. + * Return true if this SignEvmHash200Response object is equal to o. */ @Override public boolean equals(Object o) { 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/SignEvmMessage200Response.java b/java/src/main/java/com/coinbase/cdp/openapi/model/SignEvmMessage200Response.java index c2445d405..7f03f9211 100644 --- a/java/src/main/java/com/coinbase/cdp/openapi/model/SignEvmMessage200Response.java +++ b/java/src/main/java/com/coinbase/cdp/openapi/model/SignEvmMessage200Response.java @@ -69,7 +69,7 @@ public void setSignature(@jakarta.annotation.Nonnull String signature) { /** - * Return true if this signEvmMessage_200_response object is equal to o. + * Return true if this SignEvmMessage200Response object is equal to o. */ @Override public boolean equals(Object o) { 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/SignEvmTransaction200Response.java b/java/src/main/java/com/coinbase/cdp/openapi/model/SignEvmTransaction200Response.java index c63ca48fe..58dadb84d 100644 --- a/java/src/main/java/com/coinbase/cdp/openapi/model/SignEvmTransaction200Response.java +++ b/java/src/main/java/com/coinbase/cdp/openapi/model/SignEvmTransaction200Response.java @@ -69,7 +69,7 @@ public void setSignedTransaction(@jakarta.annotation.Nonnull String signedTransa /** - * Return true if this signEvmTransaction_200_response object is equal to o. + * Return true if this SignEvmTransaction200Response object is equal to o. */ @Override public boolean equals(Object o) { 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/SignEvmTypedData200Response.java b/java/src/main/java/com/coinbase/cdp/openapi/model/SignEvmTypedData200Response.java index 876ff1529..fe5f285e7 100644 --- a/java/src/main/java/com/coinbase/cdp/openapi/model/SignEvmTypedData200Response.java +++ b/java/src/main/java/com/coinbase/cdp/openapi/model/SignEvmTypedData200Response.java @@ -69,7 +69,7 @@ public void setSignature(@jakarta.annotation.Nonnull String signature) { /** - * Return true if this signEvmTypedData_200_response object is equal to o. + * Return true if this SignEvmTypedData200Response object is equal to o. */ @Override public boolean equals(Object o) { 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/SignSolanaMessage200Response.java b/java/src/main/java/com/coinbase/cdp/openapi/model/SignSolanaMessage200Response.java index 8f4a914d1..231e86966 100644 --- a/java/src/main/java/com/coinbase/cdp/openapi/model/SignSolanaMessage200Response.java +++ b/java/src/main/java/com/coinbase/cdp/openapi/model/SignSolanaMessage200Response.java @@ -69,7 +69,7 @@ public void setSignature(@jakarta.annotation.Nonnull String signature) { /** - * Return true if this signSolanaMessage_200_response object is equal to o. + * Return true if this SignSolanaMessage200Response object is equal to o. */ @Override public boolean equals(Object o) { 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/SignSolanaTransaction200Response.java b/java/src/main/java/com/coinbase/cdp/openapi/model/SignSolanaTransaction200Response.java index 637233e10..263527894 100644 --- a/java/src/main/java/com/coinbase/cdp/openapi/model/SignSolanaTransaction200Response.java +++ b/java/src/main/java/com/coinbase/cdp/openapi/model/SignSolanaTransaction200Response.java @@ -69,7 +69,7 @@ public void setSignedTransaction(@jakarta.annotation.Nonnull String signedTransa /** - * Return true if this signSolanaTransaction_200_response object is equal to o. + * Return true if this SignSolanaTransaction200Response object is equal to o. */ @Override public boolean equals(Object o) { 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/python/README.md b/python/README.md index de1205be2..c124c9e31 100644 --- a/python/README.md +++ b/python/README.md @@ -24,10 +24,20 @@ - [End-user Management](#end-user-management) - [Create End User](#create-end-user) - [Import End User](#import-end-user) + - [Get End User](#get-end-user) + - [List End Users](#list-end-users) - [Add EVM Account to End User](#add-evm-account-to-end-user) - [Add EVM Smart Account to End User](#add-evm-smart-account-to-end-user) - [Add Solana Account to End User](#add-solana-account-to-end-user) - [Validate Access Token](#validate-access-token) + - [Delegated Signing and Sending](#delegated-signing-and-sending) + - [EIP-7702 Delegation](#end-user-eip-7702-delegation) + - [Revoke Delegation](#revoke-delegation) + - [Sign EVM Hash](#sign-evm-hash) + - [Send EVM Transaction](#send-evm-transaction-end-user) + - [Send EVM Asset](#send-evm-asset) + - [Send User Operation](#send-user-operation-end-user) + - [Sign Solana Message](#sign-solana-message) - [Authentication Tools](#authentication-tools) - [Error Reporting](#error-reporting) - [Usage Tracking](#usage-tracking) @@ -1496,6 +1506,242 @@ except Exception as e: # Access token is invalid or expired ``` +#### Get End User + +Retrieve an end user by their user ID. Requires `CDP_PROJECT_ID` to be set. + +```python +end_user = await cdp.end_user.get_end_user(user_id="user-123") + +print(f"End user: {end_user.user_id}") +print(f"EVM accounts: {[a.address for a in end_user.evm_account_objects]}") +print(f"Solana accounts: {[a.address for a in end_user.solana_account_objects]}") +``` + +#### List End Users + +List all end users belonging to your CDP Project: + +```python +result = await cdp.end_user.list_end_users(page_size=10) + +for user in result.end_users: + print(f"User: {user.user_id}") + +# Paginate through results +if result.next_page_token: + next_result = await cdp.end_user.list_end_users( + page_size=10, + page_token=result.next_page_token, + ) +``` + +#### Delegated Signing and Sending + +Delegated signing and sending operations allow a developer to sign transactions and messages on behalf of an end user. These operations require: + +1. The end user must have created a **delegation** granting the developer permission to sign on their behalf. +2. A `CDP_PROJECT_ID` environment variable (or `project_id` passed to `CdpClient`). + +> **Note**: Delegation is established through the end user's client-side flow using the [Embedded Wallet SDK](https://docs.cdp.coinbase.com/embedded-wallets/welcome). See the CDP documentation for details on how end users create delegations. + +#### EIP-7702 Delegation {#end-user-eip-7702-delegation} + +Create an EIP-7702 delegation to upgrade an end user's EVM EOA with smart account capabilities. You can call the method directly on the EndUserAccount object: + +```python +result = await end_user.create_evm_eip7702_delegation( + network="base-sepolia", + enable_spend_permissions=True, +) + +print(f"Delegation operation ID: {result.operation_id}") +``` + +Or use the client method with a user ID: + +```python +result = await cdp.end_user.create_evm_eip7702_delegation( + user_id=end_user.user_id, + address=end_user.evm_accounts[0], + network="base-sepolia", + enable_spend_permissions=True, +) + +print(f"Delegation operation ID: {result.operation_id}") +``` + +#### Revoke Delegation + +Revoke all active delegations for an end user. After revocation, the developer can no longer sign on behalf of the end user until a new delegation is created. You can call the method directly on the EndUserAccount object: + +```python +await end_user.revoke_delegation() +``` + +Or use the client method with a user ID: + +```python +await cdp.end_user.revoke_delegation(user_id=end_user.user_id) +``` + +#### Sign EVM Hash + +Sign a 32-byte EVM hash on behalf of an end user. You can call the method directly on the EndUserAccount object: + +```python +result = await end_user.sign_evm_hash( + hash="0x...", # 32-byte hash (0x-prefixed hex) +) + +print(f"Signature: {result.signature}") +``` + +Or use the client method with a user ID: + +```python +result = await cdp.end_user.sign_evm_hash( + user_id=end_user.user_id, + hash="0x...", + address=end_user.evm_accounts[0], +) + +print(f"Signature: {result.signature}") +``` + +#### Send EVM Transaction (End User) {#send-evm-transaction-end-user} + +Sign and broadcast an EVM transaction on behalf of an end user. You can call the method directly on the EndUserAccount object: + +```python +result = await end_user.send_evm_transaction( + transaction="0x...", # RLP-encoded unsigned EIP-1559 transaction + network="base-sepolia", +) + +print(f"Transaction hash: {result.transaction_hash}") +``` + +Or use the client method with a user ID: + +```python +result = await cdp.end_user.send_evm_transaction( + user_id=end_user.user_id, + address=end_user.evm_accounts[0], + transaction="0x...", + network="base-sepolia", +) + +print(f"Transaction hash: {result.transaction_hash}") +``` + +#### Send EVM Asset + +Send an EVM asset (e.g. USDC) on behalf of an end user. You can call the method directly on the EndUserAccount object: + +```python +result = await end_user.send_evm_asset( + to="0xRecipientAddress", + amount="1000000", # 1 USDC (6 decimals) + network="base-sepolia", + asset="usdc", +) + +print(f"Transaction hash: {result.transaction_hash}") +``` + +Or use the client method with a user ID: + +```python +result = await cdp.end_user.send_evm_asset( + user_id=end_user.user_id, + address=end_user.evm_accounts[0], + to="0xRecipientAddress", + amount="1000000", + network="base-sepolia", + asset="usdc", +) + +print(f"Transaction hash: {result.transaction_hash}") +``` + +For smart accounts, you can optionally use the CDP paymaster for gas sponsorship: + +```python +result = await end_user.send_evm_asset( + to="0xRecipientAddress", + amount="1000000", + network="base-sepolia", + asset="usdc", + use_cdp_paymaster=True, +) +``` + +#### Send User Operation (End User) {#send-user-operation-end-user} + +Send a user operation (ERC-4337) for an end user's Smart Account. You can call the method directly on the EndUserAccount object: + +```python +result = await end_user.send_user_operation( + network="base-sepolia", + calls=[ + { + "to": "0xContractAddress", + "value": "0", + "data": "0x...", + } + ], +) + +print(f"User operation hash: {result.user_op_hash}") +``` + +Or use the client method with a user ID: + +```python +result = await cdp.end_user.send_user_operation( + user_id=end_user.user_id, + address=end_user.evm_smart_accounts[0], + network="base-sepolia", + calls=[ + { + "to": "0xContractAddress", + "value": "0", + "data": "0x...", + } + ], +) + +print(f"User operation hash: {result.user_op_hash}") +``` + +#### Sign Solana Message + +Sign a Solana message on behalf of an end user. You can call the method directly on the EndUserAccount object: + +```python +import base64 + +message_bytes = b"Hello, Solana!" +encoded_message = base64.b64encode(message_bytes).decode() + +result = await end_user.sign_solana_message(message=encoded_message) + +print(f"Signature: {result.signature}") +``` + +Or use the client method with a user ID: + +```python +result = await cdp.end_user.sign_solana_message( + user_id=end_user.user_id, + address=end_user.solana_accounts[0], + message=encoded_message, +) + +print(f"Signature: {result.signature}") +``` + ## Authentication tools This SDK also contains simple tools for authenticating REST API requests to the [Coinbase Developer Platform (CDP)](https://docs.cdp.coinbase.com/). See the [Auth README](cdp/auth/README.md) for more details. diff --git a/python/cdp/api_clients.py b/python/cdp/api_clients.py index d88684ad0..071b8bb90 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 @@ -49,6 +52,7 @@ def __init__(self, cdp_client: CdpApiClient) -> None: self._solana_token_balances: SolanaTokenBalancesApi | None = None self._policies: PolicyEngineApi | None = None self._end_user: EndUserAccountsApi | None = None + self._embedded_wallets_core: EmbeddedWalletsCoreFunctionalityApi | None = None self._closed = False def _check_closed(self) -> None: @@ -216,6 +220,24 @@ def end_user(self) -> EndUserAccountsApi: self._end_user = EndUserAccountsApi(api_client=self._cdp_client) return self._end_user + @property + def embedded_wallets_core(self) -> EmbeddedWalletsCoreFunctionalityApi: + """Get the EmbeddedWalletsCoreFunctionalityApi client instance. + + Returns: + EmbeddedWalletsCoreFunctionalityApi: The embedded wallets core functionality API client. + + Note: + This property lazily initializes the EmbeddedWalletsCoreFunctionalityApi client on first access. + + """ + self._check_closed() + if self._embedded_wallets_core is None: + self._embedded_wallets_core = EmbeddedWalletsCoreFunctionalityApi( + api_client=self._cdp_client + ) + return self._embedded_wallets_core + async def close(self): """Close the CDP client asynchronously.""" await self._cdp_client.close() diff --git a/python/cdp/auth/utils/http.py b/python/cdp/auth/utils/http.py index 2b13d0e97..cde1c5ae8 100644 --- a/python/cdp/auth/utils/http.py +++ b/python/cdp/auth/utils/http.py @@ -118,6 +118,7 @@ def _requires_wallet_auth(method: str, path: str) -> bool: or bool(re.search(r"/end-users/[^/]+/evm$", path)) or bool(re.search(r"/end-users/[^/]+/evm-smart-account$", path)) or bool(re.search(r"/end-users/[^/]+/solana$", path)) + or "/embedded-wallet-api/" in path ) and (method == "POST" or method == "DELETE" or method == "PUT") diff --git a/python/cdp/cdp_client.py b/python/cdp/cdp_client.py index 92172de39..6ec8d41af 100644 --- a/python/cdp/cdp_client.py +++ b/python/cdp/cdp_client.py @@ -89,10 +89,12 @@ def __init__( ) self.api_clients = ApiClients(self.cdp_api_client) + self.project_id = os.getenv("CDP_PROJECT_ID") + 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=self.project_id) self._closed = False if ( diff --git a/python/cdp/end_user_account.py b/python/cdp/end_user_account.py index 05e68dba5..26c0dea0d 100644 --- a/python/cdp/end_user_account.py +++ b/python/cdp/end_user_account.py @@ -17,18 +17,93 @@ AddEndUserSolanaAccount201Response, ) from cdp.openapi_client.models.authentication_method import AuthenticationMethod +from cdp.openapi_client.models.create_evm_eip7702_delegation201_response import ( + CreateEvmEip7702Delegation201Response, +) +from cdp.openapi_client.models.create_evm_eip7702_delegation_with_end_user_account_request import ( + CreateEvmEip7702DelegationWithEndUserAccountRequest, +) 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_user_operation import EvmUserOperation 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_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_transaction200_response import ( + SendEvmTransaction200Response, +) +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_account200_response import ( + SendSolanaAssetWithEndUserAccount200Response, +) +from cdp.openapi_client.models.send_solana_asset_with_end_user_account_request import ( + SendSolanaAssetWithEndUserAccountRequest, +) +from cdp.openapi_client.models.send_solana_transaction200_response import ( + SendSolanaTransaction200Response, +) +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_hash200_response import SignEvmHash200Response +from cdp.openapi_client.models.sign_evm_hash_with_end_user_account_request import ( + SignEvmHashWithEndUserAccountRequest, +) +from cdp.openapi_client.models.sign_evm_message200_response import SignEvmMessage200Response +from cdp.openapi_client.models.sign_evm_message_with_end_user_account_request import ( + SignEvmMessageWithEndUserAccountRequest, +) +from cdp.openapi_client.models.sign_evm_transaction200_response import ( + SignEvmTransaction200Response, +) +from cdp.openapi_client.models.sign_evm_transaction_with_end_user_account_request import ( + SignEvmTransactionWithEndUserAccountRequest, +) +from cdp.openapi_client.models.sign_evm_typed_data200_response import SignEvmTypedData200Response +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_message200_response import SignSolanaMessage200Response +from cdp.openapi_client.models.sign_solana_message_with_end_user_account_request import ( + SignSolanaMessageWithEndUserAccountRequest, +) +from cdp.openapi_client.models.sign_solana_transaction200_response import ( + SignSolanaTransaction200Response, +) +from cdp.openapi_client.models.sign_solana_transaction_with_end_user_account_request import ( + SignSolanaTransactionWithEndUserAccountRequest, +) 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. + managing accounts and performing delegated signing/sending operations + directly on the object. + + Delegated sign/send operations require the end user to have created a + delegation allowing the developer to sign on their behalf. """ model_config = ConfigDict(arbitrary_types_allowed=True) @@ -37,12 +112,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): Optional CDP project ID for delegated operations. """ super().__init__() @@ -58,6 +135,16 @@ 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 _require_project_id(self) -> str: + """Return the configured project ID or raise if not set.""" + if not self.__project_id: + raise ValueError( + "Project ID not configured. Delegated end-user operations require a project ID. " + "Set the CDP_PROJECT_ID environment variable, or pass project_id to CdpClient." + ) + return self.__project_id def __str__(self) -> str: """Get the string representation of the end user account. @@ -183,6 +270,8 @@ def created_at(self) -> datetime: """ return self.__created_at + # ==================== Account Management ==================== + async def add_evm_account(self) -> AddEndUserEvmAccount201Response: """Add an EVM EOA (Externally Owned Account) to this end user. @@ -191,13 +280,6 @@ async def add_evm_account(self) -> AddEndUserEvmAccount201Response: Returns: AddEndUserEvmAccount201Response: The result containing the newly created EVM EOA account. - Example: - >>> end_user = await cdp.end_user.create_end_user( - ... authentication_methods=[AuthenticationMethod(type="email", email="user@example.com")] - ... ) - >>> result = await end_user.add_evm_account() - >>> print(result.evm_account.address) - """ track_action(action="end_user_add_evm_account") @@ -219,13 +301,6 @@ async def add_evm_smart_account( Returns: AddEndUserEvmSmartAccount201Response: The result containing the newly created EVM smart account. - Example: - >>> end_user = await cdp.end_user.create_end_user( - ... authentication_methods=[AuthenticationMethod(type="email", email="user@example.com")] - ... ) - >>> result = await end_user.add_evm_smart_account(enable_spend_permissions=True) - >>> print(result.evm_smart_account.address) - """ track_action(action="end_user_add_evm_smart_account") @@ -244,13 +319,6 @@ async def add_solana_account(self) -> AddEndUserSolanaAccount201Response: Returns: AddEndUserSolanaAccount201Response: The result containing the newly created Solana account. - Example: - >>> end_user = await cdp.end_user.create_end_user( - ... authentication_methods=[AuthenticationMethod(type="email", email="user@example.com")] - ... ) - >>> result = await end_user.add_solana_account() - >>> print(result.solana_account.address) - """ track_action(action="end_user_add_solana_account") @@ -258,3 +326,473 @@ async def add_solana_account(self) -> AddEndUserSolanaAccount201Response: user_id=self.__user_id, body={}, ) + + # ==================== Delegated EVM Sign Operations ==================== + + async def sign_evm_hash( + self, + hash: str, + address: str | None = None, + ) -> SignEvmHash200Response: + """Sign an EVM hash using a delegation. + + Requires the end user to have created a delegation. + + Args: + hash: The 32-byte hash to sign (0x-prefixed hex). + address: The EVM address to sign with. Defaults to the first EVM account. + + Returns: + SignEvmHash200Response: The signature response. + + """ + track_action(action="end_user_sign_evm_hash") + + project_id = self._require_project_id() + address = address or self.__evm_account_objects[0].address + return await self.__api_clients.embedded_wallets_core.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=address, + ), + ) + + async def sign_evm_message( + self, + message: str, + address: str | None = None, + ) -> SignEvmMessage200Response: + """Sign an EIP-191 message using a delegation. + + Requires the end user to have created a delegation. + + Args: + message: The plaintext message to sign. + address: The EVM address to sign with. Defaults to the first EVM account. + + Returns: + SignEvmMessage200Response: The signature response. + + """ + track_action(action="end_user_sign_evm_message") + + project_id = self._require_project_id() + address = address or self.__evm_account_objects[0].address + return await self.__api_clients.embedded_wallets_core.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( + message=message, + address=address, + ), + ) + + async def sign_evm_transaction( + self, + transaction: str, + address: str | None = None, + ) -> SignEvmTransaction200Response: + """Sign an EVM transaction using a delegation. + + Requires the end user to have created a delegation. + + Args: + transaction: The RLP-encoded unsigned EIP-1559 transaction (0x-prefixed hex). + address: The EVM address to sign with. Defaults to the first EVM account. + + Returns: + SignEvmTransaction200Response: The signed transaction response. + + """ + track_action(action="end_user_sign_evm_transaction") + + project_id = self._require_project_id() + address = address or self.__evm_account_objects[0].address + return await self.__api_clients.embedded_wallets_core.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( + transaction=transaction, + address=address, + ), + ) + + async def sign_evm_typed_data( + self, + typed_data: dict, + address: str | None = None, + ) -> SignEvmTypedData200Response: + """Sign EIP-712 typed data using a delegation. + + Requires the end user to have created a delegation. + + Args: + typed_data: The EIP-712 typed data structure. + address: The EVM address to sign with. Defaults to the first EVM account. + + Returns: + SignEvmTypedData200Response: The signature response. + + """ + track_action(action="end_user_sign_evm_typed_data") + + project_id = self._require_project_id() + address = address or self.__evm_account_objects[0].address + return await self.__api_clients.embedded_wallets_core.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( + typed_data_hash=typed_data, + address=address, + ), + ) + + # ==================== Delegated EVM Send Operations ==================== + + async def send_evm_transaction( + self, + transaction: str, + network: str, + address: str | None = None, + ) -> SendEvmTransaction200Response: + """Send an EVM transaction using a delegation. + + Signs and broadcasts the transaction. Requires the end user to have + created a delegation. + + Args: + transaction: The RLP-encoded unsigned EIP-1559 transaction (0x-prefixed hex). + network: The target EVM network (e.g. "base-sepolia", "base"). + address: The EVM address to send from. Defaults to the first EVM account. + + Returns: + SendEvmTransaction200Response: The transaction hash response. + + """ + track_action(action="end_user_send_evm_transaction") + + project_id = self._require_project_id() + address = address or self.__evm_account_objects[0].address + return await self.__api_clients.embedded_wallets_core.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( + transaction=transaction, + address=address, + network=network, + ), + ) + + async def send_evm_asset( + self, + to: str, + amount: str, + network: str, + address: str | None = None, + asset: str = "usdc", + use_cdp_paymaster: bool | None = None, + paymaster_url: str | None = None, + ) -> SendEvmAssetWithEndUserAccount200Response: + """Send an EVM asset (e.g. USDC) using a delegation. + + Requires the end user to have created a delegation. + + Args: + to: The recipient address. + amount: The amount to send (e.g. "1000000" for 1 USDC). + network: The target EVM network (e.g. "base-sepolia", "base"). + address: The EVM address to send from. Defaults to the first EVM account. + asset: The asset to send. Defaults to "usdc". + use_cdp_paymaster: Whether to use CDP paymaster for gas sponsorship. + paymaster_url: Optional custom paymaster URL. + + Returns: + SendEvmAssetWithEndUserAccount200Response: The transaction/user-op hash response. + + """ + track_action(action="end_user_send_evm_asset") + + project_id = self._require_project_id() + address = address or self.__evm_account_objects[0].address + request = SendEvmAssetWithEndUserAccountRequest( + to=to, + amount=amount, + network=network, + ) + if use_cdp_paymaster is not None: + request.use_cdp_paymaster = use_cdp_paymaster + if paymaster_url is not None: + request.paymaster_url = paymaster_url + + return await self.__api_clients.embedded_wallets_core.send_evm_asset_with_end_user_account( + project_id=project_id, + user_id=self.__user_id, + address=address, + asset=asset, + send_evm_asset_with_end_user_account_request=request, + ) + + async def send_user_operation( + self, + network: str, + calls: list[dict], + address: str | None = None, + use_cdp_paymaster: bool = True, + paymaster_url: str | None = None, + data_suffix: str | None = None, + ) -> EvmUserOperation: + """Send a user operation for a Smart Account using a delegation. + + Requires the end user to have created a delegation. + + Args: + network: The target EVM network (e.g. "base-sepolia", "base"). + calls: Array of call objects, each with "to", "value", and "data" keys. + address: The smart account address. Defaults to the first EVM smart account. + use_cdp_paymaster: Whether to use CDP paymaster. Defaults to True. + paymaster_url: Optional custom paymaster URL. + data_suffix: Optional hex data suffix appended to calldata. + + Returns: + EvmUserOperation: The user operation result. + + """ + track_action(action="end_user_send_user_operation") + + project_id = self._require_project_id() + address = address or self.__evm_smart_account_objects[0].address + request = SendUserOperationWithEndUserAccountRequest( + network=network, + calls=calls, + use_cdp_paymaster=use_cdp_paymaster, + ) + if paymaster_url is not None: + request.paymaster_url = paymaster_url + if data_suffix is not None: + request.data_suffix = data_suffix + + return await self.__api_clients.embedded_wallets_core.send_user_operation_with_end_user_account( + project_id=project_id, + user_id=self.__user_id, + address=address, + send_user_operation_with_end_user_account_request=request, + ) + + # ==================== Delegated Solana Sign Operations ==================== + + async def sign_solana_hash( + self, + hash: str, + address: str | None = None, + ) -> SignSolanaHashWithEndUserAccount200Response: + """Sign a Solana hash using a delegation. + + Requires the end user to have created a delegation. + + Args: + hash: The base58-encoded 32-byte hash. + address: The Solana address to sign with. Defaults to the first Solana account. + + Returns: + SignSolanaHashWithEndUserAccount200Response: The signature response. + + """ + track_action(action="end_user_sign_solana_hash") + + project_id = self._require_project_id() + address = address or self.__solana_account_objects[0].address + return await self.__api_clients.embedded_wallets_core.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=address, + ), + ) + + async def sign_solana_message( + self, + message: str, + address: str | None = None, + ) -> SignSolanaMessage200Response: + """Sign a Solana message using a delegation. + + Requires the end user to have created a delegation. + + Args: + message: The base64-encoded message to sign. + address: The Solana address to sign with. Defaults to the first Solana account. + + Returns: + SignSolanaMessage200Response: The signature response. + + """ + track_action(action="end_user_sign_solana_message") + + project_id = self._require_project_id() + address = address or self.__solana_account_objects[0].address + return await self.__api_clients.embedded_wallets_core.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( + message=message, + address=address, + ), + ) + + async def sign_solana_transaction( + self, + transaction: str, + address: str | None = None, + ) -> SignSolanaTransaction200Response: + """Sign a Solana transaction using a delegation. + + Requires the end user to have created a delegation. + + Args: + transaction: The base64-encoded unsigned Solana transaction. + address: The Solana address to sign with. Defaults to the first Solana account. + + Returns: + SignSolanaTransaction200Response: The signed transaction response. + + """ + track_action(action="end_user_sign_solana_transaction") + + project_id = self._require_project_id() + address = address or self.__solana_account_objects[0].address + return await self.__api_clients.embedded_wallets_core.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( + transaction=transaction, + address=address, + ), + ) + + # ==================== Delegated Solana Send Operations ==================== + + async def send_solana_transaction( + self, + transaction: str, + network: str, + address: str | None = None, + ) -> SendSolanaTransaction200Response: + """Send a Solana transaction using a delegation. + + Requires the end user to have created a delegation. + + Args: + transaction: The base64-encoded unsigned Solana transaction. + network: The target Solana network (e.g. "solana-devnet", "solana"). + address: The Solana address to send from. Defaults to the first Solana account. + + Returns: + SendSolanaTransaction200Response: The transaction signature response. + + """ + track_action(action="end_user_send_solana_transaction") + + project_id = self._require_project_id() + address = address or self.__solana_account_objects[0].address + return await self.__api_clients.embedded_wallets_core.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( + transaction=transaction, + address=address, + network=network, + ), + ) + + async def send_solana_asset( + self, + to: str, + amount: str, + network: str, + address: str | None = None, + asset: str = "usdc", + ) -> SendSolanaAssetWithEndUserAccount200Response: + """Send a Solana asset (e.g. USDC) using a delegation. + + Requires the end user to have created a delegation. + + Args: + to: The recipient address. + amount: The amount to send. + network: The target Solana network (e.g. "solana-devnet", "solana"). + address: The Solana address to send from. Defaults to the first Solana account. + asset: The asset to send. Defaults to "usdc". + + Returns: + SendSolanaAssetWithEndUserAccount200Response: The transaction signature response. + + """ + track_action(action="end_user_send_solana_asset") + + project_id = self._require_project_id() + address = address or self.__solana_account_objects[0].address + return await self.__api_clients.embedded_wallets_core.send_solana_asset_with_end_user_account( + project_id=project_id, + user_id=self.__user_id, + address=address, + asset=asset, + send_solana_asset_with_end_user_account_request=SendSolanaAssetWithEndUserAccountRequest( + to=to, + amount=amount, + network=network, + ), + ) + + # ==================== Delegation Lifecycle ==================== + + async def create_evm_eip7702_delegation( + self, + network: str, + address: str | None = None, + enable_spend_permissions: bool = False, + ) -> CreateEvmEip7702Delegation201Response: + """Create an EIP-7702 delegation for an EVM account. + + Upgrades the EVM EOA with smart account capabilities. + Requires the end user to have created a delegation. + + Args: + network: The target EVM network (e.g. "base-sepolia", "base"). + address: The EVM address to delegate. Defaults to the first EVM account. + enable_spend_permissions: Whether to enable spend permissions. Defaults to False. + + Returns: + CreateEvmEip7702Delegation201Response: The delegation operation ID. + + """ + track_action(action="end_user_create_evm_eip7702_delegation") + + project_id = self._require_project_id() + address = address or self.__evm_account_objects[0].address + return await self.__api_clients.embedded_wallets_core.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=address, + network=network, + enable_spend_permissions=enable_spend_permissions, + ), + ) + + async def revoke_delegation(self) -> None: + """Revoke all active delegations for this end user. + + After revocation, the developer can no longer sign on behalf of this + end user until a new delegation is created. + """ + track_action(action="end_user_revoke_delegation") + + project_id = self._require_project_id() + await self.__api_clients.embedded_wallets_core.revoke_delegation_for_end_user( + project_id=project_id, + user_id=self.__user_id, + revoke_delegation_for_end_user_request=RevokeDelegationForEndUserRequest(), + ) diff --git a/python/cdp/end_user_client.py b/python/cdp/end_user_client.py index 4c37d754f..19878f594 100644 --- a/python/cdp/end_user_client.py +++ b/python/cdp/end_user_client.py @@ -1,4 +1,5 @@ import base64 +import os import re import uuid from typing import Literal @@ -33,7 +34,78 @@ from cdp.openapi_client.models.create_end_user_request_solana_account import ( CreateEndUserRequestSolanaAccount, ) +from cdp.openapi_client.models.create_evm_eip7702_delegation201_response import ( + CreateEvmEip7702Delegation201Response, +) +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.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_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_transaction200_response import ( + SendEvmTransaction200Response, +) +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_account200_response import ( + SendSolanaAssetWithEndUserAccount200Response, +) +from cdp.openapi_client.models.send_solana_asset_with_end_user_account_request import ( + SendSolanaAssetWithEndUserAccountRequest, +) +from cdp.openapi_client.models.send_solana_transaction200_response import ( + SendSolanaTransaction200Response, +) +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_hash200_response import SignEvmHash200Response +from cdp.openapi_client.models.sign_evm_hash_with_end_user_account_request import ( + SignEvmHashWithEndUserAccountRequest, +) +from cdp.openapi_client.models.sign_evm_message200_response import SignEvmMessage200Response +from cdp.openapi_client.models.sign_evm_message_with_end_user_account_request import ( + SignEvmMessageWithEndUserAccountRequest, +) +from cdp.openapi_client.models.sign_evm_transaction200_response import ( + SignEvmTransaction200Response, +) +from cdp.openapi_client.models.sign_evm_transaction_with_end_user_account_request import ( + SignEvmTransactionWithEndUserAccountRequest, +) +from cdp.openapi_client.models.sign_evm_typed_data200_response import SignEvmTypedData200Response +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_message200_response import SignSolanaMessage200Response +from cdp.openapi_client.models.sign_solana_message_with_end_user_account_request import ( + SignSolanaMessageWithEndUserAccountRequest, +) +from cdp.openapi_client.models.sign_solana_transaction200_response import ( + SignSolanaTransaction200Response, +) +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, ) @@ -54,10 +126,25 @@ 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.""" + """The EndUserClient class is responsible for CDP API calls for the end user. + + Delegation operations (signing, sending, EIP-7702 delegation) require a project ID + to be configured. Set the CDP_PROJECT_ID environment variable or pass it when + constructing the CdpClient. + """ - 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 or os.getenv("CDP_PROJECT_ID") + + def _require_project_id(self) -> str: + """Return the configured project ID or raise if not set.""" + if not self._project_id: + raise ValueError( + "Project ID not configured. Delegated end-user operations require a project ID. " + "Set the CDP_PROJECT_ID environment variable, or pass project_id to CdpClient." + ) + return self._project_id async def create_end_user( self, @@ -96,7 +183,7 @@ async def create_end_user( ), ) - return EndUserAccount(end_user, self.api_clients) + return EndUserAccount(end_user, self.api_clients, self._project_id) async def list_end_users( self, @@ -124,7 +211,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, self._project_id) + for end_user in response.end_users ] return ListEndUsersResult( @@ -239,7 +327,7 @@ async def import_end_user( ), ) - return EndUserAccount(end_user, self.api_clients) + return EndUserAccount(end_user, self.api_clients, self._project_id) async def add_end_user_evm_account( self, @@ -310,3 +398,529 @@ async def add_end_user_solana_account( user_id=user_id, body={}, ) + + async def get_end_user( + self, + user_id: str, + ) -> EndUserAccount: + """Get an end user by their unique identifier. + + Args: + user_id: The unique identifier of the end user. + + Returns: + EndUserAccount: The end user with action methods. + + """ + track_action(action="get_end_user") + + project_id = self._require_project_id() + end_user = await self.api_clients.end_user.get_end_user( + project_id=project_id, + user_id=user_id, + ) + + return EndUserAccount(end_user, self.api_clients, self._project_id) + + # ==================== Delegated EVM Sign Operations ==================== + + async def sign_evm_hash( + self, + user_id: str, + hash: str, + address: str, + ) -> SignEvmHash200Response: + """Sign an EVM hash on behalf of an end user using a delegation. + + Requires the end user to have created a delegation allowing the developer + to sign on their behalf. + + Args: + user_id: The unique identifier of the end user. + hash: The 32-byte hash to sign (0x-prefixed hex). + address: The 0x-prefixed EVM address to sign with. + + Returns: + SignEvmHash200Response: The signature response. + + """ + track_action(action="sign_evm_hash_end_user") + + project_id = self._require_project_id() + return await self.api_clients.embedded_wallets_core.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, + ), + ) + + async def sign_evm_message( + self, + user_id: str, + address: str, + message: str, + ) -> SignEvmMessage200Response: + """Sign an EIP-191 message on behalf of an end user using a delegation. + + Requires the end user to have created a delegation allowing the developer + to sign on their behalf. + + Args: + user_id: The unique identifier of the end user. + address: The 0x-prefixed EVM address to sign with. + message: The plaintext message to sign. + + Returns: + SignEvmMessage200Response: The signature response. + + """ + track_action(action="sign_evm_message_end_user") + + project_id = self._require_project_id() + return await self.api_clients.embedded_wallets_core.sign_evm_message_with_end_user_account( + project_id=project_id, + user_id=user_id, + sign_evm_message_with_end_user_account_request=SignEvmMessageWithEndUserAccountRequest( + message=message, + address=address, + ), + ) + + async def sign_evm_transaction( + self, + user_id: str, + address: str, + transaction: str, + ) -> SignEvmTransaction200Response: + """Sign an EVM transaction on behalf of an end user using a delegation. + + Requires the end user to have created a delegation allowing the developer + to sign on their behalf. + + Args: + user_id: The unique identifier of the end user. + address: The 0x-prefixed EVM address to sign with. + transaction: The RLP-encoded unsigned EIP-1559 transaction (0x-prefixed hex). + + Returns: + SignEvmTransaction200Response: The signed transaction response. + + """ + track_action(action="sign_evm_transaction_end_user") + + project_id = self._require_project_id() + return await self.api_clients.embedded_wallets_core.sign_evm_transaction_with_end_user_account( + project_id=project_id, + user_id=user_id, + sign_evm_transaction_with_end_user_account_request=SignEvmTransactionWithEndUserAccountRequest( + transaction=transaction, + address=address, + ), + ) + + async def sign_evm_typed_data( + self, + user_id: str, + address: str, + typed_data: dict, + ) -> SignEvmTypedData200Response: + """Sign EIP-712 typed data on behalf of an end user using a delegation. + + Requires the end user to have created a delegation allowing the developer + to sign on their behalf. + + Args: + user_id: The unique identifier of the end user. + address: The 0x-prefixed EVM address to sign with. + typed_data: The EIP-712 typed data structure. + + Returns: + SignEvmTypedData200Response: The signature response. + + """ + track_action(action="sign_evm_typed_data_end_user") + + project_id = self._require_project_id() + return await self.api_clients.embedded_wallets_core.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( + typed_data_hash=typed_data, + address=address, + ), + ) + + # ==================== Delegated EVM Send Operations ==================== + + async def send_evm_transaction( + self, + user_id: str, + address: str, + transaction: str, + network: str, + ) -> SendEvmTransaction200Response: + """Send an EVM transaction on behalf of an end user using a delegation. + + Signs and broadcasts the transaction. Requires the end user to have created + a delegation allowing the developer to sign on their behalf. + + Args: + user_id: The unique identifier of the end user. + address: The 0x-prefixed EVM address to send from. + transaction: The RLP-encoded unsigned EIP-1559 transaction (0x-prefixed hex). + network: The target EVM network (e.g. "base-sepolia", "base"). + + Returns: + SendEvmTransaction200Response: The transaction hash response. + + """ + track_action(action="send_evm_transaction_end_user") + + project_id = self._require_project_id() + return await self.api_clients.embedded_wallets_core.send_evm_transaction_with_end_user_account( + project_id=project_id, + user_id=user_id, + send_evm_transaction_with_end_user_account_request=SendEvmTransactionWithEndUserAccountRequest( + transaction=transaction, + address=address, + network=network, + ), + ) + + async def send_evm_asset( + self, + user_id: str, + address: str, + to: str, + amount: str, + network: str, + asset: str = "usdc", + use_cdp_paymaster: bool | None = None, + paymaster_url: str | None = None, + ) -> SendEvmAssetWithEndUserAccount200Response: + """Send an EVM asset (e.g. USDC) on behalf of an end user using a delegation. + + Requires the end user to have created a delegation allowing the developer + to sign on their behalf. + + Args: + user_id: The unique identifier of the end user. + address: The 0x-prefixed EVM address to send from. + to: The recipient address. + amount: The amount to send (e.g. "1000000" for 1 USDC with 6 decimals). + network: The target EVM network (e.g. "base-sepolia", "base"). + asset: The asset to send. Defaults to "usdc". + use_cdp_paymaster: Whether to use CDP paymaster for gas sponsorship (smart accounts). + paymaster_url: Optional custom paymaster URL. + + Returns: + SendEvmAssetWithEndUserAccount200Response: The transaction/user-op hash response. + + """ + track_action(action="send_evm_asset_end_user") + + project_id = self._require_project_id() + request = SendEvmAssetWithEndUserAccountRequest( + to=to, + amount=amount, + network=network, + ) + if use_cdp_paymaster is not None: + request.use_cdp_paymaster = use_cdp_paymaster + if paymaster_url is not None: + request.paymaster_url = paymaster_url + + return await self.api_clients.embedded_wallets_core.send_evm_asset_with_end_user_account( + project_id=project_id, + user_id=user_id, + address=address, + asset=asset, + send_evm_asset_with_end_user_account_request=request, + ) + + async def send_user_operation( + self, + user_id: str, + address: str, + network: str, + calls: list[dict], + use_cdp_paymaster: bool = True, + paymaster_url: str | None = None, + data_suffix: str | None = None, + ) -> EvmUserOperation: + """Send a user operation for an end user's Smart Account (ERC-4337). + + Requires the end user to have created a delegation allowing the developer + to sign on their behalf. + + Args: + user_id: The unique identifier of the end user. + address: The EVM smart account address. + network: The target EVM network (e.g. "base-sepolia", "base"). + calls: Array of call objects, each with "to", "value", and "data" keys. + use_cdp_paymaster: Whether to use CDP paymaster. Defaults to True. + paymaster_url: Optional custom paymaster URL. + data_suffix: Optional hex data suffix appended to calldata. + + Returns: + EvmUserOperation: The user operation result. + + """ + track_action(action="send_user_operation_end_user") + + project_id = self._require_project_id() + request = SendUserOperationWithEndUserAccountRequest( + network=network, + calls=calls, + use_cdp_paymaster=use_cdp_paymaster, + ) + if paymaster_url is not None: + request.paymaster_url = paymaster_url + if data_suffix is not None: + request.data_suffix = data_suffix + + return ( + await self.api_clients.embedded_wallets_core.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=request, + ) + ) + + # ==================== Delegated Solana Sign Operations ==================== + + async def sign_solana_hash( + self, + user_id: str, + hash: str, + address: str, + ) -> SignSolanaHashWithEndUserAccount200Response: + """Sign a Solana hash on behalf of an end user using a delegation. + + Requires the end user to have created a delegation allowing the developer + to sign on their behalf. + + Args: + user_id: The unique identifier of the end user. + hash: The base58-encoded 32-byte hash. + address: The Solana address to sign with. + + Returns: + SignSolanaHashWithEndUserAccount200Response: The signature response. + + """ + track_action(action="sign_solana_hash_end_user") + + project_id = self._require_project_id() + return await self.api_clients.embedded_wallets_core.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, + ), + ) + + async def sign_solana_message( + self, + user_id: str, + address: str, + message: str, + ) -> SignSolanaMessage200Response: + """Sign a Solana message on behalf of an end user using a delegation. + + Requires the end user to have created a delegation allowing the developer + to sign on their behalf. + + Args: + user_id: The unique identifier of the end user. + address: The Solana address to sign with. + message: The base64-encoded message to sign. + + Returns: + SignSolanaMessage200Response: The signature response. + + """ + track_action(action="sign_solana_message_end_user") + + project_id = self._require_project_id() + return await self.api_clients.embedded_wallets_core.sign_solana_message_with_end_user_account( + project_id=project_id, + user_id=user_id, + sign_solana_message_with_end_user_account_request=SignSolanaMessageWithEndUserAccountRequest( + message=message, + address=address, + ), + ) + + async def sign_solana_transaction( + self, + user_id: str, + address: str, + transaction: str, + ) -> SignSolanaTransaction200Response: + """Sign a Solana transaction on behalf of an end user using a delegation. + + Requires the end user to have created a delegation allowing the developer + to sign on their behalf. + + Args: + user_id: The unique identifier of the end user. + address: The Solana address to sign with. + transaction: The base64-encoded unsigned Solana transaction. + + Returns: + SignSolanaTransaction200Response: The signed transaction response. + + """ + track_action(action="sign_solana_transaction_end_user") + + project_id = self._require_project_id() + return await self.api_clients.embedded_wallets_core.sign_solana_transaction_with_end_user_account( + project_id=project_id, + user_id=user_id, + sign_solana_transaction_with_end_user_account_request=SignSolanaTransactionWithEndUserAccountRequest( + transaction=transaction, + address=address, + ), + ) + + # ==================== Delegated Solana Send Operations ==================== + + async def send_solana_transaction( + self, + user_id: str, + address: str, + transaction: str, + network: str, + ) -> SendSolanaTransaction200Response: + """Send a Solana transaction on behalf of an end user using a delegation. + + Signs and broadcasts the transaction. Requires the end user to have created + a delegation allowing the developer to sign on their behalf. + + Args: + user_id: The unique identifier of the end user. + address: The Solana address to send from. + transaction: The base64-encoded unsigned Solana transaction. + network: The target Solana network (e.g. "solana-devnet", "solana"). + + Returns: + SendSolanaTransaction200Response: The transaction signature response. + + """ + track_action(action="send_solana_transaction_end_user") + + project_id = self._require_project_id() + return await self.api_clients.embedded_wallets_core.send_solana_transaction_with_end_user_account( + project_id=project_id, + user_id=user_id, + send_solana_transaction_with_end_user_account_request=SendSolanaTransactionWithEndUserAccountRequest( + transaction=transaction, + address=address, + network=network, + ), + ) + + async def send_solana_asset( + self, + user_id: str, + address: str, + to: str, + amount: str, + network: str, + asset: str = "usdc", + ) -> SendSolanaAssetWithEndUserAccount200Response: + """Send a Solana asset (e.g. USDC) on behalf of an end user using a delegation. + + Requires the end user to have created a delegation allowing the developer + to sign on their behalf. + + Args: + user_id: The unique identifier of the end user. + address: The Solana address to send from. + to: The recipient address. + amount: The amount to send. + network: The target Solana network (e.g. "solana-devnet", "solana"). + asset: The asset to send. Defaults to "usdc". + + Returns: + SendSolanaAssetWithEndUserAccount200Response: The transaction signature response. + + """ + track_action(action="send_solana_asset_end_user") + + project_id = self._require_project_id() + return await self.api_clients.embedded_wallets_core.send_solana_asset_with_end_user_account( + project_id=project_id, + user_id=user_id, + address=address, + asset=asset, + send_solana_asset_with_end_user_account_request=SendSolanaAssetWithEndUserAccountRequest( + to=to, + amount=amount, + network=network, + ), + ) + + # ==================== Delegation Lifecycle ==================== + + async def create_evm_eip7702_delegation( + self, + user_id: str, + address: str, + network: str, + enable_spend_permissions: bool = False, + ) -> CreateEvmEip7702Delegation201Response: + """Create an EIP-7702 delegation for an end user's EVM account. + + Upgrades an EVM EOA with smart account capabilities. Requires the end user + to have created a delegation allowing the developer to sign on their behalf. + + Args: + user_id: The unique identifier of the end user. + address: The 0x-prefixed EVM address to delegate. + network: The target EVM network (e.g. "base-sepolia", "base"). + enable_spend_permissions: Whether to enable spend permissions. Defaults to False. + + Returns: + CreateEvmEip7702Delegation201Response: The delegation operation ID. + + """ + track_action(action="create_evm_eip7702_delegation_end_user") + + project_id = self._require_project_id() + return await self.api_clients.embedded_wallets_core.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, + ), + ) + + async def revoke_delegation( + self, + user_id: str, + ) -> None: + """Revoke all active delegations for an end user. + + After revocation, the developer can no longer sign on behalf of this end user + until a new delegation is created. + + Args: + user_id: The unique identifier of the end user. + + """ + track_action(action="revoke_delegation_end_user") + + project_id = self._require_project_id() + await self.api_clients.embedded_wallets_core.revoke_delegation_for_end_user( + project_id=project_id, + user_id=user_id, + revoke_delegation_for_end_user_request=RevokeDelegationForEndUserRequest(), + ) diff --git a/python/cdp/openapi_client/__init__.py b/python/cdp/openapi_client/__init__.py index b3594b5f3..fafcc4092 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 @@ -68,6 +69,7 @@ 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_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,20 +181,28 @@ 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_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_transaction200_response import SendEvmTransaction200Response 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_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_asset_with_end_user_account200_response import SendSolanaAssetWithEndUserAccount200Response +from cdp.openapi_client.models.send_solana_asset_with_end_user_account_request import SendSolanaAssetWithEndUserAccountRequest 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.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 @@ -200,14 +211,17 @@ 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_hash_with_end_user_account_request import SignEvmHashWithEndUserAccountRequest from cdp.openapi_client.models.sign_evm_message200_response import SignEvmMessage200Response 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_message_with_end_user_account_request import SignEvmMessageWithEndUserAccountRequest from cdp.openapi_client.models.sign_evm_transaction200_response import SignEvmTransaction200Response 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_transaction_with_end_user_account_request import SignEvmTransactionWithEndUserAccountRequest from cdp.openapi_client.models.sign_evm_typed_data200_response import SignEvmTypedData200Response 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 @@ -216,14 +230,19 @@ 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_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_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_message200_response import SignSolanaMessage200Response from cdp.openapi_client.models.sign_solana_message_request import SignSolanaMessageRequest +from cdp.openapi_client.models.sign_solana_message_with_end_user_account_request import SignSolanaMessageWithEndUserAccountRequest from cdp.openapi_client.models.sign_solana_transaction200_response import SignSolanaTransaction200Response from cdp.openapi_client.models.sign_solana_transaction_request import SignSolanaTransactionRequest +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 +297,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..c28d4fbdf --- /dev/null +++ b/python/cdp/openapi_client/api/embedded_wallets_core_functionality_api.py @@ -0,0 +1,5772 @@ +# 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_delegation201_response import CreateEvmEip7702Delegation201Response +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_transaction200_response import SendEvmTransaction200Response +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_account200_response import SendSolanaAssetWithEndUserAccount200Response +from cdp.openapi_client.models.send_solana_asset_with_end_user_account_request import SendSolanaAssetWithEndUserAccountRequest +from cdp.openapi_client.models.send_solana_transaction200_response import SendSolanaTransaction200Response +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_hash200_response import SignEvmHash200Response +from cdp.openapi_client.models.sign_evm_hash_with_end_user_account_request import SignEvmHashWithEndUserAccountRequest +from cdp.openapi_client.models.sign_evm_message200_response import SignEvmMessage200Response +from cdp.openapi_client.models.sign_evm_message_with_end_user_account_request import SignEvmMessageWithEndUserAccountRequest +from cdp.openapi_client.models.sign_evm_transaction200_response import SignEvmTransaction200Response +from cdp.openapi_client.models.sign_evm_transaction_with_end_user_account_request import SignEvmTransactionWithEndUserAccountRequest +from cdp.openapi_client.models.sign_evm_typed_data200_response import SignEvmTypedData200Response +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_message200_response import SignSolanaMessage200Response +from cdp.openapi_client.models.sign_solana_message_with_end_user_account_request import SignSolanaMessageWithEndUserAccountRequest +from cdp.openapi_client.models.sign_solana_transaction200_response import SignSolanaTransaction200Response +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, + ) -> CreateEvmEip7702Delegation201Response: + """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': "CreateEvmEip7702Delegation201Response", + '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[CreateEvmEip7702Delegation201Response]: + """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': "CreateEvmEip7702Delegation201Response", + '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': "CreateEvmEip7702Delegation201Response", + '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, + ) -> SendEvmTransaction200Response: + """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': "SendEvmTransaction200Response", + '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[SendEvmTransaction200Response]: + """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': "SendEvmTransaction200Response", + '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': "SendEvmTransaction200Response", + '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, + ) -> SendSolanaAssetWithEndUserAccount200Response: + """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': "SendSolanaAssetWithEndUserAccount200Response", + '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[SendSolanaAssetWithEndUserAccount200Response]: + """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': "SendSolanaAssetWithEndUserAccount200Response", + '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': "SendSolanaAssetWithEndUserAccount200Response", + '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, + ) -> SendSolanaTransaction200Response: + """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': "SendSolanaTransaction200Response", + '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[SendSolanaTransaction200Response]: + """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': "SendSolanaTransaction200Response", + '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': "SendSolanaTransaction200Response", + '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, + ) -> SignEvmHash200Response: + """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': "SignEvmHash200Response", + '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[SignEvmHash200Response]: + """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': "SignEvmHash200Response", + '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': "SignEvmHash200Response", + '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, + ) -> SignEvmMessage200Response: + """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': "SignEvmMessage200Response", + '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[SignEvmMessage200Response]: + """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': "SignEvmMessage200Response", + '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': "SignEvmMessage200Response", + '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, + ) -> SignEvmTransaction200Response: + """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': "SignEvmTransaction200Response", + '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[SignEvmTransaction200Response]: + """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': "SignEvmTransaction200Response", + '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': "SignEvmTransaction200Response", + '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, + ) -> SignEvmTypedData200Response: + """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': "SignEvmTypedData200Response", + '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[SignEvmTypedData200Response]: + """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': "SignEvmTypedData200Response", + '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': "SignEvmTypedData200Response", + '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, + ) -> SignSolanaMessage200Response: + """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': "SignSolanaMessage200Response", + '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[SignSolanaMessage200Response]: + """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': "SignSolanaMessage200Response", + '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': "SignSolanaMessage200Response", + '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, + ) -> SignSolanaTransaction200Response: + """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': "SignSolanaTransaction200Response", + '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[SignSolanaTransaction200Response]: + """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': "SignSolanaTransaction200Response", + '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': "SignSolanaTransaction200Response", + '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/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/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..af367a99a 100644 --- a/python/cdp/openapi_client/models/__init__.py +++ b/python/cdp/openapi_client/models/__init__.py @@ -37,6 +37,7 @@ 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_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,20 +149,28 @@ 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_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_transaction200_response import SendEvmTransaction200Response 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_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_asset_with_end_user_account200_response import SendSolanaAssetWithEndUserAccount200Response +from cdp.openapi_client.models.send_solana_asset_with_end_user_account_request import SendSolanaAssetWithEndUserAccountRequest 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.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 @@ -169,14 +179,17 @@ 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_hash_with_end_user_account_request import SignEvmHashWithEndUserAccountRequest from cdp.openapi_client.models.sign_evm_message200_response import SignEvmMessage200Response 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_message_with_end_user_account_request import SignEvmMessageWithEndUserAccountRequest from cdp.openapi_client.models.sign_evm_transaction200_response import SignEvmTransaction200Response 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_transaction_with_end_user_account_request import SignEvmTransactionWithEndUserAccountRequest from cdp.openapi_client.models.sign_evm_typed_data200_response import SignEvmTypedData200Response 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 @@ -185,14 +198,19 @@ 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_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_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_message200_response import SignSolanaMessage200Response from cdp.openapi_client.models.sign_solana_message_request import SignSolanaMessageRequest +from cdp.openapi_client.models.sign_solana_message_with_end_user_account_request import SignSolanaMessageWithEndUserAccountRequest from cdp.openapi_client.models.sign_solana_transaction200_response import SignSolanaTransaction200Response from cdp.openapi_client.models.sign_solana_transaction_request import SignSolanaTransactionRequest +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 +265,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_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..84a93a932 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,22 @@ class RevokeSpendPermissionRequest(BaseModel): """ Request parameters for revoking a Spend Permission. """ # noqa: E501 + wallet_secret_id: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, 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: Optional[StrictBool] = Field(default=None, 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 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('paymaster_url') def paymaster_url_validate_regular_expression(cls, value): @@ -95,8 +107,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_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_account200_response.py b/python/cdp/openapi_client/models/send_solana_asset_with_end_user_account200_response.py new file mode 100644 index 000000000..e1871d0d0 --- /dev/null +++ b/python/cdp/openapi_client/models/send_solana_asset_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 SendSolanaAssetWithEndUserAccount200Response(BaseModel): + """ + SendSolanaAssetWithEndUserAccount200Response + """ # noqa: E501 + transaction_signature: StrictStr = Field(description="The base58 encoded transaction signature.", alias="transactionSignature") + __properties: ClassVar[List[str]] = ["transactionSignature"] + + 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 SendSolanaAssetWithEndUserAccount200Response 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 SendSolanaAssetWithEndUserAccount200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "transactionSignature": obj.get("transactionSignature") + }) + 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_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_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_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_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_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_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_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_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..b279211f7 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,8 +36,10 @@ 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: 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_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_account200_response.py b/python/cdp/openapi_client/test/test_send_solana_asset_with_end_user_account200_response.py new file mode 100644 index 000000000..1d41d75f7 --- /dev/null +++ b/python/cdp/openapi_client/test/test_send_solana_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_solana_asset_with_end_user_account200_response import SendSolanaAssetWithEndUserAccount200Response + +class TestSendSolanaAssetWithEndUserAccount200Response(unittest.TestCase): + """SendSolanaAssetWithEndUserAccount200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SendSolanaAssetWithEndUserAccount200Response: + """Test SendSolanaAssetWithEndUserAccount200Response + 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 `SendSolanaAssetWithEndUserAccount200Response` + """ + model = SendSolanaAssetWithEndUserAccount200Response() + if include_optional: + return SendSolanaAssetWithEndUserAccount200Response( + transaction_signature = '5VERv8NMvzbJMEkV8xnrLkEaWRtSz9CosKDYjCJjBRnbJLgp8uirBgmQpjKhoR4tjF3ZpRzrFmBV6UjKdiSZkQUW' + ) + else: + return SendSolanaAssetWithEndUserAccount200Response( + transaction_signature = '5VERv8NMvzbJMEkV8xnrLkEaWRtSz9CosKDYjCJjBRnbJLgp8uirBgmQpjKhoR4tjF3ZpRzrFmBV6UjKdiSZkQUW', + ) + """ + + def testSendSolanaAssetWithEndUserAccount200Response(self): + """Test SendSolanaAssetWithEndUserAccount200Response""" + # 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_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_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_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_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_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_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_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/changelog.d/632.feature.md b/python/changelog.d/632.feature.md new file mode 100644 index 000000000..22f7adf7f --- /dev/null +++ b/python/changelog.d/632.feature.md @@ -0,0 +1 @@ +Added delegated signing and sending methods to EndUserClient and EndUserAccount for EVM and Solana operations diff --git a/scripts/preprocess_openapi.py b/scripts/preprocess_openapi.py index 3af7ff47e..b76a14bac 100644 --- a/scripts/preprocess_openapi.py +++ b/scripts/preprocess_openapi.py @@ -3,9 +3,269 @@ import sys -def update_xwalletauth_parameter(input_file, output_file): +def update_xwalletauth_parameter(data): """ - Update the X-Wallet-Auth parameter to be optional in an OpenAPI YAML file. + Update the X-Wallet-Auth parameter to be optional. + + Args: + data (dict): The parsed OpenAPI spec data + """ + if "components" in data and "parameters" in data["components"]: + if "XWalletAuth" in data["components"]["parameters"]: + data["components"]["parameters"]["XWalletAuth"]["required"] = False + print("Updated XWalletAuth parameter (required: True → False)") + + +def extract_inline_response_schemas(data): + """ + Extract duplicate inline response schemas into named component schemas. + + When two operations share the same inline response schema (e.g., signEvmHash + and signEvmHashWithEndUserAccount both return {signature: string}), the OpenAPI + Generator deduplicates them and picks the name from whichever appears first in + the spec. This leads to confusing type names like + SignEvmHashWithEndUserAccount200Response being used for signEvmHash. + + This function finds such pairs, creates a named component schema using the base + operation's name (e.g., SignEvmHash200Response), and replaces the inline schemas + in both operations with a $ref to the new named schema. + + Args: + data (dict): The parsed OpenAPI spec data + """ + # Ensure components/schemas exists + if "components" not in data: + data["components"] = {} + if "schemas" not in data["components"]: + data["components"]["schemas"] = {} + + # Collect all operations with inline response schemas + # Structure: {operationId: {path, method, status_code, schema, description}} + inline_ops = {} + + for path, path_item in data.get("paths", {}).items(): + for method in ("get", "post", "put", "delete", "patch"): + operation = path_item.get(method) + if not isinstance(operation, dict): + continue + + op_id = operation.get("operationId") + if not op_id: + continue + + for status_code in ("200", "201"): + response = operation.get("responses", {}).get(status_code) + if not response: + continue + + json_content = ( + response.get("content", {}).get("application/json", {}) + ) + schema = json_content.get("schema") + + # Only process inline schemas (not $ref) + if schema and "$ref" not in schema: + inline_ops[op_id] = { + "path": path, + "method": method, + "status_code": status_code, + "schema": schema, + } + + # Separate base operations from WithEndUserAccount operations + suffix = "WithEndUserAccount" + base_ops = {} + enduser_ops = {} + + for op_id, info in inline_ops.items(): + if op_id.endswith(suffix): + base_name = op_id[: -len(suffix)] + enduser_ops[base_name] = (op_id, info) + else: + base_ops[op_id] = info + + # For each pair with identical schemas, extract to a named component schema + extracted_count = 0 + for base_name, base_info in sorted(base_ops.items()): + if base_name not in enduser_ops: + continue + + enduser_op_id, enduser_info = enduser_ops[base_name] + + # Check if the response schemas are structurally identical + if base_info["schema"] != enduser_info["schema"]: + continue + + # Build the named schema key: capitalize first letter + status code + Response + # e.g., signEvmHash -> SignEvmHash200Response + schema_name = ( + base_name[0].upper() + + base_name[1:] + + base_info["status_code"] + + "Response" + ) + + # Add the schema to components/schemas + data["components"]["schemas"][schema_name] = base_info["schema"] + + ref = {"$ref": f"#/components/schemas/{schema_name}"} + + # Replace inline schema in the base operation + base_op = data["paths"][base_info["path"]][base_info["method"]] + base_op["responses"][base_info["status_code"]]["content"][ + "application/json" + ]["schema"] = ref + + # Replace inline schema in the WithEndUserAccount operation + enduser_op = data["paths"][enduser_info["path"]][enduser_info["method"]] + enduser_op["responses"][enduser_info["status_code"]]["content"][ + "application/json" + ]["schema"] = ref + + extracted_count += 1 + print( + f"Extracted inline response schema: {schema_name} " + f"(from {base_name} + {enduser_op_id})" + ) + + if extracted_count > 0: + print( + f"Extracted {extracted_count} inline response schema(s) " + f"into named component schemas" + ) + else: + print("No duplicate inline response schemas found to extract") + + +def unify_request_body_schemas(data): + """ + Unify divergent request body schemas between base and WithEndUserAccount operations. + + When a base operation (e.g., revokeSpendPermission) and its WithEndUserAccount + counterpart use different named $ref request body schemas where one is a strict + subset of the other, this function: + + 1. Replaces the base operation's request body $ref with the superset schema + (the WithEndUserAccount variant's schema) + 2. Relaxes the required fields in the superset schema to only include fields + that exist in the subset schema + + This preserves backward compatibility by keeping the superset type name while + not requiring callers to provide fields that are only relevant to the + end-user account flow. + + Args: + data (dict): The parsed OpenAPI spec data + """ + schemas = data.get("components", {}).get("schemas", {}) + suffix = "WithEndUserAccount" + + # Collect all operations with named $ref request body schemas + # Structure: {operationId: {path, method, schema_ref, schema_name}} + ref_ops = {} + + for path, path_item in data.get("paths", {}).items(): + for method in ("get", "post", "put", "delete", "patch"): + operation = path_item.get(method) + if not isinstance(operation, dict): + continue + + op_id = operation.get("operationId") + if not op_id: + continue + + request_body = operation.get("requestBody", {}) + json_content = ( + request_body.get("content", {}).get("application/json", {}) + ) + schema = json_content.get("schema", {}) + schema_ref = schema.get("$ref") + + if schema_ref and schema_ref.startswith("#/components/schemas/"): + schema_name = schema_ref.split("/")[-1] + ref_ops[op_id] = { + "path": path, + "method": method, + "schema_ref": schema_ref, + "schema_name": schema_name, + } + + # Separate base operations from WithEndUserAccount operations + base_ops = {} + enduser_ops = {} + + for op_id, info in ref_ops.items(): + if op_id.endswith(suffix): + base_name = op_id[: -len(suffix)] + enduser_ops[base_name] = (op_id, info) + else: + base_ops[op_id] = info + + # Find pairs with different named $ref schemas where one is a subset + unified_count = 0 + for base_name, base_info in sorted(base_ops.items()): + if base_name not in enduser_ops: + continue + + enduser_op_id, enduser_info = enduser_ops[base_name] + + # Skip if they already use the same schema + if base_info["schema_name"] == enduser_info["schema_name"]: + continue + + base_schema = schemas.get(base_info["schema_name"], {}) + enduser_schema = schemas.get(enduser_info["schema_name"], {}) + + base_props = set(base_schema.get("properties", {}).keys()) + enduser_props = set(enduser_schema.get("properties", {}).keys()) + + # Check if the base schema's properties are a strict subset of the + # enduser schema's properties + if not base_props or not base_props < enduser_props: + continue + + # The enduser schema is the superset — use it for the base operation + superset_name = enduser_info["schema_name"] + superset_ref = enduser_info["schema_ref"] + + # Replace the base operation's request body $ref + base_op = data["paths"][base_info["path"]][base_info["method"]] + base_op["requestBody"]["content"]["application/json"]["schema"] = { + "$ref": superset_ref + } + + # Relax required fields: only require fields that exist in the subset + superset_schema = schemas[superset_name] + if "required" in superset_schema: + base_required = set(base_schema.get("required", [])) + superset_schema["required"] = [ + field + for field in superset_schema["required"] + if field in base_required or field in base_props + ] + + extra_fields = enduser_props - base_props + unified_count += 1 + print( + f"Unified request body schema: {base_name} now uses " + f"{superset_name} (relaxed required: {extra_fields})" + ) + + if unified_count > 0: + print( + f"Unified {unified_count} request body schema(s) " + f"for backward compatibility" + ) + + +def preprocess_openapi(input_file, output_file): + """ + Preprocess an OpenAPI YAML file for SDK code generation. + + Applies the following transformations: + 1. Makes the X-Wallet-Auth parameter optional + 2. Extracts duplicate inline response schemas into named component schemas + 3. Unifies divergent request body schemas between base and WithEndUserAccount ops Args: input_file (str): Path to the input YAML file @@ -15,11 +275,10 @@ def update_xwalletauth_parameter(input_file, output_file): with open(input_file, "r") as file: data = yaml.safe_load(file) - # Update in components/parameters - if "components" in data and "parameters" in data["components"]: - if "XWalletAuth" in data["components"]["parameters"]: - data["components"]["parameters"]["XWalletAuth"]["required"] = False - print("Updated XWalletAuth parameter (required: True → False)") + # Apply transformations + update_xwalletauth_parameter(data) + extract_inline_response_schemas(data) + unify_request_body_schemas(data) # Save the modified YAML to the output file with open(output_file, "w") as file: @@ -38,4 +297,4 @@ def update_xwalletauth_parameter(input_file, output_file): input_file = sys.argv[1] output_file = sys.argv[2] - update_xwalletauth_parameter(input_file, output_file) + preprocess_openapi(input_file, output_file)