-
Notifications
You must be signed in to change notification settings - Fork 530
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 #30 from blocknative/develop
Release 0.2.1
- Loading branch information
Showing
10 changed files
with
437 additions
and
31 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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<style> | ||
.bn-onboard-loading { | ||
display: inline-block; | ||
position: relative; | ||
width: 2rem; | ||
height: 2rem; | ||
} | ||
.bn-onboard-loading div { | ||
box-sizing: border-box; | ||
display: block; | ||
position: absolute; | ||
width: 2rem; | ||
height: 2rem; | ||
border: 3px solid #4a90e2; | ||
border-radius: 50%; | ||
animation: bn-onboard-loading 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite; | ||
border-color: #4a90e2 transparent transparent transparent; | ||
} | ||
.bn-onboard-loading div:nth-child(1) { | ||
animation-delay: -0.45s; | ||
} | ||
.bn-onboard-loading div:nth-child(2) { | ||
animation-delay: -0.3s; | ||
} | ||
.bn-onboard-loading div:nth-child(3) { | ||
animation-delay: -0.15s; | ||
} | ||
@keyframes bn-onboard-loading { | ||
0% { | ||
transform: rotate(0deg); | ||
} | ||
100% { | ||
transform: rotate(360deg); | ||
} | ||
} | ||
</style> | ||
|
||
<div class="bn-onboard-custom bn-onboard-loading"> | ||
<div /> | ||
<div /> | ||
<div /> | ||
<div /> | ||
</div> |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,60 @@ | ||
import Authereum from "authereum" | ||
import authereumIcon from "../wallet-icons/authereum.png" | ||
|
||
import { networkName } from "../../../utilities" | ||
|
||
function authereum(options) { | ||
if (!options || typeof options !== "object") { | ||
throw new Error( | ||
"An options object is required to initialize fortmatic module" | ||
) | ||
} | ||
|
||
const { networkId } = options | ||
|
||
if (!networkId || typeof networkId !== "number") { | ||
throw new Error( | ||
"A networkId of type number is required to initialize fortmatic module" | ||
) | ||
} | ||
|
||
return { | ||
name: "Authereum", | ||
iconSrc: authereumIcon, | ||
wallet: () => { | ||
const authereum = new Authereum({ | ||
networkName: networkName(networkId), | ||
disableNotifications: true | ||
}) | ||
|
||
const provider = authereum.getProvider() | ||
|
||
return { | ||
provider, | ||
interface: { | ||
name: "Authereum", | ||
connect: () => provider.enable(), | ||
disconnect: () => authereum.logout(), | ||
loading: () => | ||
new Promise(resolve => { | ||
authereum.on("openPopup", resolve) | ||
}), | ||
address: { | ||
get: () => authereum.getAccountAddress() | ||
}, | ||
network: { | ||
get: () => Promise.resolve(networkId) | ||
}, | ||
balance: { | ||
get: async () => { | ||
const loggedIn = await authereum.isAuthenticated() | ||
return loggedIn && authereum.getBalance() | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
export default authereum |
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
Oops, something went wrong.