@indexing/jiti 0.0.19 → 0.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.js +549 -4
- package/dist/main.js.map +1 -1
- package/dist/module.js +549 -4
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +3 -1
package/dist/main.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
var $8zHUo$buffer = require("buffer");
|
|
2
|
+
var $8zHUo$cosmjsprotosigning = require("@cosmjs/proto-signing");
|
|
3
|
+
var $8zHUo$cosmjsstargate = require("@cosmjs/stargate");
|
|
1
4
|
var $8zHUo$viem = require("viem");
|
|
2
5
|
|
|
3
6
|
|
|
@@ -272,6 +275,10 @@ $parcel$exportWildcard($d7167569386d0d4c$exports, $f7a3fb164436c9c3$exports);
|
|
|
272
275
|
$parcel$exportWildcard($d7167569386d0d4c$exports, $414c83047563e72e$exports);
|
|
273
276
|
|
|
274
277
|
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
var $6144a02851f23907$require$Buffer = $8zHUo$buffer.Buffer;
|
|
275
282
|
const $6144a02851f23907$var$NULL_ADDRESS = "0x0000000000000000000000000000000000000000";
|
|
276
283
|
const $6144a02851f23907$var$tokenTransfersTemplate = {
|
|
277
284
|
key: "token_transfers",
|
|
@@ -321,9 +328,349 @@ const $6144a02851f23907$var$tokenTransfersTemplate = {
|
|
|
321
328
|
const TOKEN_TYPES = _ctx.params.tokenTypes || [];
|
|
322
329
|
let transfers = [];
|
|
323
330
|
switch(block._network){
|
|
324
|
-
|
|
325
|
-
|
|
331
|
+
case "APTOS":
|
|
332
|
+
case "APTOS_TESTNET":
|
|
333
|
+
for (const tx of block.transactions){
|
|
334
|
+
if (!tx?.events || !Array.isArray(tx.events)) break;
|
|
335
|
+
const timestamp = tx.timestamp ? new Date(parseInt(tx.timestamp) / 1000).toISOString() : null;
|
|
336
|
+
const txfersByKey = {};
|
|
337
|
+
for (const evt of tx.events)if ([
|
|
338
|
+
"0x1::coin::WithdrawEvent",
|
|
339
|
+
"0x1::coin::DepositEvent"
|
|
340
|
+
].includes(evt.type)) {
|
|
341
|
+
const amount = evt.data?.amount;
|
|
342
|
+
const key = `0x1-${amount}`;
|
|
343
|
+
txfersByKey[key] ||= {
|
|
344
|
+
amount: amount,
|
|
345
|
+
tokenAddress: null
|
|
346
|
+
};
|
|
347
|
+
if (evt.type.endsWith("WithdrawEvent")) txfersByKey[key].from = evt.guid?.account_address;
|
|
348
|
+
else txfersByKey[key].to = evt.guid?.account_address;
|
|
349
|
+
}
|
|
350
|
+
for (const partial of Object.values(txfersByKey)){
|
|
351
|
+
if (!partial.from || !partial.to) continue;
|
|
352
|
+
transfers.push({
|
|
353
|
+
amount: BigInt(partial.amount),
|
|
354
|
+
blockNumber: parseInt(block.block_height),
|
|
355
|
+
from: partial.from,
|
|
356
|
+
timestamp: timestamp,
|
|
357
|
+
to: partial.to,
|
|
358
|
+
token: partial.tokenAddress,
|
|
359
|
+
tokenType: "NATIVE",
|
|
360
|
+
transactionGasFee: BigInt(tx.gas_used),
|
|
361
|
+
transactionHash: tx.hash
|
|
362
|
+
});
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
break;
|
|
366
|
+
case "BITCOIN":
|
|
367
|
+
case "BITCOIN_TESTNET":
|
|
368
|
+
case "LITCOIN":
|
|
369
|
+
case "DOGECOIN":
|
|
370
|
+
for (const tx of block.tx){
|
|
371
|
+
const timestamp = tx.time ? new Date(tx.time * 1000).toISOString() : null;
|
|
372
|
+
const vin = tx.vin[0];
|
|
373
|
+
const vout = tx.vout;
|
|
374
|
+
const fromVout = Math.min(vin.vout || 1000, vout.length - 1);
|
|
375
|
+
const fromAddress = vin.prevout?.scriptPubKey?.address || vout[fromVout]?.scriptPubKey?.address || vout[fromVout]?.scriptPubKey?.addresses?.[0];
|
|
376
|
+
if (!fromAddress) break;
|
|
377
|
+
for (const v of vout)transfers.push({
|
|
378
|
+
amount: BigInt(Math.round(v.value * Math.pow(10, 8))),
|
|
379
|
+
blockNumber: block.height,
|
|
380
|
+
from: fromAddress,
|
|
381
|
+
timestamp: timestamp,
|
|
382
|
+
to: v.scriptPubKey.address || v.scriptPubKey.addresses?.[0],
|
|
383
|
+
transactionGasFee: BigInt(tx.fee || 0) * BigInt(Math.pow(10, 8)),
|
|
384
|
+
transactionHash: tx.txid,
|
|
385
|
+
token: null,
|
|
386
|
+
tokenType: "NATIVE"
|
|
387
|
+
});
|
|
388
|
+
break;
|
|
389
|
+
}
|
|
390
|
+
break;
|
|
391
|
+
case "CARDANO":
|
|
392
|
+
{
|
|
393
|
+
const blockTimestamp = new Date(block.timestamp * 1000).toISOString();
|
|
394
|
+
for (const tx of block.transactions){
|
|
395
|
+
const typedTx = tx;
|
|
396
|
+
if (!Array.isArray(typedTx.operations)) continue;
|
|
397
|
+
const transactionHash = typedTx.transaction_identifier?.hash || "";
|
|
398
|
+
const inputs = typedTx.operations.filter((op)=>op.type === "input");
|
|
399
|
+
const outputs = typedTx.operations.filter((op)=>op.type === "output");
|
|
400
|
+
if (!inputs.length && !outputs.length) break;
|
|
401
|
+
const fromAddress = inputs[0]?.account?.address;
|
|
402
|
+
if (!fromAddress) continue;
|
|
403
|
+
const sumInputs = inputs.reduce((acc, op)=>{
|
|
404
|
+
const val = BigInt(op.amount?.value || "0");
|
|
405
|
+
return acc + val;
|
|
406
|
+
}, BigInt(0));
|
|
407
|
+
const sumOutputs = outputs.reduce((acc, op)=>{
|
|
408
|
+
const val = BigInt(op.amount?.value || "0");
|
|
409
|
+
return acc + val;
|
|
410
|
+
}, BigInt(0));
|
|
411
|
+
const transactionFee = sumInputs + BigInt(sumOutputs);
|
|
412
|
+
for (const out of outputs){
|
|
413
|
+
const rawValue = out.amount?.value || "0";
|
|
414
|
+
const absoluteValue = BigInt(rawValue);
|
|
415
|
+
transfers.push({
|
|
416
|
+
amount: absoluteValue < 0 ? -absoluteValue : absoluteValue,
|
|
417
|
+
blockNumber: block.block_identifier.index,
|
|
418
|
+
from: fromAddress,
|
|
419
|
+
timestamp: blockTimestamp,
|
|
420
|
+
to: out.account?.address || "",
|
|
421
|
+
token: out.amount?.currency?.symbol?.toUpperCase() === "ADA" ? null : out.amount?.currency?.symbol,
|
|
422
|
+
tokenType: out.amount?.currency?.symbol?.toUpperCase() === "ADA" ? "NATIVE" : "TOKEN",
|
|
423
|
+
transactionGasFee: transactionFee < 0 ? -transactionFee : transactionFee,
|
|
424
|
+
transactionHash: transactionHash
|
|
425
|
+
});
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
break;
|
|
429
|
+
}
|
|
430
|
+
case "RIPPLE":
|
|
431
|
+
if (!Array.isArray(block.transactions)) break;
|
|
432
|
+
for (const rawTx of block.transactions){
|
|
433
|
+
const typedTx = rawTx;
|
|
434
|
+
if (typedTx.TransactionType !== "Payment") continue;
|
|
435
|
+
const deliveredOrAmount = typedTx.metaData?.delivered_amount ?? typedTx.Amount ?? "0";
|
|
436
|
+
let tokenSymbol = "XRP";
|
|
437
|
+
let tokenType = "NATIVE";
|
|
438
|
+
let parsedAmount;
|
|
439
|
+
if (typeof deliveredOrAmount === "object") {
|
|
440
|
+
tokenSymbol = deliveredOrAmount.currency?.toUpperCase() ?? "UNKNOWN";
|
|
441
|
+
tokenType = "TOKEN";
|
|
442
|
+
const floatVal = parseFloat(deliveredOrAmount.value);
|
|
443
|
+
const smallestUnit = Math.round(floatVal * 1000000);
|
|
444
|
+
parsedAmount = BigInt(smallestUnit);
|
|
445
|
+
} else parsedAmount = BigInt(String(deliveredOrAmount));
|
|
446
|
+
transfers.push({
|
|
447
|
+
amount: parsedAmount,
|
|
448
|
+
blockNumber: parseInt(block.ledger_index, 10),
|
|
449
|
+
from: typedTx.Account ?? "UNKNOWN",
|
|
450
|
+
timestamp: block.close_time_iso ? block.close_time_iso : null,
|
|
451
|
+
to: typedTx.Destination ?? "UNKNOWN",
|
|
452
|
+
token: tokenSymbol,
|
|
453
|
+
tokenType: tokenType,
|
|
454
|
+
transactionGasFee: BigInt(typedTx.Fee ?? "0"),
|
|
455
|
+
transactionHash: typedTx.hash ?? ""
|
|
456
|
+
});
|
|
457
|
+
}
|
|
458
|
+
break;
|
|
459
|
+
case "SOLANA":
|
|
460
|
+
for (const tx of block.transactions){
|
|
461
|
+
const solanaTx = tx;
|
|
462
|
+
const txHash = solanaTx.transaction.signatures[0];
|
|
463
|
+
const timestamp = block.blockTime ? new Date(block.blockTime * 1000).toISOString() : null;
|
|
464
|
+
let txFee = BigInt(solanaTx.meta.fee);
|
|
465
|
+
if (txFee < BigInt(10)) txFee = txFee * BigInt(Math.pow(10, 9));
|
|
466
|
+
const transfersByKey = {};
|
|
467
|
+
for (const post of solanaTx.meta.postTokenBalances){
|
|
468
|
+
let matched = false;
|
|
469
|
+
for (const pre of solanaTx.meta.preTokenBalances)if (post.mint === pre.mint && post.owner === pre.owner) {
|
|
470
|
+
let diff = BigInt(post.uiTokenAmount.amount) - BigInt(pre.uiTokenAmount.amount);
|
|
471
|
+
if (diff === BigInt(0)) continue;
|
|
472
|
+
if (diff < 0) diff = -diff;
|
|
473
|
+
const key = `${post.mint}-${diff.toString()}`;
|
|
474
|
+
const txfer = {
|
|
475
|
+
amount: diff,
|
|
476
|
+
blockNumber: block.blockHeight,
|
|
477
|
+
from: pre.owner,
|
|
478
|
+
timestamp: timestamp,
|
|
479
|
+
to: post.owner,
|
|
480
|
+
transactionGasFee: txFee,
|
|
481
|
+
transactionHash: txHash,
|
|
482
|
+
token: post.mint,
|
|
483
|
+
tokenType: "TOKEN"
|
|
484
|
+
};
|
|
485
|
+
if (transfersByKey[key]) {
|
|
486
|
+
if (diff > 0) delete txfer.from;
|
|
487
|
+
else delete txfer.to;
|
|
488
|
+
}
|
|
489
|
+
transfersByKey[key] = Object.assign(transfersByKey[key] || {}, txfer);
|
|
490
|
+
matched = true;
|
|
491
|
+
}
|
|
492
|
+
if (!matched) {
|
|
493
|
+
let diff = BigInt(post.uiTokenAmount.amount);
|
|
494
|
+
if (diff < 0) diff = -diff;
|
|
495
|
+
const key = `${post.mint}-${diff.toString()}`;
|
|
496
|
+
const txfer = {
|
|
497
|
+
amount: diff,
|
|
498
|
+
blockNumber: block.blockHeight,
|
|
499
|
+
from: null,
|
|
500
|
+
timestamp: timestamp,
|
|
501
|
+
to: post.owner,
|
|
502
|
+
token: post.mint,
|
|
503
|
+
tokenType: "TOKEN",
|
|
504
|
+
transactionGasFee: txFee,
|
|
505
|
+
transactionHash: txHash
|
|
506
|
+
};
|
|
507
|
+
delete txfer.from;
|
|
508
|
+
transfersByKey[key] = Object.assign(transfersByKey[key] || {}, txfer);
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
for(let i = 1; i < solanaTx.meta.postBalances.length; i += 1){
|
|
512
|
+
const post = solanaTx.meta.postBalances[i];
|
|
513
|
+
const pre = solanaTx.meta.preBalances[i];
|
|
514
|
+
if (post !== undefined && pre !== undefined && post !== pre) {
|
|
515
|
+
let diff = BigInt(post) - BigInt(pre);
|
|
516
|
+
if (diff < 0) diff = -diff;
|
|
517
|
+
const key = `null-${diff.toString()}`;
|
|
518
|
+
const txfer = {
|
|
519
|
+
amount: diff,
|
|
520
|
+
blockNumber: block.blockHeight,
|
|
521
|
+
from: post > pre ? typeof solanaTx.transaction.message.accountKeys[0] === "string" ? solanaTx.transaction.message.accountKeys[0] : solanaTx.transaction.message.accountKeys[0]?.pubkey : typeof solanaTx.transaction.message.accountKeys[i] === "string" ? solanaTx.transaction.message.accountKeys[i] : solanaTx.transaction.message.accountKeys[i]?.pubkey,
|
|
522
|
+
timestamp: timestamp,
|
|
523
|
+
to: typeof solanaTx.transaction.message.accountKeys[i] === "string" ? solanaTx.transaction.message.accountKeys[i] : solanaTx.transaction.message.accountKeys[i]?.pubkey?.toString(),
|
|
524
|
+
token: null,
|
|
525
|
+
tokenType: "NATIVE",
|
|
526
|
+
transactionGasFee: txFee,
|
|
527
|
+
transactionHash: txHash
|
|
528
|
+
};
|
|
529
|
+
if (transfersByKey[key]) {
|
|
530
|
+
if (post > pre) delete txfer.from;
|
|
531
|
+
else delete txfer.to;
|
|
532
|
+
}
|
|
533
|
+
transfersByKey[key] = Object.assign(transfersByKey[key] || {}, txfer);
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
transfers.push(...Object.values(transfersByKey));
|
|
537
|
+
}
|
|
538
|
+
break;
|
|
539
|
+
case "STARKNET":
|
|
540
|
+
if (!Array.isArray(block.transactions)) break;
|
|
541
|
+
for (const tx of block.transactions){
|
|
542
|
+
const typedTx = tx;
|
|
543
|
+
const timestamp = block.timestamp ? new Date(block.timestamp * 1000).toISOString() : null;
|
|
544
|
+
let transactionGasFee = BigInt(0);
|
|
545
|
+
if (typedTx?.receipt?.actual_fee?.amount) transactionGasFee = BigInt(typedTx.receipt.actual_fee.amount);
|
|
546
|
+
const transactionHash = typedTx.transaction_hash;
|
|
547
|
+
if (!typedTx.receipt?.events) continue;
|
|
548
|
+
for (const event of typedTx.receipt.events){
|
|
549
|
+
if (!event.keys.includes("0x99cd8bde557814842a3121e8ddfd433a539b8c9f14bf31ebf108d12e6196e9")) continue;
|
|
550
|
+
if (event.data.length < 3) continue;
|
|
551
|
+
const [from, to, amountHex] = event.data;
|
|
552
|
+
const amount = BigInt(amountHex);
|
|
553
|
+
transfers.push({
|
|
554
|
+
amount: amount,
|
|
555
|
+
blockNumber: block.block_number,
|
|
556
|
+
from: from,
|
|
557
|
+
timestamp: timestamp,
|
|
558
|
+
to: to,
|
|
559
|
+
token: null,
|
|
560
|
+
tokenType: "NATIVE",
|
|
561
|
+
transactionGasFee: transactionGasFee,
|
|
562
|
+
transactionHash: transactionHash
|
|
563
|
+
});
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
break;
|
|
567
|
+
case "STELLAR":
|
|
568
|
+
for (const tx of block.transactions){
|
|
569
|
+
const typedTx = tx;
|
|
570
|
+
for (const op of typedTx.operations)if (op.type === "payment") transfers.push({
|
|
571
|
+
amount: BigInt(op.amount.replace(".", "")),
|
|
572
|
+
blockNumber: block.sequence,
|
|
573
|
+
from: op.from,
|
|
574
|
+
timestamp: typedTx.created_at,
|
|
575
|
+
to: op.to,
|
|
576
|
+
token: op.asset_type === "native" ? null : op.asset_issuer,
|
|
577
|
+
tokenType: op.asset_type === "native" ? "NATIVE" : "TOKEN",
|
|
578
|
+
transactionGasFee: BigInt(typedTx.fee_charged),
|
|
579
|
+
transactionHash: typedTx.hash
|
|
580
|
+
});
|
|
581
|
+
}
|
|
582
|
+
break;
|
|
583
|
+
case "SUI":
|
|
584
|
+
{
|
|
585
|
+
const blockNumber = block.sequence;
|
|
586
|
+
const blockTimestamp = new Date(block.timestamp).toISOString();
|
|
587
|
+
for (const tx of block.transactions || []){
|
|
588
|
+
const transactionHash = tx.digest;
|
|
589
|
+
const transactionGasFee = BigInt(tx.gasFee || "0");
|
|
590
|
+
for (const bc of tx.balanceChanges || [])transfers.push({
|
|
591
|
+
blockNumber: blockNumber,
|
|
592
|
+
from: tx.sender ? tx.sender : undefined,
|
|
593
|
+
to: tx.receiver ? tx.receiver : undefined,
|
|
594
|
+
amount: BigInt(bc.amount),
|
|
595
|
+
token: bc.coinRepr,
|
|
596
|
+
tokenType: "NATIVE",
|
|
597
|
+
timestamp: blockTimestamp,
|
|
598
|
+
transactionHash: transactionHash,
|
|
599
|
+
transactionGasFee: transactionGasFee
|
|
600
|
+
});
|
|
601
|
+
}
|
|
602
|
+
break;
|
|
603
|
+
}
|
|
604
|
+
case "TON":
|
|
605
|
+
{
|
|
606
|
+
const blockNumber = block.seqno;
|
|
607
|
+
const blockTimestamp = new Date(block.shards?.[0]?.gen_utime * 1000).toISOString();
|
|
608
|
+
for (const shard of block.shards || [])for (const tx of shard.transactions || []){
|
|
609
|
+
const transactionLT = tx.transaction_id.lt;
|
|
610
|
+
const transactionHash = tx.transaction_id.hash;
|
|
611
|
+
const transactionFee = BigInt(tx.fee || "0");
|
|
612
|
+
const inVal = BigInt(tx.in_msg?.value || "0");
|
|
613
|
+
if (inVal > 0n) transfers.push({
|
|
614
|
+
blockNumber: blockNumber,
|
|
615
|
+
from: tx.in_msg?.source?.account_address,
|
|
616
|
+
to: tx.address?.account_address,
|
|
617
|
+
amount: inVal,
|
|
618
|
+
token: "TON",
|
|
619
|
+
tokenType: "NATIVE",
|
|
620
|
+
timestamp: blockTimestamp,
|
|
621
|
+
transactionHash: transactionHash,
|
|
622
|
+
transactionGasFee: transactionFee
|
|
623
|
+
});
|
|
624
|
+
for (const outMsg of tx.out_msgs || []){
|
|
625
|
+
const outVal = BigInt(outMsg.value || "0");
|
|
626
|
+
if (outVal > 0n) transfers.push({
|
|
627
|
+
blockNumber: blockNumber,
|
|
628
|
+
from: outMsg.source?.account_address,
|
|
629
|
+
to: outMsg.destination?.account_address,
|
|
630
|
+
amount: outVal,
|
|
631
|
+
token: "TON",
|
|
632
|
+
tokenType: "NATIVE",
|
|
633
|
+
timestamp: blockTimestamp,
|
|
634
|
+
transactionHash: transactionHash,
|
|
635
|
+
transactionGasFee: transactionFee
|
|
636
|
+
});
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
break;
|
|
640
|
+
}
|
|
641
|
+
// attempt to introspect data types
|
|
326
642
|
default:
|
|
643
|
+
// try Cosmos
|
|
644
|
+
if (block.block) {
|
|
645
|
+
const typedBlock = block;
|
|
646
|
+
const blockNumber = Number(typedBlock.block.header.height);
|
|
647
|
+
const blockTimestamp = new Date(typedBlock.block.header.time).toISOString();
|
|
648
|
+
const blockHash = typedBlock.block_id.hash;
|
|
649
|
+
for (const txRaw of typedBlock.block.data.txs || []){
|
|
650
|
+
const decoded = (0, $8zHUo$cosmjsprotosigning.decodeTxRaw)(new Uint8Array($6144a02851f23907$require$Buffer.from(txRaw, "base64")));
|
|
651
|
+
const transactionGasFee = BigInt(decoded.authInfo.fee?.amount?.[0]?.amount || "0");
|
|
652
|
+
const registry = new (0, $8zHUo$cosmjsprotosigning.Registry)((0, $8zHUo$cosmjsstargate.defaultRegistryTypes));
|
|
653
|
+
for (const message of decoded.body.messages)if ([
|
|
654
|
+
"/ibc.applications.transfer.v1.MsgTransfer",
|
|
655
|
+
"/cosmos.bank.v1beta1.MsgSend"
|
|
656
|
+
].includes(message.typeUrl)) {
|
|
657
|
+
const decodedMsg = registry.decode(message);
|
|
658
|
+
transfers.push({
|
|
659
|
+
blockNumber: blockNumber,
|
|
660
|
+
from: decodedMsg.sender,
|
|
661
|
+
to: decodedMsg.receiver,
|
|
662
|
+
amount: BigInt(decodedMsg.token.amount),
|
|
663
|
+
token: decodedMsg.token.denom,
|
|
664
|
+
tokenType: "NATIVE",
|
|
665
|
+
timestamp: blockTimestamp,
|
|
666
|
+
transactionHash: blockHash,
|
|
667
|
+
transactionGasFee: transactionGasFee
|
|
668
|
+
});
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
break;
|
|
672
|
+
}
|
|
673
|
+
// otherwise assume EVM
|
|
327
674
|
for (const tx of block.transactions){
|
|
328
675
|
if (!tx.receipt) continue;
|
|
329
676
|
const timestamp = new Date(block.timestamp * 1000).toISOString();
|
|
@@ -375,7 +722,6 @@ const $6144a02851f23907$var$tokenTransfersTemplate = {
|
|
|
375
722
|
transactionHash: tx.hash
|
|
376
723
|
});
|
|
377
724
|
}
|
|
378
|
-
// @TODO: add NFT transfers
|
|
379
725
|
if (!TOKEN_TYPES.length || TOKEN_TYPES.includes("NFT")) for (const log of tx.receipt.logs){
|
|
380
726
|
const txfer = (0, $da55be3e40667945$export$cf548b70626e2eb9)(log, [
|
|
381
727
|
"Transfer(address indexed from, address indexed to, uint256 indexed value)",
|
|
@@ -438,7 +784,7 @@ const $6144a02851f23907$var$tokenTransfersTemplate = {
|
|
|
438
784
|
}
|
|
439
785
|
transfers = transfers.filter((txfer)=>{
|
|
440
786
|
if (txfer.amount <= BigInt(0)) return false;
|
|
441
|
-
if (_ctx.params.contractAddress && _ctx.params.contractAddress !== txfer.token) return false;
|
|
787
|
+
if (_ctx.params.contractAddress && _ctx.params.contractAddress !== txfer.token && txfer.token) return false;
|
|
442
788
|
if (_ctx.params.walletAddress && ![
|
|
443
789
|
txfer.from,
|
|
444
790
|
txfer.to
|
|
@@ -448,6 +794,29 @@ const $6144a02851f23907$var$tokenTransfersTemplate = {
|
|
|
448
794
|
return transfers;
|
|
449
795
|
},
|
|
450
796
|
tests: [
|
|
797
|
+
// APTOS
|
|
798
|
+
{
|
|
799
|
+
params: {
|
|
800
|
+
network: "APTOS",
|
|
801
|
+
walletAddress: "0xb3589951a7d8579a2918a749260804047abc60438bf0738c4e67683e972b41cd",
|
|
802
|
+
contractAddress: "0x1"
|
|
803
|
+
},
|
|
804
|
+
payload: "https://jiti.indexing.co/networks/aptos/237372198",
|
|
805
|
+
output: [
|
|
806
|
+
{
|
|
807
|
+
amount: 12776498n,
|
|
808
|
+
blockNumber: 237372198,
|
|
809
|
+
from: "0xb3589951a7d8579a2918a749260804047abc60438bf0738c4e67683e972b41cd",
|
|
810
|
+
timestamp: "2024-10-10T16:59:34.414Z",
|
|
811
|
+
to: "0x1f5d15c9a1330389bda239ed2f40d8d2a2ba446e7a48ee57483a047d5ed1aafe",
|
|
812
|
+
token: null,
|
|
813
|
+
tokenType: "NATIVE",
|
|
814
|
+
transactionGasFee: 507n,
|
|
815
|
+
transactionHash: "0xbabaf20c07c80ace9f1f2f6539e0df6c57c9a6b24d5e62fa4989b46c0807d9bb"
|
|
816
|
+
}
|
|
817
|
+
]
|
|
818
|
+
},
|
|
819
|
+
// BASE
|
|
451
820
|
{
|
|
452
821
|
params: {
|
|
453
822
|
network: "BASE",
|
|
@@ -469,6 +838,182 @@ const $6144a02851f23907$var$tokenTransfersTemplate = {
|
|
|
469
838
|
transactionHash: "0x69c9b12ccbe2d4f2f1dfc7c4a8557fc099fc5df276424417815acbc79a06fd56"
|
|
470
839
|
}
|
|
471
840
|
]
|
|
841
|
+
},
|
|
842
|
+
// DOGECOIN
|
|
843
|
+
{
|
|
844
|
+
params: {
|
|
845
|
+
network: "DOGECOIN",
|
|
846
|
+
walletAddress: "DMqRVLrhbam3Kcfddpxd6EYvEBbpi3bEpP",
|
|
847
|
+
contractAddress: ""
|
|
848
|
+
},
|
|
849
|
+
payload: "https://jiti.indexing.co/networks/dogecoin/1000075",
|
|
850
|
+
output: [
|
|
851
|
+
{
|
|
852
|
+
amount: 1008521000000n,
|
|
853
|
+
blockNumber: 1000075,
|
|
854
|
+
from: "DMqRVLrhbam3Kcfddpxd6EYvEBbpi3bEpP",
|
|
855
|
+
to: "DMqRVLrhbam3Kcfddpxd6EYvEBbpi3bEpP",
|
|
856
|
+
token: null,
|
|
857
|
+
tokenType: "NATIVE",
|
|
858
|
+
transactionGasFee: 0n,
|
|
859
|
+
transactionHash: "9873fe46ab29f61cefdec498b691af68e0ad29a7599c94f42d2d4e9a5d461dbe",
|
|
860
|
+
timestamp: "2015-12-13T19:59:52.000Z"
|
|
861
|
+
}
|
|
862
|
+
]
|
|
863
|
+
},
|
|
864
|
+
// CARDANO
|
|
865
|
+
{
|
|
866
|
+
params: {
|
|
867
|
+
network: "CARDANO",
|
|
868
|
+
walletAddress: "addr1q9syxu908lef7r6rsvk0h7gsx3rxj22cuykgx2a2l4hcfd8e9y2e9vtv4w9dyej96w99wwj8hwgc273862lk6a3vt30qjjrund",
|
|
869
|
+
contractAddress: ""
|
|
870
|
+
},
|
|
871
|
+
payload: "https://jiti.indexing.co/networks/cardano/11443286",
|
|
872
|
+
output: [
|
|
873
|
+
{
|
|
874
|
+
amount: 1110000n,
|
|
875
|
+
blockNumber: 11443286,
|
|
876
|
+
from: "addr1qymdv285few5tyqvya86rl97r9e608njs37shfew6l2nn473aw2pcnrcvfwfgg2dnew99m4tjj0apsu7232w2euzwpysndh0h3",
|
|
877
|
+
timestamp: "+057068-01-19T05:23:20.000Z",
|
|
878
|
+
to: "addr1q9syxu908lef7r6rsvk0h7gsx3rxj22cuykgx2a2l4hcfd8e9y2e9vtv4w9dyej96w99wwj8hwgc273862lk6a3vt30qjjrund",
|
|
879
|
+
token: null,
|
|
880
|
+
tokenType: "NATIVE",
|
|
881
|
+
transactionGasFee: 174257n,
|
|
882
|
+
transactionHash: "261c42ba9124f55d8e169ebb692cd3759d796a54369acb316ee449b546e79309"
|
|
883
|
+
}
|
|
884
|
+
]
|
|
885
|
+
},
|
|
886
|
+
// RIPPLE
|
|
887
|
+
{
|
|
888
|
+
params: {
|
|
889
|
+
network: "RIPPLE",
|
|
890
|
+
walletAddress: "rUUgoiJmjTPEbxfZ4RsS9pVS9Kv813Wpui",
|
|
891
|
+
contractAddress: ""
|
|
892
|
+
},
|
|
893
|
+
payload: "https://jiti.indexing.co/networks/ripple/88104659",
|
|
894
|
+
output: [
|
|
895
|
+
{
|
|
896
|
+
amount: 238n,
|
|
897
|
+
blockNumber: 88104659,
|
|
898
|
+
from: "rMAGnTv4eMWktZnhKa5cHcDiY84ZiKUaQm",
|
|
899
|
+
timestamp: "2024-05-19T22:18:52Z",
|
|
900
|
+
to: "rUUgoiJmjTPEbxfZ4RsS9pVS9Kv813Wpui",
|
|
901
|
+
token: "XRP",
|
|
902
|
+
tokenType: "NATIVE",
|
|
903
|
+
transactionGasFee: 15n,
|
|
904
|
+
transactionHash: "03564E6109261CDE73FCC5062C2A0A70F365CB1A0F9408C065B60EC3E94E4DBF"
|
|
905
|
+
}
|
|
906
|
+
]
|
|
907
|
+
},
|
|
908
|
+
// STELLAR
|
|
909
|
+
{
|
|
910
|
+
params: {
|
|
911
|
+
network: "STELLAR",
|
|
912
|
+
walletAddress: "GA5KLTNAWV27IOTBX5PKUOMVWFMLX4X7CPMQJ4QLR3G266MMVL7NMA4X",
|
|
913
|
+
contractAddress: "GC4Z2TDXU4GXVLHOS5P5SU6HKBCP7NKN4TJ5ZGTVRBW7MCBZTU7SNUSA"
|
|
914
|
+
},
|
|
915
|
+
payload: "https://jiti.indexing.co/networks/stellar/51720546",
|
|
916
|
+
output: [
|
|
917
|
+
{
|
|
918
|
+
amount: 150000n,
|
|
919
|
+
blockNumber: 51720546,
|
|
920
|
+
from: "GA5KLTNAWV27IOTBX5PKUOMVWFMLX4X7CPMQJ4QLR3G266MMVL7NMA4X",
|
|
921
|
+
timestamp: "2024-05-18T04:41:39Z",
|
|
922
|
+
to: "GC4Z2TDXU4GXVLHOS5P5SU6HKBCP7NKN4TJ5ZGTVRBW7MCBZTU7SNUSA",
|
|
923
|
+
token: "GC4Z2TDXU4GXVLHOS5P5SU6HKBCP7NKN4TJ5ZGTVRBW7MCBZTU7SNUSA",
|
|
924
|
+
tokenType: "TOKEN",
|
|
925
|
+
transactionGasFee: 100n,
|
|
926
|
+
transactionHash: "4fb2441210cbe87f5003abdfa86f03bafa54f789ed041feccbda0bd054297c4d"
|
|
927
|
+
}
|
|
928
|
+
]
|
|
929
|
+
},
|
|
930
|
+
// STARKNET
|
|
931
|
+
{
|
|
932
|
+
params: {
|
|
933
|
+
network: "STARKNET",
|
|
934
|
+
walletAddress: "0x309e6b209031362268d62d646a067365e6f6d6eb7f571b5212cbdfd5f26fe54",
|
|
935
|
+
contractAddress: ""
|
|
936
|
+
},
|
|
937
|
+
payload: "https://jiti.indexing.co/networks/starknet/1149460",
|
|
938
|
+
output: [
|
|
939
|
+
{
|
|
940
|
+
amount: 0x1c286f74458fc6n,
|
|
941
|
+
blockNumber: 1149460,
|
|
942
|
+
from: "0x309e6b209031362268d62d646a067365e6f6d6eb7f571b5212cbdfd5f26fe54",
|
|
943
|
+
timestamp: "2025-02-13T17:36:52.000Z",
|
|
944
|
+
to: "0x1176a1bd84444c89232ec27754698e5d2e7e1a7f1539f12027f28b23ec9f3d8",
|
|
945
|
+
token: null,
|
|
946
|
+
tokenType: "NATIVE",
|
|
947
|
+
transactionGasFee: 7925758505095110n,
|
|
948
|
+
transactionHash: "0x707203dba31f442ae9a5477e6a8906f3676effa0f1d3bb19cbbc14e1ddfe21"
|
|
949
|
+
}
|
|
950
|
+
]
|
|
951
|
+
},
|
|
952
|
+
//SUI
|
|
953
|
+
{
|
|
954
|
+
params: {
|
|
955
|
+
network: "SUI",
|
|
956
|
+
walletAddress: "0xfd0fb434d076e4cca300cf6534a5235b19ad184eedf49066726664ded42c6b5e",
|
|
957
|
+
contractAddress: ""
|
|
958
|
+
},
|
|
959
|
+
payload: "https://jiti.indexing.co/networks/sui/112336044",
|
|
960
|
+
output: [
|
|
961
|
+
{
|
|
962
|
+
blockNumber: 112336044,
|
|
963
|
+
from: "0xfd0fb434d076e4cca300cf6534a5235b19ad184eedf49066726664ded42c6b5e",
|
|
964
|
+
to: undefined,
|
|
965
|
+
amount: 180772n,
|
|
966
|
+
token: "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI",
|
|
967
|
+
tokenType: "NATIVE",
|
|
968
|
+
timestamp: "2025-02-13T23:10:54.529Z",
|
|
969
|
+
transactionHash: "336V3wP8cHDAnB1Aku3j6n9948i8FG5N1eVP6Ac68BaE",
|
|
970
|
+
transactionGasFee: -4165572n
|
|
971
|
+
}
|
|
972
|
+
]
|
|
973
|
+
},
|
|
974
|
+
// TON
|
|
975
|
+
{
|
|
976
|
+
params: {
|
|
977
|
+
network: "TON",
|
|
978
|
+
walletAddress: "EQAFukUyzmHjUvOYDOjNE-wbZFFl2FWas1rFJoh8IiTsWD40",
|
|
979
|
+
contractAddress: ""
|
|
980
|
+
},
|
|
981
|
+
payload: "https://jiti.indexing.co/networks/ton/44919328",
|
|
982
|
+
output: [
|
|
983
|
+
{
|
|
984
|
+
blockNumber: 44919328,
|
|
985
|
+
from: "EQAFukUyzmHjUvOYDOjNE-wbZFFl2FWas1rFJoh8IiTsWD40",
|
|
986
|
+
to: "EQCFTFAHOU3vFt2NiZhRD5dwuS0k7GS59vIg3WfCKwfaQGW2",
|
|
987
|
+
amount: 10000000n,
|
|
988
|
+
token: "TON",
|
|
989
|
+
tokenType: "NATIVE",
|
|
990
|
+
timestamp: "2025-02-13T23:10:18.000Z",
|
|
991
|
+
transactionHash: "Vh5cWr2uvCsdhoouBQ+EiUcF54os9oqvh8A/62EroQc=",
|
|
992
|
+
transactionGasFee: 2355233n
|
|
993
|
+
}
|
|
994
|
+
]
|
|
995
|
+
},
|
|
996
|
+
// COSMOS
|
|
997
|
+
{
|
|
998
|
+
params: {
|
|
999
|
+
network: "COSMOS",
|
|
1000
|
+
walletAddress: "cosmos1x4qvmtcfc02pklttfgxzdccxcsyzklrxavteyz",
|
|
1001
|
+
contractAddress: "ibc/F663521BF1836B00F5F177680F74BFB9A8B5654A694D0D2BC249E03CF2509013"
|
|
1002
|
+
},
|
|
1003
|
+
payload: "https://jiti.indexing.co/networks/cosmos/24419691",
|
|
1004
|
+
output: [
|
|
1005
|
+
{
|
|
1006
|
+
blockNumber: 24419691,
|
|
1007
|
+
from: "cosmos1x4qvmtcfc02pklttfgxzdccxcsyzklrxavteyz",
|
|
1008
|
+
to: "noble1x4qvmtcfc02pklttfgxzdccxcsyzklrx4073uv",
|
|
1009
|
+
amount: 500000n,
|
|
1010
|
+
token: "ibc/F663521BF1836B00F5F177680F74BFB9A8B5654A694D0D2BC249E03CF2509013",
|
|
1011
|
+
tokenType: "NATIVE",
|
|
1012
|
+
timestamp: "2025-02-14T21:48:22.809Z",
|
|
1013
|
+
transactionHash: "DF5FB086E60EE2ADA3A842751337E06A40696D7983CC1C038ADE236B36ED8AEB",
|
|
1014
|
+
transactionGasFee: 4860n
|
|
1015
|
+
}
|
|
1016
|
+
]
|
|
472
1017
|
}
|
|
473
1018
|
]
|
|
474
1019
|
};
|