diff --git a/src/api/v1/types.ts b/src/api/v1/types.ts index 9e18a8e..9d99d2f 100644 --- a/src/api/v1/types.ts +++ b/src/api/v1/types.ts @@ -235,7 +235,7 @@ export class TrxVariant implements ABISerializableObject { if (this.extra.packed_trx) { switch (this.extra.compression) { case 'zlib': { - const inflated = pako.inflate(Buffer.from(this.extra.packed_trx, 'hex')) + const inflated = pako.inflate(Bytes.from(this.extra.packed_trx, 'hex').array) return Serializer.decode({data: inflated, type: Transaction}) } case 'none': { diff --git a/src/chain/transaction.ts b/src/chain/transaction.ts index 9eb7001..1219377 100644 --- a/src/chain/transaction.ts +++ b/src/chain/transaction.ts @@ -241,8 +241,8 @@ export class PackedTransaction extends Struct { switch (compression) { case CompressionType.zlib: { // compress data - packed_trx = pako.deflate(Buffer.from(packed_trx.array)) - packed_context_free_data = pako.deflate(Buffer.from(packed_context_free_data.array)) + packed_trx = pako.deflate(packed_trx.array) + packed_context_free_data = pako.deflate(packed_context_free_data.array) break } case CompressionType.none: { @@ -265,7 +265,7 @@ export class PackedTransaction extends Struct { } // zlib compressed case CompressionType.zlib: { - const inflated = pako.inflate(Buffer.from(this.packed_trx.array)) + const inflated = pako.inflate(this.packed_trx.array) return abiDecode({data: inflated, type: Transaction}) } default: {