ReferenceAPI ReferenceSpend Requests
Fee Estimation Spend Requests
Fee Estimation Spend Requests.
Request
interface SpendRequestsFeeEstimationRequest {
action: 'add'
resource: '/spend-requests/fee-estimation'
details: {
wallet_id: string
funding_wallet_id: string | undefined
fee_tiers: 'low' | 'med' | 'high' | 'custom'[]
coin_selection_algo: string | undefined
} & { tx_type: 'send'; request: { asset_id: string; recipients: { recipient: { type: 'wallet' | 'address' | 'recipient_payment_details'; value: string }; amount: number }[] } } | { tx_type: 'issue'; request: { issue_amount: number; reissue_amount: number; contract: { name: string; ticker: string; domain: string; precision: number; version: number }; coingecko_id: string | undefined } } | { tx_type: 'reissue'; request: { asset_id: string; amount: number } } | { tx_type: 'burn'; request: { asset_id: string; amount: number } }
}Prop
Type
Response
interface SpendRequestsFeeEstimationResponse_success {
status: 'success'
error_code?: '-1' | '-2' | '-3' | '-4' | '-5' | '-6' | '-7' | '-8' | '-9' | '-10' | '-11' | '-12' | '-13' | undefined
message?: string | undefined
details: {
fee_amount: number
fee_rate: number
fee_tier: 'low' | 'med' | 'high' | 'custom'
} []
metadata: unknown
}Prop
Type
Example
import { resourceSchema } from '@blockstream/ecs-js-sdk'
import { broadcastRequest } from './broadcaster'
const response = await broadcastRequest<
typeof resourceSchema.shape.spend-requests.shape.fee_estimation
>(
{
action: 'add',
resource: '/spend-requests/fee-estimation',
details: {
// TODO: fill in required fields
},
},
blockstream,
)