Skip to content

Is possible to verify file without providing metal_id #33

Answered by hanatyan128
4RSIM3R asked this question in Q&A
Discussion options

You must be logged in to vote

I apologize for my long absence.

You can verify foreged metal without metal_id .
Instead, use source account, target account, target ID (mosaic / namespace only) and file.
Because the metal_id is calculated from the infomation above.

Example code here

// Calculate metadata key (If metadata key is known, you can omit this)
const metadataKey = await MetalService.calculateMetadataKey(fileData);

// Verify on-chain data (`targetId` is `undefined` when the metal was forged to account)
const { mismatches } = await metalService.verify(fileData, metadataType, sourceAddress, targetAddress, metadataKey , targetId)

assert(mismatches === 0);

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by hanatyan128
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants