Skip to content

Commit

Permalink
fix: brc20 send status update, closes #4939
Browse files Browse the repository at this point in the history
  • Loading branch information
alter-eggo committed Mar 18, 2024
1 parent 1d87592 commit e49e7ec
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/app/query/bitcoin/ordinals/brc20/use-brc-20.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export function useBrc20Transfers(holderAddress: string) {

if (order.data.status !== 'ok') throw new Error('Failed to initiate transfer');

return { id: order.data.charge.id, order };
return { id: order.data.id, order };
},

inscriptionPaymentTransactionComplete(
Expand Down
10 changes: 5 additions & 5 deletions src/app/query/bitcoin/ordinals/brc20/use-check-order-status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ export function useCheckOrderStatuses(ids: string[]) {
return;
}

const entry = transferMap[data.charge.id];
const entry = transferMap[data.id];

if (!entry) return;

const file = data.files[0];

// inscrption reported by service
// inscription reported by service
if ('tx' in file) {
// see if its on hiro indexer
try {
Expand All @@ -45,7 +45,7 @@ export function useCheckOrderStatuses(ids: string[]) {
if (inscription.number) {
dispatch(
brc20TransferReady({
id: data.charge.id,
id: data.id,
inscriptionId: file.tx?.inscription ?? '',
})
);
Expand All @@ -54,12 +54,12 @@ export function useCheckOrderStatuses(ids: string[]) {
} catch (error) {}

// or say awaiting indexer
dispatch(brc20TransferAwaitingIndexer({ id: data.charge.id }));
dispatch(brc20TransferAwaitingIndexer({ id: data.id }));
return;
}

if (data.paid && entry.status !== 'paid') {
dispatch(brc20TransferPaid({ id: data.charge.id }));
dispatch(brc20TransferPaid({ id: data.id }));
return;
}
},
Expand Down
2 changes: 1 addition & 1 deletion src/app/query/bitcoin/ordinals/inscription-by-id.query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ import { HIRO_INSCRIPTIONS_API_URL } from '@shared/constants';
import { InscriptionResponseItem } from '@shared/models/inscription.model';

export async function fetchInscripionById(id: string) {
return axios.get<InscriptionResponseItem>(`${HIRO_INSCRIPTIONS_API_URL}}/${id}`);
return axios.get<InscriptionResponseItem>(`${HIRO_INSCRIPTIONS_API_URL}/${id}`);
}
3 changes: 3 additions & 0 deletions src/app/query/bitcoin/ordinalsbot-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ interface InscriptionOrderSuccessResponse {
payreq: string;
};
};
id: string;
chainFee: number;
serviceFee: number;
baseFee: number;
Expand All @@ -69,6 +70,8 @@ interface OrderStatusSuccessResponse {
paid: boolean;
underpaid: boolean;
expired: boolean;
id: string;
state: string;
charge: {
id: string;
description: string;
Expand Down

0 comments on commit e49e7ec

Please sign in to comment.