Skip to content

Commit

Permalink
Add usage guide
Browse files Browse the repository at this point in the history
  • Loading branch information
danfinlay committed May 26, 2017
1 parent 0cadbf8 commit a31e457
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,24 @@ All address keys follow the [EIP 55 address checksum format](https://github.com/

Submit PRs to add valid logos, and obviously valid logos will be merged.

## Usage

You can install from npm with `npm install ethereum-contract-icons` and use it in your code like this:

```javascript
const iconMap = require('ethereum-contract-icons')
const toChecksumAddress = require('ethereumjs-util').toChecksumAddress

function imageElFor (address) {
const fileName = iconMap[toChecksumAddress(address)]
const path = `images/contract/${fileName}`
const img = document.createElement('img')
img.src = path
img.style.width = '100%'
return img
}
```

## Submission Process

1. Fork this repository.
Expand Down

0 comments on commit a31e457

Please sign in to comment.