Skip to content

Commit 2f38c50

Browse files
authored
Feature v2 - Tokenary wallet (#837)
* Add tokenary wallet
1 parent a4abc36 commit 2f38c50

File tree

3 files changed

+33
-3
lines changed

3 files changed

+33
-3
lines changed

packages/common/src/types.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,8 @@ export enum ProviderIdentityFlag {
482482
TP = 'isTp',
483483
WalletIo = 'isWalletIO',
484484
XDEFI = 'isXDEFI',
485-
OneInch = 'isOneInchIOSWallet'
485+
OneInch = 'isOneInchIOSWallet',
486+
Tokenary = 'isTokenary'
486487
}
487488

488489
export enum ProviderLabel {
@@ -511,7 +512,8 @@ export enum ProviderLabel {
511512
TP = 'TP Wallet',
512513
WalletIo = 'Wallet.io',
513514
XDEFI = 'XDEFI Wallet',
514-
OneInch = '1inch Wallet'
515+
OneInch = '1inch Wallet',
516+
Tokenary = 'Tokenary Wallet'
515517
}
516518

517519
export enum ProviderRpcErrorCode {
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
export default `
2+
<?xml version="1.0" standalone="no"?>
3+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
4+
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
5+
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
6+
width="256.000000pt" height="256.000000pt" viewBox="0 0 256.000000 256.000000"
7+
preserveAspectRatio="xMidYMid meet">
8+
<g transform="translate(0.000000,256.000000) scale(0.100000,-0.100000)"
9+
fill="#2C7CF5" stroke="none">
10+
<path d="M1120 1915 c-211 -57 -380 -213 -458 -423 -33 -90 -42 -266 -18 -362
11+
54 -216 210 -388 424 -468 90 -33 266 -42 362 -18 216 54 388 210 468 424 33
12+
90 42 266 18 362 -54 216 -210 388 -424 468 -85 32 -283 41 -372 17z"/>
13+
</g>
14+
</svg>
15+
`

packages/injected/src/wallets.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,18 @@ const oneInch: InjectedWalletModule = {
436436
platforms: ['mobile']
437437
}
438438

439+
const tokenary: InjectedWalletModule = {
440+
label: ProviderLabel.Tokenary,
441+
injectedNamespace: InjectedNameSpace.Ethereum,
442+
checkProviderIdentity: ({ provider }) =>
443+
!!provider && !!provider[ProviderIdentityFlag.Tokenary],
444+
getIcon: async () => (await import('./icons/tokenary.js')).default,
445+
getInterface: async () => ({
446+
provider: createEIP1193Provider(window.ethereum)
447+
}),
448+
platforms: ['mobile']
449+
}
450+
439451
const wallets = [
440452
metamask,
441453
binance,
@@ -461,7 +473,8 @@ const wallets = [
461473
tokenpocket,
462474
tp,
463475
xdefi,
464-
oneInch
476+
oneInch,
477+
tokenary
465478
]
466479

467480
export default wallets

0 commit comments

Comments
 (0)