Blockstream Enterprise
ReferenceAPI ReferenceAuth

Key Register Auth

Key Register Auth.

Request

AuthKeyRegisterRequest
interface AuthKeyRegisterRequest {
  action: 'add'
  resource: '/account-management/key-register'
  details: {
    device_name: string
    nonce: string | undefined
  }
}

Prop

Type

Response

AuthKeyRegisterResponse_success
interface AuthKeyRegisterResponse_success {
  status: 'success'
  error_code?: '-1' | '-2' | '-3' | '-4' | '-5' | '-6' | '-7' | '-8' | '-9' | '-10' | '-11' | '-12' | '-13' | undefined
  message?: string | undefined
  details: {
    device: {
      device_uuid: string
      device_name: string
      user_id: string
      created_at: number
    }
    user_id: string
    server_ecdsa_pubkey: string
    server_rsa_pubkey: string
  }
  metadata: unknown
}

Prop

Type

AuthKeyRegisterResponse_pending
interface AuthKeyRegisterResponse_pending {
  status: 'pending'
  error_code?: '-1' | '-2' | '-3' | '-4' | '-5' | '-6' | '-7' | '-8' | '-9' | '-10' | '-11' | '-12' | '-13' | undefined
  message?: string | undefined
  details: {
    proposal_id: string
  }
}

Prop

Type

AuthKeyRegisterResponse_failed | unauthorized | rejected
interface AuthKeyRegisterResponse_failed | unauthorized | rejected {
  status: 'failed' | 'unauthorized' | 'rejected'
  error_code?: '-1' | '-2' | '-3' | '-4' | '-5' | '-6' | '-7' | '-8' | '-9' | '-10' | '-11' | '-12' | '-13' | undefined
  message?: string | undefined
}

Prop

Type

Example

Example
import { resourceSchema } from '@blockstream/ecs-js-sdk'
import { broadcastRequest } from './broadcaster'

const response = await broadcastRequest<
  typeof resourceSchema.shape.auth.shape.keyRegister
>(
  {
    action: 'add',
    resource: '/account-management/key-register',
    details: {
      // TODO: fill in required fields
    },
  },
  blockstream,
)

On this page