Blockstream Enterprise
ReferenceAPI ReferenceAmp

Send Amp

Send Amp.

Request

AmpSendRequest
interface AmpSendRequest {
  action: 'add'
  resource: string
  details: {
    wid: string
    recipients: {
      wid: string
      satoshi: number
    } []
  }
}

Prop

Type

Response

AmpSendResponse_success
interface AmpSendResponse_success {
  status: 'success'
  error_code?: '-1' | '-2' | '-3' | '-4' | '-5' | '-6' | '-7' | '-8' | '-9' | '-10' | '-11' | '-12' | '-13' | undefined
  message?: string | undefined
  details: {
    pset: string
  }
  metadata: unknown
}

Prop

Type

AmpSendResponse_failed | pending | unauthorized | rejected
interface AmpSendResponse_failed | pending | unauthorized | rejected {
  status: 'failed' | 'pending' | '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 { AmpActionsSchema } from '@blockstream/amp-js-sdk'
import { broadcastRequest } from './broadcaster'

const response = await broadcastRequest<
  typeof AmpActionsSchema.shape.send
>(
  {
    action: 'add',
    resource: '/amp/assets/{assetId}/send',
    details: {
      // TODO: fill in required fields
    },
  },
  blockstream,
)

On this page