-
Notifications
You must be signed in to change notification settings - Fork 513
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1051 from blocknative/release/06-08
Release 06-08 (main)
- Loading branch information
Showing
33 changed files
with
719 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
declare module '*.png' | ||
declare module 'window' | ||
declare module '@keystonehq/eth-keyring' | ||
declare module 'eth-dcent-keyring' | ||
declare module 'hdkey' | ||
declare const global: typeof globalThis & { window: CustomWindow } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { state } from './store' | ||
import { getBalance } from './provider' | ||
import { updateAllWallets } from './store/actions' | ||
|
||
async function updateBalances(addresses?: string[]): Promise<void> { | ||
const { wallets, chains } = state.get() | ||
|
||
const updatedWallets = await Promise.all( | ||
wallets.map(async wallet => { | ||
const chain = chains.find(({ id }) => id === wallet.chains[0].id) | ||
|
||
const updatedAccounts = await Promise.all( | ||
wallet.accounts.map(async account => { | ||
// if no provided addresses, we want to update all balances | ||
// otherwise check if address is in addresses array | ||
if (!addresses || addresses.includes(account.address)) { | ||
|
||
const updatedBalance = await getBalance(account.address, chain) | ||
|
||
return { ...account, balance: updatedBalance } | ||
} | ||
|
||
return account | ||
}) | ||
) | ||
return { ...wallet, accounts: updatedAccounts } | ||
}) | ||
) | ||
|
||
updateAllWallets(updatedWallets) | ||
} | ||
|
||
export default updateBalances |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# @web3-onboard/dcent | ||
|
||
## Wallet module for connecting D'CENT hardware wallets to web3-onboard | ||
|
||
### Install | ||
|
||
`npm i @web3-onboard/dcent` | ||
|
||
### Usage | ||
|
||
```typescript | ||
import Onboard from '@web3-onboard/core' | ||
import dcentModule from '@web3-onboard/dcent' | ||
|
||
const dcent = dcentModule() | ||
|
||
const onboard = Onboard({ | ||
// ... other Onboard options | ||
wallets: [ | ||
dcent | ||
//... other wallets | ||
] | ||
}) | ||
|
||
const connectedWallets = await onboard.connectWallet() | ||
console.log(connectedWallets) | ||
``` |
Oops, something went wrong.