Skip to content

Commit 4a37ba4

Browse files
authored
Merge pull request #3 from midl-xyz/feat/replace-buffer-with-uint8array
feat: replace buffer with uint8array
2 parents 78ba351 + c4b1cc5 commit 4a37ba4

File tree

13 files changed

+321
-326
lines changed

13 files changed

+321
-326
lines changed

README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,11 @@ async function etching() {
9898

9999
const ins = new EtchInscription()
100100

101-
ins.setContent("text/plain", Buffer.from('scrypt is best', 'utf-8'))
101+
ins.setContent("text/plain", utf8ToBytes('scrypt is best'))
102102
ins.setRune(name)
103103

104-
const etching_script_asm = `${toXOnly(keyPair.publicKey).toString(
105-
"hex"
106-
)} OP_CHECKSIG`;
107-
const etching_script = Buffer.concat([script.fromASM(etching_script_asm), ins.encipher()]);
104+
const etching_script_asm = `${bytesToHex(toXOnly(keyPair.publicKey))} OP_CHECKSIG`;
105+
const etching_script = concatBytes(script.fromASM(etching_script_asm), ins.encipher());
108106

109107
const scriptTree: Taptree = {
110108
output: etching_script,

package-lock.json

Lines changed: 82 additions & 151 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)