Skip to content

Commit

Permalink
XDR: fix contract ID and type rendering (#761)
Browse files Browse the repository at this point in the history
  • Loading branch information
quietbits authored Mar 4, 2024
1 parent 236753f commit bf9590d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/helpers/extrapolateFromXdr.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ export default function extrapolateFromXdr(input, type) {
return object.toString();
}

if (name === "contractId") {
if (name === "contractId" && object) {
return StrKey.encodeContract(object);
}

Expand All @@ -195,6 +195,10 @@ export default function extrapolateFromXdr(input, type) {
return JSON.stringify(object);
}

if (name === "type") {
return JSON.stringify(object);
}

if (object && object._isBuffer) {
return {
type: "code",
Expand Down

0 comments on commit bf9590d

Please sign in to comment.