@unielon/coin-dogecoin
Advanced tools
Comparing version 1.0.22 to 1.0.23
@@ -266,47 +266,46 @@ "use strict"; | ||
imageDatas.push(Buffer.from("")); | ||
if (inscriptionData.file.length > 1350) { | ||
let body = inscriptionData.file; | ||
let index = 0; | ||
let bodyLength = body.length; | ||
while (bodyLength > 0) { | ||
let bodyPart = body.slice(index, index + 1350); | ||
let inscriptionBuilder = []; | ||
inscriptionBuilder.push(ops.OP_1); | ||
inscriptionBuilder.push(pubKey); | ||
inscriptionBuilder.push(ops.OP_1); | ||
inscriptionBuilder.push(ops.OP_CHECKMULTISIGVERIFY); | ||
let dropNum = Math.floor(bodyPart.length / 450) + 1; | ||
if (bodyPart.length % 450 === 0) { | ||
dropNum--; | ||
console.log(inscriptionData.file.length, 'inscriptionData.file.length'); | ||
let body = inscriptionData.file; | ||
let index = 0; | ||
let bodyLength = body.length; | ||
while (bodyLength > 0) { | ||
let bodyPart = body.slice(index, index + 1350); | ||
let inscriptionBuilder = []; | ||
inscriptionBuilder.push(ops.OP_1); | ||
inscriptionBuilder.push(pubKey); | ||
inscriptionBuilder.push(ops.OP_1); | ||
inscriptionBuilder.push(ops.OP_CHECKMULTISIGVERIFY); | ||
let dropNum = Math.floor(bodyPart.length / 450) + 1; | ||
if (bodyPart.length % 450 === 0) { | ||
dropNum--; | ||
} | ||
if (bodyPart.length > 450) { | ||
inscriptionBuilder.push(Buffer.from(bodyPart.slice(0, 450))); | ||
} | ||
else { | ||
dropNum = 1; | ||
inscriptionBuilder.push(Buffer.from(bodyPart)); | ||
} | ||
for (let k = 0; k < dropNum; k++) { | ||
inscriptionBuilder.push(ops.OP_DROP); | ||
} | ||
const inscriptionScript = bitcoin.script.compile(inscriptionBuilder); | ||
const { output, hash, address } = bitcoin.payments.p2sh({ | ||
redeem: { | ||
output: inscriptionScript, | ||
redeemVersion: 0xc0, | ||
network: network | ||
} | ||
if (bodyPart.length > 450) { | ||
inscriptionBuilder.push(Buffer.from(bodyPart.slice(0, 450))); | ||
} | ||
else { | ||
dropNum = 1; | ||
inscriptionBuilder.push(Buffer.from(bodyPart)); | ||
} | ||
for (let k = 0; k < dropNum; k++) { | ||
inscriptionBuilder.push(ops.OP_DROP); | ||
} | ||
const inscriptionScript = bitcoin.script.compile(inscriptionBuilder); | ||
const { output, hash, address } = bitcoin.payments.p2sh({ | ||
redeem: { | ||
output: inscriptionScript, | ||
redeemVersion: 0xc0, | ||
network: network | ||
} | ||
}); | ||
addresss.push(typeof address === "string" ? address : ""); | ||
if (output) { | ||
pks.push(output); | ||
} | ||
inscriptionScripts.push(inscriptionScript); | ||
if (hash) { | ||
hashs.push(hash); | ||
} | ||
imageDatas.push(Buffer.from(bodyPart)); | ||
index += 1350; | ||
bodyLength -= 1350; | ||
}); | ||
addresss.push(typeof address === "string" ? address : ""); | ||
if (output) { | ||
pks.push(output); | ||
} | ||
inscriptionScripts.push(inscriptionScript); | ||
if (hash) { | ||
hashs.push(hash); | ||
} | ||
imageDatas.push(Buffer.from(bodyPart)); | ||
index += 1350; | ||
bodyLength -= 1350; | ||
} | ||
@@ -313,0 +312,0 @@ return { |
{ | ||
"name": "@unielon/coin-dogecoin", | ||
"version": "1.0.22", | ||
"version": "1.0.23", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
Sorry, the diff of this file is not supported yet
943041
13040