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

SolanaStakeIntent

POST SolanaStakeIntent

Returns an unsigned transaction that can be used to delegate your tokens to the validator specified in the request.

Headers

Name
Value

Content-Type

application/json

Authorization

<API Key>

Body

### 🧪 Example Mutation

```graphql
mutation SolanaStakeIntent {
    SolanaStakeIntent(
        input: {
            network: "devnet",               # String!
            amount: "1000000000",            # String!
            delegator_address: "5xo1...",    # String!
            staking_authority: "5xo1...",    # String!
            withdrawal_authority: "5xo1...", # String
            plan_id: "plan_Wgx..."           # String
        }
    ) {
        ... on StakingResponse {
            stake_intent_id
            customerId
            network
            plan_id
            protocol
            solana {
                amount
                expiration_time
                stake_account_public_key
                stake_id
                staking_authority
                unsigned_transaction
                validator_public_key
                withdrawal_authority
            }
        }
        ... on ErrorResponse {
            __typename
            code
            message
        }
    }
}

Response

{
    "data": {
        "SolanaStakeIntent": {
            "stake_intent_id": "stake_intent_Wgx98Rbi8nQuL9ddn3mTk1",
            "customer_id": "SatoshiNakamoto-xUYJbPw9hw",
            "plan_id": "plan_Wgx98Rbi8nQuL9ddn3mTk1",
            "protocol": "solana",
            "network": "mainnet",
            "solana": {
                "stake_id": "stake_Wgx98Rbi8nQuL9ddn3mTk1",
                "amount": "100",
                "validator_public_key": "0xa1d1ad0714035353258038e964ae9675dc0252ee22cea896825c01458e1807bfad2f9969338798548d9858a571f7425c",
                "staking_authority": "5xot9PVkphiX2adznghwrAuxGs2zeWisNSxMW6hU6Hkj",
                "withdrawal_authority": "0xa1d1ad0714035353258038e964ae9675dc0252ee22cea896825c01458e1807bfad2f9969338798548d9858a571f7425c",
                "stake_account_public_key": "5xot9PVkphiX2adznghwrAuxGs2zeWisNSxMW6hU6Hkj",
                "unsigned_transaction": "0x22895118000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000120087fed394b43849eebef1e88873cd9efdbe33136656e5148e659b8b2f33625d40000000000000000000000000000000000000000000000000000000000000030b81748644e23c4d950f9dd709f3eb73d5eacd9657997e1d9dde7c4ebd8a6519ecb9d0a7fb603d3b68e023278f9650122000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020010000000000000000000000c509bb854c526af4cee5e037089f7aa8e091d8870000000000000000000000000000000000000000000000000000000000000060b36b79b4b206c0310472c117fa40c05342b5dc3e89f98f42c9da3ce6450d4c603cad55248017fd4eca3ab277cca64569193e4d487f5b2ea78a2bcdc81926c313c05842a3af318967a775783bba22519e8b8886587efa99aa7dab5784f792b187\n",
                "expiration_time": 1689939023
            }
        }
    }
}
{
    "errors": [
        {
            "errorType": "UnauthorizedException",
            "message": "You are not authorized to make this call."
        }
    ]
}
{
    "data": {
        "ErrorResponse": {
            "__typename": "ErrorResponse",
            "code": Int!,
            "message": String!
        }
    }
}

Last updated 1 month ago

Page cover image