Create a new order

This endpoint allows the client to create staking, unstaking, or withdrawal orders. One key feature of this endpoint is the ability to include an optional validatorKey field when creating a staking order.

Including a Validator Key

By including a validatorKey in the staking order, the client specifies a pre-generated and signed Ethereum validator key that should be used for the staking transaction. This key must meet all required security and operational standards, as it will be directly used for staking on the Ethereum blockchain.

Without a Validator Key

If no validatorKey is provided, the client must specify the amount to stake. Northstake handles the staking operation internally, requiring the managed user's account to have sufficient balance to cover the transaction and any associated fees.

import { NorthstakeApi, Order } from '@northstake/northstakeapi';
const api = new NorthstakeApi('apiKey', 'privateKey')

  const order: Order = {
    amount: 32,
    asset: 'ETH',
    orderType: 'stake',
  }

  const { body: result } = await api.orders.createNewOrder(order)
Language
Click Try It! to start a request and see the response here!