Skip to content

Commit

Permalink
v2.1.0: adding networkId
Browse files Browse the repository at this point in the history
  • Loading branch information
10xSebastian committed Jul 25, 2021
1 parent e4c4d0c commit f1f2748
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 12 deletions.
23 changes: 12 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ import { Blockchain } from 'depay-web3-blockchains'

Blockchain.all
// [
// { name: 'ethereum', id: '0x01', label: 'Ethereum', logo: '...' },
// { name: 'ethereum', id: '0x1', label: 'Ethereum', logo: '...' },
// { name: 'bsc', id: '0x38', label: 'Binance Smart Chain', logo: '...' },
// ...
// ]

Blockchain.findById('0x01')
// { name: 'ethereum', id: '0x01', label: 'Ethereum', logo: '...' }
Blockchain.findById('0x1')
// { name: 'ethereum', id: '0x1', label: 'Ethereum', logo: '...' }

Blockchain.findByName('ethereum')
// { name: 'ethereum', id: '0x01', label: 'Ethereum', logo: '...' }
// { name: 'ethereum', id: '0x1', label: 'Ethereum', logo: '...' }
```

## Support
Expand All @@ -43,6 +43,7 @@ Blockchain data is provided in the following structure:
{
name: String,
id: String,
networkId: String,
label: String,
logo: String (base64 encoded PNG)
}
Expand All @@ -57,8 +58,8 @@ import { Blockchain } from 'depay-web3-blockchains'

Blockchain.all
// [
// { name: 'ethereum', id: '0x01', label: 'Ethereum', logo: '...' },
// { name: 'bsc', id: '0x38', label: 'Binance Smart Chain', logo: '...' },
// { name: 'ethereum', id: '0x1', networkId: '1', label: 'Ethereum', logo: '...' },
// { name: 'bsc', id: '0x38', networkId: '56', label: 'Binance Smart Chain', logo: '...' },
// ...
// ]

Expand All @@ -69,11 +70,11 @@ Blockchain.all
```javascript
import { Blockchain } from 'depay-web3-blockchains'

Blockchain.findById('0x01')
// { name: 'ethereum', id: '0x01', label: 'Ethereum', logo: '...' }
Blockchain.findById('0x1')
// { name: 'ethereum', id: '0x1', networkId: '1', label: 'Ethereum', logo: '...' }

Blockchain.findById('0x38')
// { name: 'bsc', id: '0x38', label: 'Binance Smart Chain', logo: '...' }
// { name: 'bsc', id: '0x38', networkId: '56', label: 'Binance Smart Chain', logo: '...' }
```

### findByName: Get blockchain by blockchain name
Expand All @@ -82,10 +83,10 @@ Blockchain.findById('0x38')
import { Blockchain } from 'depay-web3-blockchains'

Blockchain.findByName('ethereum')
// { name: 'ethereum', id: '0x01', label: 'Ethereum', logo: '...' }
// { name: 'ethereum', id: '0x1', networkId: '1', label: 'Ethereum', logo: '...' }

Blockchain.findByName('bsc')
// { name: 'bsc', id: '0x38', label: 'Binance Smart Chain', logo: '...' }
// { name: 'bsc', id: '0x38', networkId: '56', label: 'Binance Smart Chain', logo: '...' }
```

## Development
Expand Down
3 changes: 3 additions & 0 deletions dist/cjs/index.js

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

Loading

0 comments on commit f1f2748

Please sign in to comment.