Skip to content

Commit

Permalink
Merge pull request #102 from splunk/tokenIndex
Browse files Browse the repository at this point in the history
fix: 🐛 Distinguish token index from splunk index
  • Loading branch information
atoulme committed Dec 13, 2021
2 parents f7a2c76 + 1741444 commit 000b814
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 20 deletions.
3 changes: 2 additions & 1 deletion src/eth/responses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,15 @@ export interface BalanceBody {
export interface NftBody {
from: string;
to: string;
index: string;
tokenIndex: string;
rawTokenURI: string | undefined;
tokenURI: string | undefined;
errorTokenURI: any | undefined;
metadata: any;
contract: string;
blockHash: string;
blockNumber: number;
transactionHash: string;
retrievalTime: number | string;
}

Expand Down
6 changes: 4 additions & 2 deletions src/nftwatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ export class NFTWatcher implements ManagedResource {
outputMessages = await this.abortHandle.race(
Promise.all(
transfers.map(t =>
this.complementWithTokenInfo(t.from, t.to, t.tokenIndex, formattedBlock, blockTime)
this.complementWithTokenInfo(t.from, t.to, rawTx.hash, t.tokenIndex, formattedBlock, blockTime)
)
)
);
Expand All @@ -324,6 +324,7 @@ export class NFTWatcher implements ManagedResource {
async complementWithTokenInfo(
from: string,
to: string,
transactionHash: string,
index: string,
formattedBlock: FormattedBlock,
blockTime: number
Expand Down Expand Up @@ -372,7 +373,8 @@ export class NFTWatcher implements ManagedResource {
contract: this.config.contractAddress,
blockHash: formattedBlock.hash!,
blockNumber: formattedBlock.number!,
index: index,
transactionHash: transactionHash,
tokenIndex: index,
rawTokenURI: rawTokenURI,
errorTokenURI: errorTokenURI,
tokenURI: decoded,
Expand Down

0 comments on commit 000b814

Please sign in to comment.