Skip to content

Commit

Permalink
fix: offload bn.js dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
ahsan-javaid authored and janniks committed May 17, 2022
1 parent 8b41449 commit 91b511b
Show file tree
Hide file tree
Showing 28 changed files with 845 additions and 555 deletions.
82 changes: 45 additions & 37 deletions package-lock.json

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

4 changes: 1 addition & 3 deletions packages/bns/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@
"dependencies": {
"@stacks/common": "^4.0.1",
"@stacks/network": "^4.0.1",
"@stacks/transactions": "^4.0.0",
"@types/bn.js": "^4.11.6",
"bn.js": "^5.2.0"
"@stacks/transactions": "^4.0.0"
},
"devDependencies": {
"@types/jest": "^26.0.22",
Expand Down
4 changes: 1 addition & 3 deletions packages/bns/src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { Buffer } from '@stacks/common';
import { bufferCV, uintCV, hash160 } from '@stacks/transactions';

import BN from 'bn.js';

export function decodeFQN(fqdn: string): {
name: string;
namespace: string;
Expand Down Expand Up @@ -30,6 +28,6 @@ export function decodeFQN(fqdn: string): {

export const bufferCVFromString = (string: string) => bufferCV(Buffer.from(string));

export const uintCVFromBN = (int: BN) => uintCV(int.toString(10));
export const uintCVFromBN = (int: bigint) => uintCV(int.toString(10));

export const getZonefileHash = (zonefile: string) => hash160(Buffer.from(zonefile));

0 comments on commit 91b511b

Please sign in to comment.