Skip to content

Commit

Permalink
refac: add buffer module instead of Nodejs buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
emjshrx authored and theanmolsharma committed Oct 2, 2023
1 parent b13262a commit 72161be
Show file tree
Hide file tree
Showing 8 changed files with 69 additions and 0 deletions.
62 changes: 62 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
},
"dependencies": {
"bech32": "^2.0.0",
"buffer": "^6.0.3",
"create-hash": "^1.2.0",
"secp256k1": "^5.0.0"
},
Expand Down
1 change: 1 addition & 0 deletions src/encoding.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
decodeSilentPaymentAddress,
encodeSilentPaymentAddress,
} from './encoding';
import { Buffer } from 'buffer';

describe('Encoding', () => {
describe.each([
Expand Down
1 change: 1 addition & 0 deletions src/encoding.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { bech32m } from 'bech32';
import secp256k1 from 'secp256k1';
import { Buffer } from 'buffer';

export const encodeSilentPaymentAddress = (
scanKey: Uint8Array,
Expand Down
1 change: 1 addition & 0 deletions src/outputs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
import { decodeSilentPaymentAddress } from './encoding.ts';
import secp256k1 from 'secp256k1';
import createHash from 'create-hash';
import { Buffer } from 'buffer';

export const createOutputs = (
inputPrivateKeys: PrivateKey[],
Expand Down
1 change: 1 addition & 0 deletions src/scanning.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { scanOutputs } from './scanning';
import { LabelMap } from './interface';
import { Buffer } from 'buffer';

describe('Scanning', () => {
it.each([
Expand Down
1 change: 1 addition & 0 deletions src/scanning.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { serialiseUint32 } from './utility.ts';
import { LabelMap } from './interface.ts';
import secp256k1 from 'secp256k1';
import createHash from 'create-hash';
import { Buffer } from 'buffer';

// Handle additional label-related logic
const handleLabels = (
Expand Down
1 change: 1 addition & 0 deletions src/utility.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Outpoint, PrivateKey } from './interface';
import secp256k1 from 'secp256k1';
import createHash from 'create-hash';
import { Buffer } from 'buffer';

export const hashOutpoints = (outpoints: Outpoint[]): Buffer => {
const outpointBuffer = Buffer.concat(
Expand Down

0 comments on commit 72161be

Please sign in to comment.