Skip to content

Commit

Permalink
merge feature 1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dsundeep committed Oct 4, 2024
2 parents 9730eec + 50598b1 commit 395dff7
Show file tree
Hide file tree
Showing 8 changed files with 181 additions and 261 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules
node_modules
coverage
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# crypto-qr-code

[![crypto-qr-code](https://img.shields.io/badge/version-1.0.1-blue.svg)](https://www.npmjs.com/package/crypto-qr-code)
[![crypto-qr-code](https://img.shields.io/badge/version-1.1.0-blue.svg)](https://www.npmjs.com/package/crypto-qr-code)
[![License](https://img.shields.io/badge/license-MIT-brightgreen.svg)](LICENSE)

**crypto-qr-code** is a library for generating QR codes for cryptocurrency wallet addresses, supporting Bitcoin (BTC) and Ethereum (ETH). It provides options for customizing the QR code's format and currency type.
Expand Down Expand Up @@ -43,6 +43,12 @@ The `generateQRCode` method accepts two parameters:
- **currency**: The type of cryptocurrency (default: `BTC`). Options are `BTC` for Bitcoin and `ETH` for Ethereum.
- **format**: The desired image format for the QR code (default: `image/png`). Options are `image/png`, `image/jpeg`, and `image/svg+xml`.

## Error Scenarios
1. **Empty Wallet Address**: The wallet address is a required parameter.
2. **Invalid Currency**: At present, we support only BTC and ETH.
3. **Invalid Wallet Address**: If the provided address is not according to the standards, an error will be thrown.
4. **QR Code Generation Error**: If there is problem generating the QR code, an error will be thrown.

## Examples

- Here’s a full example of generating a QR code for a Bitcoin address:
Expand Down
20 changes: 20 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
collectCoverage: true,
collectCoverageFrom: [
'src/**/*.{ts,tsx}',
'!src/**/*.d.ts',
],
coverageDirectory: 'coverage',
coverageReporters: ['text', 'lcov'],
coverageThreshold: {
global: {
lines: 80,
branches: 80,
functions: 80,
statements: 80,
},
},
};

Loading

0 comments on commit 395dff7

Please sign in to comment.