Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
price,
amount,
timestamp: t,
expiration: expiration || t + 29 * 24 * 60 * 60 * 1000,
matcherFee: matcherFee || 300000,
matcherPublicKey,
senderPublicKey,
proofs,
id: '',
}
if (ord.version === 3) {
ord.matcherFeeAssetId = paramsOrOrder.matcherFeeAssetId === 'WAVES' ? null : paramsOrOrder.matcherFeeAssetId
}
const bytes = binary.serializeOrder(ord)
seedsAndIndexes.forEach(([s, i]) => addProof(ord, signBytes(s, bytes), i))
validate.order(ord)
ord.id = base58Encode(blake2b(bytes))
// OrderV1 uses signature instead of proofs
if (ord.version === undefined || ord.version === 1) (ord as any).signature = ord.proofs && ord.proofs[0]
return ord
}
export function serialize(obj: TTx | TOrder): Uint8Array {
if (isOrder(obj)) return binary.serializeOrder(obj)
return binary.serializeTx(obj)
}