@defichain/jellyfish-transaction
Advanced tools
Comparing version
@@ -75,3 +75,3 @@ import { BufferComposer, ComposableBuffer } from '@defichain/jellyfish-buffer'; | ||
domain: number; | ||
data?: number[]; | ||
data: Uint8Array; | ||
} | ||
@@ -78,0 +78,0 @@ /** |
@@ -79,17 +79,14 @@ "use strict"; | ||
fromBuffer: (buffer) => { | ||
const length = jellyfish_buffer_1.readCompactSize(buffer); | ||
const array = []; | ||
if (buffer.remaining() > 0) { | ||
for (let i = 0; i < length; i += 1) { | ||
array.push(buffer.readUInt8()); | ||
} | ||
tdi.data = array; | ||
tdi.data = new Uint8Array(array); | ||
}, | ||
toBuffer: (buffer) => { | ||
if (tdi.data !== undefined) { | ||
for (let i = 0; i < tdi.data.length; i += 1) { | ||
buffer.writeUInt8(tdi.data[i]); | ||
} | ||
jellyfish_buffer_1.writeCompactSize(tdi.data.length, buffer); | ||
for (let i = 0; i < tdi.data.length; i += 1) { | ||
buffer.writeUInt8(tdi.data[i]); | ||
} | ||
else { | ||
buffer.writeUInt8(0x00); | ||
} | ||
} | ||
@@ -96,0 +93,0 @@ } |
@@ -158,2 +158,6 @@ /// <reference types="node" /> | ||
OP_PUSHDATA_HEX_LE: (hex: string) => OP_PUSHDATA; | ||
/** | ||
* @param {string} hex in big endian | ||
*/ | ||
OP_PUSHDATA_HEX_BE: (hex: string) => OP_PUSHDATA; | ||
OP_1NEGATE: constants.OP_1NEGATE; | ||
@@ -160,0 +164,0 @@ OP_RESERVED: constants.OP_RESERVED; |
@@ -585,2 +585,8 @@ "use strict"; | ||
}, | ||
/** | ||
* @param {string} hex in big endian | ||
*/ | ||
OP_PUSHDATA_HEX_BE: (hex) => { | ||
return new data_1.OP_PUSHDATA(Buffer.from(hex, 'hex'), 'big'); | ||
}, | ||
// TODO: to map everything as class | ||
@@ -587,0 +593,0 @@ // to be separated into concerns, stack, arithmetic, crypto, etc... |
{ | ||
"private": false, | ||
"name": "@defichain/jellyfish-transaction", | ||
"version": "4.0.0-beta.11.1", | ||
"version": "4.0.0-beta.14", | ||
"description": "SDK & Ecosystem for building modern lite DeFi Applications at scale.", | ||
@@ -17,7 +17,7 @@ "repository": "BirthdayResearch/jellyfishsdk", | ||
"dependencies": { | ||
"@defichain/jellyfish-buffer": "4.0.0-beta.11.1", | ||
"@defichain/jellyfish-crypto": "4.0.0-beta.11.1" | ||
"@defichain/jellyfish-buffer": "4.0.0-beta.14", | ||
"@defichain/jellyfish-crypto": "4.0.0-beta.14" | ||
}, | ||
"peerDependencies": { | ||
"defichain": "^4.0.0-beta.11.1" | ||
"defichain": "^4.0.0-beta.14" | ||
}, | ||
@@ -24,0 +24,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
377512
0.13%6634
0.11%+ Added
+ Added
- Removed
- Removed