Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Signtatures and feeMultiplier for transactions responses #312

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion packages/api/src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,15 @@ const decodeStateTransition = async (client, base64) => {
id: documentTransition.getId().toString(),
dataContractId: documentTransition.getDataContractId().toString(),
action: documentTransition.getAction(),
revision: documentTransition.getRevision()
revision: documentTransition.getRevision(),
signature: documentTransition.toObject()
}))

break
}
case StateTransitionEnum.IDENTITY_CREATE: {
decoded.identityId = stateTransition.getIdentityId().toString()
decoded.signature = stateTransition.getSignature()?.toString('hex') ?? null

break
}
Expand All @@ -56,6 +58,7 @@ const decodeStateTransition = async (client, base64) => {

decoded.identityId = stateTransition.getIdentityId().toString()
decoded.amount = output.satoshis * 1000
decoded.signature = stateTransition.getSignature()?.toString('hex') ?? null

break
}
Expand All @@ -76,6 +79,7 @@ const decodeStateTransition = async (client, base64) => {
decoded.senderId = stateTransition.getIdentityId().toString()
decoded.recipientId = stateTransition.getRecipientId().toString()
decoded.amount = stateTransition.getAmount()
decoded.signature = stateTransition.getSignature()?.toString('hex') ?? null

break
}
Expand All @@ -85,6 +89,7 @@ const decodeStateTransition = async (client, base64) => {
decoded.nonce = parseInt(stateTransition.getNonce())
decoded.outputScript = stateTransition.getOutputScript()?.toString('hex') ?? null
decoded.coreFeePerByte = stateTransition.getCoreFeePerByte()
decoded.signature = stateTransition.getSignature()?.toString('hex') ?? null

break
}
Expand All @@ -93,6 +98,8 @@ const decodeStateTransition = async (client, base64) => {
decoded.contractId = stateTransition.getContestedDocumentResourceVotePoll().contractId.toString()
decoded.modifiedDataIds = stateTransition.getModifiedDataIds().map(identifier => identifier.toString())
decoded.ownerId = stateTransition.getOwnerId().toString()
decoded.signature = stateTransition.getSignature()?.toString('hex') ?? null
decoded.feeMultiplier = stateTransition.getFeeMultiplier()

break
}
Expand Down
Loading