Typescript
For successful transaction processing, please include a system transfer tip to one of our designated tip addresses
interface RequestPayload {
base64_tx: string;
}
interface TransactionResult {
response?: string;
error?: string;
status: 'success' | 'error';
}
function submitSolanaTransaction(base64Transaction: string): Promise<TransactionResult> {
const url = "http://lon.block0.wtf/";
const payload: RequestPayload = {
base64_tx: base64Transaction
};
return fetch(url, {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(payload)
})
.then(async response => {
const data = await response.text();
return {
response: data,
status: 'success' as const
};
})
.catch(error => {
return {
error: error instanceof Error ? error.message : String(error),
status: 'error' as const
};
});
}
If you're sending with blockhash in your TX, please ensure to use commitment level finalized.
Last updated