Blockstream Enterprise
ReferenceAPI ReferenceAuth

Login Auth

Login Auth.

Request

AuthLoginRequest
interface AuthLoginRequest {
  action: 'login'
  resource: '/auth'
  details: {
    email: string
    password: string
    pubkey: string
    ttl: number | undefined
  }
}

Prop

Type

Response

AuthLoginResponse_success
interface AuthLoginResponse_success {
  status: 'success'
  error_code?: '-1' | '-2' | '-3' | '-4' | '-5' | '-6' | '-7' | '-8' | '-9' | '-10' | '-11' | '-12' | '-13' | undefined
  message?: string | undefined
  details: {
    uid: string
    user_id: string
    pubkey_id: string
    created_at: number
    expires_at: number
    first_name: string
    last_name: string
    email: string
    mobile: string
    type: 'api' | 'regular'
    status: string
    last_accessed_at: number
  }
  metadata: unknown
}

Prop

Type

AuthLoginResponse_pending
interface AuthLoginResponse_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

AuthLoginResponse_failed | unauthorized | rejected
interface AuthLoginResponse_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.login
>(
  {
    action: 'login',
    resource: '/auth',
    details: {
      // TODO: fill in required fields
    },
  },
  blockstream,
)

On this page