Skip to content

Commit

Permalink
feat: update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
mahnunchik committed Jun 2, 2023
1 parent 23fda29 commit 484b366
Show file tree
Hide file tree
Showing 19 changed files with 310 additions and 1,681 deletions.
20 changes: 12 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,33 @@
name: Node.js CI

on:
push:
on: push

jobs:
test:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
matrix:
node-version: [16, 18]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: 16
node-version: ${{ matrix.node-version }}
registry-url: https://npm.pkg.github.com/
- run: npm ci
- run: npm run lint
- run: npm test
- run: npm run test

publish:
needs: test
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm publish
Expand Down
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.github
.editorconfig
test
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.15.0
18.16.0
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 Coin Crypto Wallet
Copyright (c) 2023 Coin Crypto Wallet

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
10 changes: 5 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ export { default as cryptoUtil } from './lib/crypto-util.js';
export { default as ringct } from './lib/ringct.js';
export { default as tx } from './lib/tx.js';
export { default as helpers } from './lib/helpers.js';
export { default as Wallet } from './lib/wallet.js';
export { default as Address } from './lib/address.js';
export { default as Wallet } from './lib/Wallet.js';
export { default as Address } from './lib/Address.js';

import Address from './lib/Address.js';
import Wallet from './lib/Wallet.js';
import cryptoUtil from './lib/crypto-util.js';
import helpers from './lib/helpers.js';
import ringct from './lib/ringct.js';
import tx from './lib/tx.js';
import helpers from './lib/helpers.js';
import Wallet from './lib/wallet.js';
import Address from './lib/address.js';

export default {
cryptoUtil,
Expand Down
3 changes: 2 additions & 1 deletion lib/address.js → lib/Address.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Buffer } from 'buffer';
import base58 from 'base58-monero';
import { getConfig } from './config.js';
import { fastHash } from './crypto-util.js';
import { getConfig } from './config.js';
import { isBuffer32, isBuffer8 } from './helpers.js';

export default class Address {
Expand Down
21 changes: 11 additions & 10 deletions lib/wallet.js → lib/Wallet.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
import {
fastHash,
generateKeys,
hashToScalar,
secretKeyToPublicKey,
} from './crypto-util.js';
import Address from './Address.js';
import { Buffer } from 'buffer';
import { ec } from './crypto-util-data.js';
import { getConfig } from './config.js';
import {
decodeInt,
encodeInt,
encodeUint32,
decodePoint,
encodeInt,
encodePoint,
encodeUint32,
isBuffer32,
} from './helpers.js';
import Address from './address.js';
import { getConfig } from './config.js';
import {
fastHash,
generateKeys,
hashToScalar,
secretKeyToPublicKey,
} from './crypto-util.js';

export default class Wallet {
#config;
Expand Down
1 change: 1 addition & 0 deletions lib/config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Buffer } from 'buffer';
/**
* https://github.com/monero-project/monero/blob/v0.17.1.9/src/cryptonote_config.h
*/
Expand Down
13 changes: 7 additions & 6 deletions lib/crypto-util.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,26 @@
* https://github.com/monero-project/monero/blob/v0.17.1.9/src/crypto/crypto.cpp
* https://github.com/monero-project/monero/blob/v0.17.1.9/src/crypto/crypto-ops.c
*/
import crypto from 'crypto';
import BN from 'bn.js';
import { Buffer } from 'buffer';
import Debug from 'debug';
import keccak from 'keccak';
import randombytes from 'randombytes';
import varint from 'varint';
import Debug from 'debug';
import {
ec,
A,
sqrtm1,
ec,
fffb1,
fffb2,
fffb3,
fffb4,
sqrtm1,
} from './crypto-util-data.js';
import {
decodeInt,
decodePoint,
decodeScalar,
encodeInt,
decodePoint,
encodePoint,
squareRoot,
} from './helpers.js';
Expand All @@ -31,7 +32,7 @@ const debug = Debug('monerolib:crypto-util');

// TODO remove when jest.mockModule will be implemented
// https://github.com/facebook/jest/issues/10025
let { randomBytes } = crypto;
let randomBytes = randombytes;
export function __mockRandomBytes__(mock) {
randomBytes = mock;
}
Expand Down
3 changes: 2 additions & 1 deletion lib/helpers.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import BN from 'bn.js';
import { Buffer } from 'buffer';
import varint from 'varint';
import {
MAX_UINT_32,
ec,
sqrtm1,
MAX_UINT_32,
} from './crypto-util-data.js';

/**
Expand Down
13 changes: 7 additions & 6 deletions lib/ringct.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import {
fastHash,
hashToScalar,
derivationToScalar,
} from './crypto-util.js';
import { Buffer } from 'buffer';
import { ec } from './crypto-util-data.js';
import {
decodeInt,
decodePoint,
encodeInt,
encodePoint,
} from './helpers.js';
import { ec } from './crypto-util-data.js';
import {
derivationToScalar,
fastHash,
hashToScalar,
} from './crypto-util.js';

import BN from 'bn.js';

Expand Down
5 changes: 3 additions & 2 deletions lib/tx.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import BN from 'bn.js';
import { fastHash } from './crypto-util.js';
import { decodeVarint } from './helpers.js';
import { Buffer } from 'buffer';
import { RCTTypes } from './ringct.js';
import { decodeVarint } from './helpers.js';
import { fastHash } from './crypto-util.js';

export function getTxIdFromHex(hex) {
const buf = Buffer.from(hex, 'hex');
Expand Down
Loading

0 comments on commit 484b366

Please sign in to comment.