Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/injected/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ export const WALLET_NAMES: { [key: string]: string } = {
detected: 'Detected Wallet',
meetone: 'MeetOne',
frame: 'Frame',
core: 'Core'
bitkeep: 'BitKeep',
}
4 changes: 4 additions & 0 deletions packages/injected/src/icons/core.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export default `<svg width="256" height="256" viewBox="0 0 256 256" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="256" height="256" rx="128" fill="black"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M87.6477 203.403C66.6922 203.403 47.0213 198.931 30 191.095L99.2514 127.885C89.6861 120.038 83.5836 108.126 83.5836 94.7884C83.5836 81.2079 89.9104 69.1052 99.7773 61.2668V52.0015H126.08C126.177 52.0008 126.274 52.0005 126.372 52.0005C137.068 52.0005 146.848 55.9254 154.349 62.4136C161.85 55.926 171.629 52.0015 182.325 52.0015H182.389L182.39 52L182.392 52.0015H208.919V61.2679C218.786 69.1062 225.113 81.209 225.113 94.7894C225.113 111.867 215.108 126.608 200.64 133.47C195.467 148.743 185.737 162.479 172.714 173.652V193.398H139.977C124.227 199.801 106.455 203.403 87.6477 203.403ZM126.371 127.703C134.16 127.703 141.317 124.998 146.954 120.475L154.282 136.976L161.645 120.397C167.296 124.967 174.491 127.703 182.325 127.703C200.502 127.703 215.238 112.967 215.238 94.7895C215.238 76.6117 200.502 61.8757 182.325 61.8757C170.513 61.8757 160.155 68.0975 154.348 77.4425C148.541 68.0975 138.183 61.8757 126.371 61.8757C108.193 61.8757 93.4575 76.6117 93.4575 94.7895C93.4575 112.967 108.193 127.703 126.371 127.703ZM126.371 117.829C139.096 117.829 149.411 107.514 149.411 94.7893C149.411 82.0648 139.096 71.7496 126.371 71.7496C113.647 71.7496 103.331 82.0648 103.331 94.7893C103.331 107.514 113.647 117.829 126.371 117.829ZM126.371 107.955C133.642 107.955 139.537 102.06 139.537 94.7893C139.537 87.5182 133.642 81.6238 126.371 81.6238C119.1 81.6238 113.206 87.5182 113.206 94.7893C113.206 102.06 119.1 107.955 126.371 107.955ZM205.364 94.7893C205.364 107.514 195.049 117.829 182.324 117.829C169.6 117.829 159.285 107.514 159.285 94.7893C159.285 82.0648 169.6 71.7496 182.324 71.7496C195.049 71.7496 205.364 82.0648 205.364 94.7893ZM195.49 94.7893C195.49 102.06 189.596 107.955 182.324 107.955C175.053 107.955 169.159 102.06 169.159 94.7893C169.159 87.5182 175.053 81.6238 182.324 81.6238C189.596 81.6238 195.49 87.5182 195.49 94.7893Z" fill="white"/>
</svg>`
4 changes: 4 additions & 0 deletions packages/injected/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export enum ProviderIdentityFlag {
Rabby = 'isRabby',
MathWallet = 'isMathWallet',
GameStop = 'isGamestop',
Core = 'isAvalanche'
BitKeep = 'isBitKeep'
}

Expand Down Expand Up @@ -80,6 +81,7 @@ export enum ProviderLabel {
Rabby = 'Rabby',
MathWallet = 'MathWallet',
GameStop = 'GameStop Wallet',
Core = 'Core'
BitKeep = 'BitKeep'
}

Expand Down Expand Up @@ -113,6 +115,8 @@ export interface CustomWindow extends Window {
xfi: {
ethereum: InjectedProvider
}
gamestop: InjectedProvider
avalanche: InjectedProvider
gamestop: InjectedProvider,
bitkeep: {
ethereum: InjectedProvider
Expand Down
13 changes: 13 additions & 0 deletions packages/injected/src/wallets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,18 @@ const gamestop: InjectedWalletModule = {
platforms: ['desktop']
}

const core: InjectedWalletModule = {
label: ProviderLabel.Core,
injectedNamespace: InjectedNameSpace.Ethereum,
checkProviderIdentity: ({ provider }) =>
!!provider && !!provider[ProviderIdentityFlag.Core],
getIcon: async () => (await import('./icons/core.js')).default,
getInterface: async () => ({
provider: createEIP1193Provider(window.avalanche)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@itsmnthn there will need to be more work done around this provider as it does not follow the 1193 standard
Upon approving a a site the provider doesnt send the proper response is one problem I see initially

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I faced the same problem it happens one time initially. But I think it will be fixed since they are still developing. But I'll ask devs about this and other issues I faced in terms of UX. Hope to get it fixed soon.

}),
// Core wallet is only tested in chrome or chromium browser
platforms: ['desktop', 'Chrome', 'Chromium', 'Microsoft Edge']

const bitkeep: InjectedWalletModule = {
label: ProviderLabel.BitKeep,
injectedNamespace: InjectedNameSpace.BitKeep,
Expand Down Expand Up @@ -551,6 +563,7 @@ const wallets = [
rabby,
mathwallet,
gamestop,
core
bitkeep
]

Expand Down