Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
perekopskiy committed Nov 8, 2021
1 parent d343793 commit ffe609d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
15 changes: 15 additions & 0 deletions infrastructure/api-docs/blueprint/groups/tokens.apib
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,18 @@ Get NFT owner ID
+ status: success (string, required)
+ result (number, required{{isResultNullable}})
+ error (Error, required, nullable)

## api/v0.2/tokens/nft_id_by_tx_hash/:tx_hash [/tokens/nft_id_by_tx_hash/{tx_hash}]

+ Parameters
+ tx_hash (required, string, `{{mintNFTTxHash}}`) ... The hash of the MintNFT transaction

### Get NFT ID by the MintNFT transaction hash [GET]
Get NFT ID by the MintNFT transaction hash

+ Response 200 (application/json)
+ Attributes
+ request (Request, required)
+ status: success (string, required)
+ result (number, required{{isResultNullable}})
+ error (Error, required, nullable)
5 changes: 4 additions & 1 deletion infrastructure/api-docs/src/compile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ interface Parameters {
toggle2FASignature: string;
toggle2FATimestamp: number;
toggle2FAPubKeyHash: string;
mintNFTTxHash: string;
}

async function getHashesAndSignatures() {
Expand Down Expand Up @@ -127,6 +128,7 @@ async function getHashesAndSignatures() {
contentHash: ethers.utils.randomBytes(32),
feeToken: 'ETH'
});
const mintNFTTxHash = mintHandle.txHash;
await mintHandle.awaitVerifyReceipt();
const state = await syncWallet.getAccountState();
const nftId = Object.values(state.verified.nfts)[0].id;
Expand All @@ -147,7 +149,8 @@ async function getHashesAndSignatures() {
nftId,
toggle2FASignature,
toggle2FATimestamp,
toggle2FAPubKeyHash
toggle2FAPubKeyHash,
mintNFTTxHash
};
return result;
}
Expand Down

0 comments on commit ffe609d

Please sign in to comment.