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

Itttm/update wallet src20 #561

Closed
wants to merge 85 commits into from
Closed
Show file tree
Hide file tree
Changes from 40 commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
4f262d2
chore: change file for updating
itttm127 Dec 17, 2024
cd7b75a
chore: update button style on mint & fix stamping/stamp page loading …
itttm127 Dec 17, 2024
44c4741
chore: update button style on mint & fix stamping/stamp page loading …
itttm127 Dec 17, 2024
a982191
chore: update button style on mint & fix stamping/stamp page loading …
itttm127 Dec 17, 2024
905b0d6
chore: update button style on mint & fix stamping/stamp page loading …
itttm127 Dec 17, 2024
5fe6357
chore: change file for updating
itttm127 Dec 17, 2024
5b2e4b5
chore: update button style on mint & fix stamping/stamp page loading …
itttm127 Dec 17, 2024
e46a60f
chore: update button style on mint & fix stamping/stamp page loading …
itttm127 Dec 17, 2024
0c67ac7
chore: update button style on mint & fix stamping/stamp page loading …
itttm127 Dec 17, 2024
f6b0caf
chore: fix dependency & update date field
itttm127 Dec 19, 2024
20abce1
chore: change file for updating
itttm127 Dec 17, 2024
ac70370
chore: update button style on mint & fix stamping/stamp page loading …
itttm127 Dec 17, 2024
c1a7c0c
chore: update button style on mint & fix stamping/stamp page loading …
itttm127 Dec 17, 2024
06797f1
chore: update button style on mint & fix stamping/stamp page loading …
itttm127 Dec 17, 2024
cc5c77c
chore: change file for updating
itttm127 Dec 17, 2024
c4ed9c7
chore: update button style on mint & fix stamping/stamp page loading …
itttm127 Dec 17, 2024
1ca3783
chore: update button style on mint & fix stamping/stamp page loading …
itttm127 Dec 17, 2024
5ac5dcc
chore: update button style on mint & fix stamping/stamp page loading …
itttm127 Dec 17, 2024
f001cd1
chore: add date field & remove memo
itttm127 Dec 19, 2024
32aa770
feat: add date field on xcp service & update src20 pagination on wall…
itttm127 Dec 19, 2024
5a1a127
chore: change file for updating
itttm127 Dec 17, 2024
0a9ad88
chore: update button style on mint & fix stamping/stamp page loading …
itttm127 Dec 17, 2024
f82be12
chore: update button style on mint & fix stamping/stamp page loading …
itttm127 Dec 17, 2024
94fdcf8
chore: update button style on mint & fix stamping/stamp page loading …
itttm127 Dec 17, 2024
fcdd173
chore: change file for updating
itttm127 Dec 17, 2024
0e8fb61
chore: update button style on mint & fix stamping/stamp page loading …
itttm127 Dec 17, 2024
c82acb8
chore: update button style on mint & fix stamping/stamp page loading …
itttm127 Dec 17, 2024
b7204d4
chore: update button style on mint & fix stamping/stamp page loading …
itttm127 Dec 17, 2024
434b651
chore: fix dependency & update date field
itttm127 Dec 19, 2024
64d2685
chore: change file for updating
itttm127 Dec 17, 2024
838614f
chore: update button style on mint & fix stamping/stamp page loading …
itttm127 Dec 17, 2024
f706373
chore: update button style on mint & fix stamping/stamp page loading …
itttm127 Dec 17, 2024
40c3e0b
chore: update button style on mint & fix stamping/stamp page loading …
itttm127 Dec 17, 2024
00244b9
chore: change file for updating
itttm127 Dec 17, 2024
8ce5e4c
chore: update button style on mint & fix stamping/stamp page loading …
itttm127 Dec 17, 2024
05fac63
chore: update button style on mint & fix stamping/stamp page loading …
itttm127 Dec 17, 2024
c7aed15
chore: update button style on mint & fix stamping/stamp page loading …
itttm127 Dec 17, 2024
d7d0494
chore: add date field & remove memo
itttm127 Dec 19, 2024
0099efc
feat: add date field on xcp service & update src20 pagination on wall…
itttm127 Dec 19, 2024
c7d7c85
Merge branch 'itttm/update_wallet_src20' of https://github.com/stampc…
itttm127 Dec 19, 2024
0ada3e9
chore: deprecated window in deno 2.x
reinamora137 Dec 19, 2024
96869af
chore: move the getTxInfo inot utxoUtilis
itttm127 Dec 19, 2024
e3144bd
Merge branch 'dev' into itttm/update_wallet_src20
itttm127 Dec 19, 2024
1e2936b
fix: linting issues
reinamora137 Dec 19, 2024
52286f8
chore: update holder table
itttm127 Dec 19, 2024
4029197
chore: change file for updating
itttm127 Dec 17, 2024
23f33d8
chore: update button style on mint & fix stamping/stamp page loading …
itttm127 Dec 17, 2024
1c87fac
chore: update button style on mint & fix stamping/stamp page loading …
itttm127 Dec 17, 2024
2ce147f
chore: update button style on mint & fix stamping/stamp page loading …
itttm127 Dec 17, 2024
cb9fb23
chore: change file for updating
itttm127 Dec 17, 2024
ff5e350
chore: update button style on mint & fix stamping/stamp page loading …
itttm127 Dec 17, 2024
ce55b16
chore: update button style on mint & fix stamping/stamp page loading …
itttm127 Dec 17, 2024
6c8c138
chore: update button style on mint & fix stamping/stamp page loading …
itttm127 Dec 17, 2024
b8fc911
chore: fix dependency & update date field
itttm127 Dec 19, 2024
9b50ba2
chore: change file for updating
itttm127 Dec 17, 2024
9a890c9
chore: update button style on mint & fix stamping/stamp page loading …
itttm127 Dec 17, 2024
01ce773
chore: update button style on mint & fix stamping/stamp page loading …
itttm127 Dec 17, 2024
358faed
chore: update button style on mint & fix stamping/stamp page loading …
itttm127 Dec 17, 2024
e3633a6
chore: change file for updating
itttm127 Dec 17, 2024
d1dfa76
chore: update button style on mint & fix stamping/stamp page loading …
itttm127 Dec 17, 2024
73f0eaa
chore: update button style on mint & fix stamping/stamp page loading …
itttm127 Dec 17, 2024
d0f41c5
chore: update button style on mint & fix stamping/stamp page loading …
itttm127 Dec 17, 2024
186206c
chore: add date field & remove memo
itttm127 Dec 19, 2024
092d6e2
feat: add date field on xcp service & update src20 pagination on wall…
itttm127 Dec 19, 2024
b8f1ad0
chore: change file for updating
itttm127 Dec 17, 2024
787f17d
chore: update button style on mint & fix stamping/stamp page loading …
itttm127 Dec 17, 2024
54927ec
chore: update button style on mint & fix stamping/stamp page loading …
itttm127 Dec 17, 2024
45a07aa
chore: update button style on mint & fix stamping/stamp page loading …
itttm127 Dec 17, 2024
8366c3d
chore: change file for updating
itttm127 Dec 17, 2024
e99acf0
chore: update button style on mint & fix stamping/stamp page loading …
itttm127 Dec 17, 2024
534999e
chore: update button style on mint & fix stamping/stamp page loading …
itttm127 Dec 17, 2024
69afbda
chore: update button style on mint & fix stamping/stamp page loading …
itttm127 Dec 17, 2024
e6ed4cc
chore: fix dependency & update date field
itttm127 Dec 19, 2024
c6d978b
chore: change file for updating
itttm127 Dec 17, 2024
74fcfc7
chore: update button style on mint & fix stamping/stamp page loading …
itttm127 Dec 17, 2024
76bf704
chore: update button style on mint & fix stamping/stamp page loading …
itttm127 Dec 17, 2024
3a2f195
chore: update button style on mint & fix stamping/stamp page loading …
itttm127 Dec 17, 2024
d22e70a
chore: change file for updating
itttm127 Dec 17, 2024
3c809b1
chore: update button style on mint & fix stamping/stamp page loading …
itttm127 Dec 17, 2024
9b91217
chore: update button style on mint & fix stamping/stamp page loading …
itttm127 Dec 17, 2024
489b62f
chore: update button style on mint & fix stamping/stamp page loading …
itttm127 Dec 17, 2024
0febd82
chore: add date field & remove memo
itttm127 Dec 19, 2024
0889d3a
chore: move the getTxInfo inot utxoUtilis
itttm127 Dec 19, 2024
e962ada
chore: update holder table
itttm127 Dec 19, 2024
80dbc8d
Merge branch 'itttm/update_wallet_src20' of https://github.com/stampc…
itttm127 Dec 19, 2024
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 islands/Wallet/details/WalletContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ export default function WalletContent({
<SRC20Section
type="all"
fromPage="wallet"
initialData={src20.data}
initialData={[]}
pagination={{
page: src20.pagination.page,
limit: src20.pagination.limit,
Expand Down
2 changes: 1 addition & 1 deletion islands/src20/SRC20Section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export function SRC20Section(
const [isModalOpen, setModalOpen] = useState(false);

useEffect(() => {
if (!initialData) {
if (!initialData?.length) {
setIsTransitioning(true);
setIsLoading(true);
const endpoint = fromPage === "wallet" && address
Expand Down
45 changes: 35 additions & 10 deletions server/services/xcpService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,29 @@ export class XcpManager {
}
}

static async getTxInfo(tx: string): Promise<number | null> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesn't really fit within the xcpService file since it's not really related to xcp calls. probably lib/utils be suitable to go along with similar utxoUtils and broadcast.ts.

should also just utilize the BLOCKSTREAM_API_BASE_URL var in constants.

It looks like it willl just return a null value if it fails connecting to blockstream (blocked by usage limits, etc) - this should fallback to N/A for the value to the client

const endpoint = `https://blockstream.info/api/tx/${tx}`;
let timestamp: number | null = null;

try {
const response = await fetch(endpoint);
if (!response.ok) {
console.error(`Failed to fetch transaction data: ${response.statusText}`);
return null;
}

const data = await response.json();
if (data.status && data.status.block_time) {
timestamp = data.status.block_time * 1000;
} else {
console.warn("Block time not found in the API response.");
}
} catch (error) {
console.error("Error fetching transaction data:", error);
}
return timestamp;
}

static async getXcpSendsByCPID(
cpid: string,
page: number = 1,
Expand Down Expand Up @@ -799,16 +822,18 @@ export class XcpManager {
break;
}

const sends = response.result.map((send: any) => ({
tx_hash: send.tx_hash,
block_index: send.block_index,
source: send.source,
destination: send.destination,
quantity: send.quantity,
asset: cpid,
status: send.status,
}));

const sends = await Promise.all(
response.result.map(async (send: any) => ({
tx_hash: send.tx_hash,
block_index: send.block_index,
block_time: await this.getTxInfo(send.tx_hash), // Fetch block time
source: send.source,
destination: send.destination,
quantity: send.quantity,
asset: cpid,
status: send.status,
}))
);
allSends = allSends.concat(sends);
processedCount += sends.length;

Expand Down
Loading