diff --git a/modules/chronik-client/README.md b/modules/chronik-client/README.md --- a/modules/chronik-client/README.md +++ b/modules/chronik-client/README.md @@ -106,3 +106,4 @@ - 0.25.2 - Fix this package to work in the browser without requiring `Buffer` shim - 0.26.0 - Add `confirmedTxs` and `unconfirmedTxs` to `script` endpoint - 0.26.1 - If websocket takes longer than 5s to connect, try the next ws +- 0.26.2 - Return type `number` for `timeFirstSeen` from `chronik.token()` endpoint in `ChronikClientNode` diff --git a/modules/chronik-client/package-lock.json b/modules/chronik-client/package-lock.json --- a/modules/chronik-client/package-lock.json +++ b/modules/chronik-client/package-lock.json @@ -1,12 +1,12 @@ { "name": "chronik-client", - "version": "0.26.1", + "version": "0.26.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "chronik-client", - "version": "0.26.1", + "version": "0.26.2", "license": "MIT", "dependencies": { "@types/ws": "^8.2.1", diff --git a/modules/chronik-client/package.json b/modules/chronik-client/package.json --- a/modules/chronik-client/package.json +++ b/modules/chronik-client/package.json @@ -1,6 +1,6 @@ { "name": "chronik-client", - "version": "0.26.1", + "version": "0.26.2", "description": "A client for accessing the Chronik Indexer API", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/modules/chronik-client/src/ChronikClientNode.ts b/modules/chronik-client/src/ChronikClientNode.ts --- a/modules/chronik-client/src/ChronikClientNode.ts +++ b/modules/chronik-client/src/ChronikClientNode.ts @@ -955,7 +955,7 @@ const returnedTokenInfo: TokenInfo = { tokenId: tokenInfo.tokenId, tokenType, - timeFirstSeen: tokenInfo.timeFirstSeen, + timeFirstSeen: parseInt(tokenInfo.timeFirstSeen), genesisInfo: convertToGenesisInfo(tokenInfo.genesisInfo, tokenType), }; @@ -1476,7 +1476,7 @@ /** Block of the GENESIS tx, if it's mined already */ block?: BlockMetadata_InNode; /** Time the GENESIS tx has first been seen by the indexer */ - timeFirstSeen: string; + timeFirstSeen: number; } /** Genesis info found in GENESIS txs of tokens */ diff --git a/modules/chronik-client/test/integration/token_alp.ts b/modules/chronik-client/test/integration/token_alp.ts --- a/modules/chronik-client/test/integration/token_alp.ts +++ b/modules/chronik-client/test/integration/token_alp.ts @@ -191,7 +191,7 @@ const alpTokenInfo: TokenInfo = { tokenId: '1111111111111111111111111111111111111111111111111111111111111111', - timeFirstSeen: '1300000000', + timeFirstSeen: 1300000000, tokenType: { protocol: 'ALP', type: 'ALP_TOKEN_TYPE_STANDARD', diff --git a/modules/chronik-client/test/integration/token_slp_fungible.ts b/modules/chronik-client/test/integration/token_slp_fungible.ts --- a/modules/chronik-client/test/integration/token_slp_fungible.ts +++ b/modules/chronik-client/test/integration/token_slp_fungible.ts @@ -221,7 +221,7 @@ const slpGenesisMempoolInfo = await chronik.token(slpGenesisTxid); expect(slpGenesisMempoolInfo).to.deep.equal({ tokenId: slpGenesisTxid, - timeFirstSeen: '1300000000', + timeFirstSeen: 1300000000, tokenType: { protocol: 'SLP', type: 'SLP_TOKEN_TYPE_FUNGIBLE', diff --git a/modules/chronik-client/test/integration/token_slp_mint_vault.ts b/modules/chronik-client/test/integration/token_slp_mint_vault.ts --- a/modules/chronik-client/test/integration/token_slp_mint_vault.ts +++ b/modules/chronik-client/test/integration/token_slp_mint_vault.ts @@ -270,7 +270,7 @@ const slpGenesisMempoolInfo = await chronik.token(slpVaultGenesisTxid); expect(slpGenesisMempoolInfo).to.deep.equal({ tokenId: slpVaultGenesisTxid, - timeFirstSeen: '1300000000', + timeFirstSeen: 1300000000, tokenType: { protocol: 'SLP', type: 'SLP_TOKEN_TYPE_MINT_VAULT', diff --git a/modules/chronik-client/test/integration/token_slp_nft1.ts b/modules/chronik-client/test/integration/token_slp_nft1.ts --- a/modules/chronik-client/test/integration/token_slp_nft1.ts +++ b/modules/chronik-client/test/integration/token_slp_nft1.ts @@ -224,7 +224,7 @@ // We do not get data or authPubkey keys in GenesisInfo for non-ALP expect(slpGenesisMempoolInfo).to.deep.equal({ tokenId: slpGenesisTxid, - timeFirstSeen: '1300000000', + timeFirstSeen: 1300000000, tokenType: { protocol: 'SLP', type: 'SLP_TOKEN_TYPE_NFT1_GROUP', @@ -414,7 +414,7 @@ // We do not get mintVaultScripthash, data, or authPubkey keys in GenesisInfo for SLP NFT1 expect(slpChildGenesisMempoolInfo).to.deep.equal({ tokenId: slpChildGenesisTxid, - timeFirstSeen: '1300000000', + timeFirstSeen: 1300000000, tokenType: { protocol: 'SLP', type: 'SLP_TOKEN_TYPE_NFT1_CHILD',