Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: brc20 send status update, closes #4939 #5088

Merged
merged 1 commit into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading