LogoLogo
LogoLogo
  • Solana Staking API (GraphQL)
  • Overview
  • Supported Networks
  • GraphQL Base URL
  • Getting Started
  • Authentication
    • Obtaining an API Key
  • Mutation
    • SolanaStakeIntent
    • SolanaDeactivateIntent
    • SolanaCancelDeactivateIntent
    • SolanaWithdrawalIntent
    • SolanaCancelWithdrawalIntent
  • Query
    • SolanaGetStakeAccounts
    • SolanaGetDeactivationIntents
    • SolanaGetDeactivatableAmount
    • SolanaGetWithdrawableAmount
    • SolanaListWithdrawalIntents
Powered by GitBook
On this page
  1. Mutation

SolanaDeactivateIntent

POST SolanaDeactivateIntent

This endpoint is used to request deactivation transactions that will be executed against available addresses. The API will automatically select which stake addresses need to be deactivated in order to satisfy the request.

This operation may split some of the stakes in order to ensure that the exact amount will be deactivated. If there are not enough available funds, the API will produce an error response.

The API returns two sets of transactions – splitting transactions and deactivation transactions. You must sign and broadcast the splitting transactions before the deactivation transactions.

Headers

Name
Value

Content-Type

application/json

Authorization

<API Key>

Body

### 🧪 Example Mutation

```graphql
mutation SolanaDeactivateIntent {
    SolanaDeactivateIntent(
        input: {
            network: "devnet",              # String!
            amount: "1000000000",           # String!
            withdrawal_authority: "5xo1..." # String
            staking_authority: "5xo1..."    # String
            delegator_address: "5xo1..."    # String
        }
    ) {
        ... on DeactivateResponse {
            deactivate_intent_id
            customerId
            protocol
            network
            walletAddress
            solana {
                total_deactivated_amount
                walletAddress
                deactivates {
                    unsigned_transaction
                    stake_account_authority
                    stake_account_address
                    withdrawal_authority
                    stake_id
                    amount
                    expiration_time
                }
                splits {
                    unsigned_transaction
                    stake_account_authority
                    new_stake_account_address
                    new_stake_id
                    splitted_stake_account_address
                    splitted_stake_id
                    amount
                }
            }
        }
        ... on ErrorResponse {
            code
            message
        }
    }
}

Response

{
    "data": {
        "DeactivateResponse": {
            "deactivate_intent_id": "4ba06e89-8c29-483e-ac36-318de5aa7364",
            "customer_id": "SatoshiNakamoto-xUYJbPw9hw",
            "protocol": "solana",
            "network": "mainnet",
            "solana": {
                "deactivates": [
                    {
                        "unsigned_transaction": "0x22895118000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000120087fed394b43849eebef1e88873cd9efdbe33136656e5148e659b8b2f33625d40000000000000000000000000000000000000000000000000000000000000030b81748644e23c4d950f9dd709f3eb73d5eacd9657997e1d9dde7c4ebd8a6519ecb9d0a7fb603d3b68e023278f9650122000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020010000000000000000000000c509bb854c526af4cee5e037089f7aa8e091d8870000000000000000000000000000000000000000000000000000000000000060b36b79b4b206c0310472c117fa40c05342b5dc3e89f98f42c9da3ce6450d4c603cad55248017fd4eca3ab277cca64569193e4d487f5b2ea78a2bcdc81926c313c05842a3af318967a775783bba22519e8b8886587efa99aa7dab5784f792b187\n",
                        "stake_account_authority": "5xot9PVkphiX2adznghwrAuxGs2zeWisNSxMW6hU6Hkj",
                        "stake_account_address": "5xot9PVkphiX2adznghwrAuxGs2zeWisNSxMW6hU6Hkj",
                        "withdrawal_authority": "5xot9PVkphiX2adznghwrAuxGs2zeWisNSxMW6hU6Hkj",
                        "stake_id": "stake_Wgx98Rbi8nQuL9ddn3mTk1",
                        "amount": "100",
                        "expiration_time": 1689939023
                    }
                ],
                "splits": [
                    {
                        "unsigned_transaction": "0x22895118000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000120087fed394b43849eebef1e88873cd9efdbe33136656e5148e659b8b2f33625d40000000000000000000000000000000000000000000000000000000000000030b81748644e23c4d950f9dd709f3eb73d5eacd9657997e1d9dde7c4ebd8a6519ecb9d0a7fb603d3b68e023278f9650122000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020010000000000000000000000c509bb854c526af4cee5e037089f7aa8e091d8870000000000000000000000000000000000000000000000000000000000000060b36b79b4b206c0310472c117fa40c05342b5dc3e89f98f42c9da3ce6450d4c603cad55248017fd4eca3ab277cca64569193e4d487f5b2ea78a2bcdc81926c313c05842a3af318967a775783bba22519e8b8886587efa99aa7dab5784f792b187\n",
                        "stake_account_authority": "5xot9PVkphiX2adznghwrAuxGs2zeWisNSxMW6hU6Hkj",
                        "new_stake_account_address": "5xot9PVkphiX2adznghwrAuxGs2zeWisNSxMW6hU6Hkj",
                        "new_stake_id": "stake_Wgx98Rbi8nQuL9ddn3mTk1",
                        "splitted_stake_account_address": "5xot9PVkphiX2adznghwrAuxGs2zeWisNSxMW6hU6Hkj",
                        "splitted_stake_id": "stake_Wgx98Rbi8nQuL9ddn3mTk1",
                        "amount": "100"
                    }
                ],
                "total_deactivated_amount": "100"
            },
            walletAddress: String
        }
    }
}
{
  data: {
    ErrorResponse: {
      __typename: "ErrorResponse",        # String
      code: 500,                          # Number
      message: "Invalid public key input" # String
    }
  }
}

Last updated 1 month ago

Page cover image