@tomo-inc/wallet-adaptor-base 0.0.11 → 0.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +39 -1669
- package/dist/index.d.cts +11 -141
- package/dist/index.d.ts +11 -141
- package/dist/index.js +39 -1599
- package/package.json +2 -2
- package/project.json +15 -0
- package/src/index.ts +3 -8
- package/src/type.ts +10 -0
- package/src/wallets/defaultConnectors.ts +12 -220
- package/src/wallets/index.ts +4 -142
- package/src/wallets/wallet-walletconnect.ts +16 -6
- package/src/wallets/default/abWallet/abWallet.ts +0 -19
- package/src/wallets/default/backpackWallet/backpackWallet.ts +0 -20
- package/src/wallets/default/berasigWallet/berasigWallet.ts +0 -19
- package/src/wallets/default/binanceWallet/binanceWallet.ts +0 -47
- package/src/wallets/default/bitgetWallet/bitgetWallet.ts +0 -37
- package/src/wallets/default/bitskiWallet/bitskiWallet.ts +0 -14
- package/src/wallets/default/bitverseWallet/bitverseWallet.ts +0 -17
- package/src/wallets/default/bloomWallet/bloomWallet.ts +0 -12
- package/src/wallets/default/braveWallet/braveWallet.ts +0 -17
- package/src/wallets/default/bybitWallet/bybitWallet.ts +0 -25
- package/src/wallets/default/clvWallet/clvWallet.ts +0 -18
- package/src/wallets/default/coin98Wallet/coin98Wallet.ts +0 -22
- package/src/wallets/default/coinbaseWallet/coinbaseWallet.ts +0 -29
- package/src/wallets/default/compassWallet/compassWallet.ts +0 -16
- package/src/wallets/default/coreWallet/coreWallet.ts +0 -21
- package/src/wallets/default/ctrlWallet/ctrlWallet.ts +0 -21
- package/src/wallets/default/dawnWallet/dawnWallet.ts +0 -13
- package/src/wallets/default/desigWallet/desigWallet.ts +0 -18
- package/src/wallets/default/enkryptWallet/enkryptWallet.ts +0 -21
- package/src/wallets/default/foxWallet/foxWallet.ts +0 -21
- package/src/wallets/default/frameWallet/frameWallet.ts +0 -14
- package/src/wallets/default/gateWallet/gateWallet.ts +0 -27
- package/src/wallets/default/imTokenWallet/imTokenWallet.ts +0 -24
- package/src/wallets/default/injectedWallet/injectedWallet.ts +0 -9
- package/src/wallets/default/iopayWallet/iopayWallet.ts +0 -21
- package/src/wallets/default/kaiaWallet/kaiaWallet.ts +0 -24
- package/src/wallets/default/kaikasWallet/kaikasWallet.ts +0 -24
- package/src/wallets/default/krakenWallet/krakenWallet.ts +0 -19
- package/src/wallets/default/kresusWallet/kresusWallet.ts +0 -17
- package/src/wallets/default/ledgerWallet/ledgerWallet.ts +0 -26
- package/src/wallets/default/magicEdenWallet/magicEdenWallet.ts +0 -22
- package/src/wallets/default/mathWallet/mathWallet.ts +0 -23
- package/src/wallets/default/metaMaskWallet/metaMaskWallet.ts +0 -105
- package/src/wallets/default/myDogeWallet/mydogeWallet.ts +0 -22
- package/src/wallets/default/nestWallet/nestWallet.ts +0 -14
- package/src/wallets/default/novaWallet/novaWallet.ts +0 -27
- package/src/wallets/default/oktoWallet/oktoWallet.ts +0 -21
- package/src/wallets/default/okxWallet/okxWallet.ts +0 -40
- package/src/wallets/default/omniWallet/omniWallet.ts +0 -21
- package/src/wallets/default/oneInchWallet/oneInchWallet.ts +0 -18
- package/src/wallets/default/oneKeyWallet/oneKeyWallet.ts +0 -22
- package/src/wallets/default/paraSwapWallet/paraswapWallet.ts +0 -19
- package/src/wallets/default/petraWallet/petraWallet.ts +0 -23
- package/src/wallets/default/phantomWallet/phantomWallet.ts +0 -34
- package/src/wallets/default/rabbyWallet/rabbyWallet.ts +0 -15
- package/src/wallets/default/rainbowWallet/rainbowWallet.ts +0 -31
- package/src/wallets/default/ramperWallet/ramperWallet.ts +0 -16
- package/src/wallets/default/readyWallet/readyWallet.ts +0 -15
- package/src/wallets/default/roninWallet/roninWallet.ts +0 -22
- package/src/wallets/default/safeWallet/safeWallet.ts +0 -15
- package/src/wallets/default/safeheronWallet/safeheronWallet.ts +0 -14
- package/src/wallets/default/safepalWallet/safepalWallet.ts +0 -21
- package/src/wallets/default/seifWallet/seifWallet.ts +0 -15
- package/src/wallets/default/solflareWallet/solflareWallet.ts +0 -29
- package/src/wallets/default/subWallet/subWallet.ts +0 -22
- package/src/wallets/default/tahoWallet/tahoWallet.ts +0 -16
- package/src/wallets/default/talismanWallet/talismanWallet.ts +0 -16
- package/src/wallets/default/tokenPocketWallet/tokenPocketWallet.ts +0 -29
- package/src/wallets/default/tokenaryWallet/tokenaryWallet.ts +0 -16
- package/src/wallets/default/trezorWallet/trezorWallet.ts +0 -18
- package/src/wallets/default/trustWallet/trustWallet.ts +0 -28
- package/src/wallets/default/uniswapWallet/uniswapWallet.ts +0 -19
- package/src/wallets/default/universalProfilesWallet/universalProfilesWallet.ts +0 -21
- package/src/wallets/default/valoraWallet/valoraWallet.ts +0 -19
- package/src/wallets/default/walletConnectWallet/walletConnectWallet.ts +0 -15
- package/src/wallets/default/wigwamWallet/wigwamWallet.ts +0 -17
- package/src/wallets/default/xPortalWallet/xPortalWallet.ts +0 -19
- package/src/wallets/default/zealWallet/zealWallet.ts +0 -27
- package/src/wallets/default/zerionWallet/zerionWallet.ts +0 -27
- package/src/wallets/default/zilPayWallet/zilPayWallet.ts +0 -18
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tomo-inc/wallet-adaptor-base",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.14",
|
|
4
4
|
"author": "tomo.inc",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"private": false,
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"@solana/web3.js": "^1.98.0",
|
|
23
23
|
"@wallet-standard/core": "^1.1.0",
|
|
24
24
|
"viem": "2.21.54",
|
|
25
|
-
"@tomo-inc/wallet-connect-protocol": "0.0.
|
|
25
|
+
"@tomo-inc/wallet-connect-protocol": "0.0.13"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/node": "^20.0.0",
|
package/project.json
CHANGED
|
@@ -3,6 +3,13 @@
|
|
|
3
3
|
"sourceRoot": "packages/wallet-adaptor-base/src",
|
|
4
4
|
"projectType": "library",
|
|
5
5
|
"targets": {
|
|
6
|
+
"version:up": {
|
|
7
|
+
"executor": "nx:run-commands",
|
|
8
|
+
"options": {
|
|
9
|
+
"cwd": "packages/wallet-adaptor-base",
|
|
10
|
+
"command": "npm version patch --no-git-tag-version"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
6
13
|
"build": {
|
|
7
14
|
"executor": "nx:run-commands",
|
|
8
15
|
"outputs": ["{projectRoot}/dist"],
|
|
@@ -53,6 +60,14 @@
|
|
|
53
60
|
"command": "vitest",
|
|
54
61
|
"cwd": "packages/wallet-adaptor-base"
|
|
55
62
|
}
|
|
63
|
+
},
|
|
64
|
+
"publish": {
|
|
65
|
+
"executor": "nx:run-commands",
|
|
66
|
+
"dependsOn": ["build"],
|
|
67
|
+
"options": {
|
|
68
|
+
"command": "pnpm publish --access public --no-git-checks --tag ${NPM_TAG:-latest}",
|
|
69
|
+
"cwd": "packages/wallet-adaptor-base"
|
|
70
|
+
}
|
|
56
71
|
}
|
|
57
72
|
},
|
|
58
73
|
"tags": ["npm:public", "scope:wallet-adaptor-base", "type:library"]
|
package/src/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AdaptorChainType, Connector, WalletConnectorType } from "./type";
|
|
2
2
|
import { isMobile } from "./utils/isMobile";
|
|
3
3
|
import { uniqueConnectors } from "./utils/utils";
|
|
4
|
-
import {
|
|
4
|
+
import { getDefaultConnectors } from "./wallets/defaultConnectors";
|
|
5
5
|
import { connectorDector, supportedWalletConfigTypes, walletConfigAdapter } from "./wallets/detector";
|
|
6
6
|
import { WagmiWalletConfig, WalletConfig } from "./wallets/Wallet";
|
|
7
7
|
import { eip6963Wallets } from "./wallets/wallet-eip6963";
|
|
@@ -13,11 +13,6 @@ export type { WalletConfig };
|
|
|
13
13
|
|
|
14
14
|
const walletBaseUrl = "https://embedded-wallet.tomo.inc";
|
|
15
15
|
|
|
16
|
-
//wallets list
|
|
17
|
-
export const TomoDefaultConnectors = defaultConnectors
|
|
18
|
-
.filter((wallet) => wallet?.info?.links?.chrome_install !== undefined)
|
|
19
|
-
.sort((a, _b) => (a.isInstalled ? -1 : 1));
|
|
20
|
-
|
|
21
16
|
export async function loadConnectors({
|
|
22
17
|
chainType = "all",
|
|
23
18
|
recommonedConnectors,
|
|
@@ -45,7 +40,7 @@ export async function loadConnectors({
|
|
|
45
40
|
};
|
|
46
41
|
|
|
47
42
|
// WalletConnect wallets from WalletConnect Cloud Explorer API
|
|
48
|
-
const wcWallets = await walletConnectWallets(options.baseUrl
|
|
43
|
+
const wcWallets = await walletConnectWallets(options.baseUrl);
|
|
49
44
|
|
|
50
45
|
let recommonedConnectorsDetected: Connector[] = [];
|
|
51
46
|
if (recommonedWalletConfigs.length > 0) {
|
|
@@ -62,7 +57,7 @@ export async function loadConnectors({
|
|
|
62
57
|
});
|
|
63
58
|
}
|
|
64
59
|
|
|
65
|
-
const defaultConnectors = getDefaultConnectors(options.baseUrl
|
|
60
|
+
const defaultConnectors = await getDefaultConnectors(options.baseUrl);
|
|
66
61
|
|
|
67
62
|
const connectorsFromConfig = uniqueConnectors([...recommonedConnectorsDetected, ...defaultConnectors]);
|
|
68
63
|
|
package/src/type.ts
CHANGED
|
@@ -111,3 +111,13 @@ export interface ChainInfo {
|
|
|
111
111
|
};
|
|
112
112
|
blockExplorerUrls: string[];
|
|
113
113
|
}
|
|
114
|
+
|
|
115
|
+
export interface WalletConnectConfig {
|
|
116
|
+
projectId: string;
|
|
117
|
+
metadata: {
|
|
118
|
+
name: string;
|
|
119
|
+
description: string;
|
|
120
|
+
url: string;
|
|
121
|
+
icons: string[];
|
|
122
|
+
};
|
|
123
|
+
}
|
|
@@ -1,224 +1,16 @@
|
|
|
1
|
-
import { abWallet } from "./default/abWallet/abWallet";
|
|
2
|
-
import { backpackWallet } from "./default/backpackWallet/backpackWallet";
|
|
3
|
-
import { berasigWallet } from "./default/berasigWallet/berasigWallet";
|
|
4
|
-
import { binanceWallet } from "./default/binanceWallet/binanceWallet";
|
|
5
|
-
import { bitgetWallet } from "./default/bitgetWallet/bitgetWallet";
|
|
6
|
-
import { bitskiWallet } from "./default/bitskiWallet/bitskiWallet";
|
|
7
|
-
import { bitverseWallet } from "./default/bitverseWallet/bitverseWallet";
|
|
8
|
-
import { bloomWallet } from "./default/bloomWallet/bloomWallet";
|
|
9
|
-
import { braveWallet } from "./default/braveWallet/braveWallet";
|
|
10
|
-
import { bybitWallet } from "./default/bybitWallet/bybitWallet";
|
|
11
|
-
import { clvWallet } from "./default/clvWallet/clvWallet";
|
|
12
|
-
import { coin98Wallet } from "./default/coin98Wallet/coin98Wallet";
|
|
13
|
-
import { coinbaseWallet } from "./default/coinbaseWallet/coinbaseWallet";
|
|
14
|
-
import { compassWallet } from "./default/compassWallet/compassWallet";
|
|
15
|
-
import { coreWallet } from "./default/coreWallet/coreWallet";
|
|
16
|
-
import { ctrlWallet } from "./default/ctrlWallet/ctrlWallet";
|
|
17
|
-
import { dawnWallet } from "./default/dawnWallet/dawnWallet";
|
|
18
|
-
import { desigWallet } from "./default/desigWallet/desigWallet";
|
|
19
|
-
import { enkryptWallet } from "./default/enkryptWallet/enkryptWallet";
|
|
20
|
-
import { foxWallet } from "./default/foxWallet/foxWallet";
|
|
21
|
-
import { frameWallet } from "./default/frameWallet/frameWallet";
|
|
22
|
-
import { gateWallet } from "./default/gateWallet/gateWallet";
|
|
23
|
-
import { imTokenWallet } from "./default/imTokenWallet/imTokenWallet";
|
|
24
|
-
import { injectedWallet } from "./default/injectedWallet/injectedWallet";
|
|
25
|
-
import { iopayWallet } from "./default/iopayWallet/iopayWallet";
|
|
26
|
-
import { kaiaWallet } from "./default/kaiaWallet/kaiaWallet";
|
|
27
|
-
import { kaikasWallet } from "./default/kaikasWallet/kaikasWallet";
|
|
28
|
-
import { krakenWallet } from "./default/krakenWallet/krakenWallet";
|
|
29
|
-
import { kresusWallet } from "./default/kresusWallet/kresusWallet";
|
|
30
|
-
import { ledgerWallet } from "./default/ledgerWallet/ledgerWallet";
|
|
31
|
-
import { magicEdenWallet } from "./default/magicEdenWallet/magicEdenWallet";
|
|
32
|
-
import { mathWallet } from "./default/mathWallet/mathWallet";
|
|
33
|
-
import { metaMaskWallet } from "./default/metaMaskWallet/metaMaskWallet";
|
|
34
|
-
import { mydogeWallet } from "./default/myDogeWallet/mydogeWallet";
|
|
35
|
-
import { nestWallet } from "./default/nestWallet/nestWallet";
|
|
36
|
-
import { novaWallet } from "./default/novaWallet/novaWallet";
|
|
37
|
-
import { oktoWallet } from "./default/oktoWallet/oktoWallet";
|
|
38
|
-
import { okxWallet } from "./default/okxWallet/okxWallet";
|
|
39
|
-
import { omniWallet } from "./default/omniWallet/omniWallet";
|
|
40
|
-
import { oneInchWallet } from "./default/oneInchWallet/oneInchWallet";
|
|
41
|
-
import { oneKeyWallet } from "./default/oneKeyWallet/oneKeyWallet";
|
|
42
|
-
import { paraSwapWallet } from "./default/paraSwapWallet/paraswapWallet";
|
|
43
|
-
import { petraWallet } from "./default/petraWallet/petraWallet";
|
|
44
|
-
import { phantomWallet } from "./default/phantomWallet/phantomWallet";
|
|
45
|
-
import { rabbyWallet } from "./default/rabbyWallet/rabbyWallet";
|
|
46
|
-
import { rainbowWallet } from "./default/rainbowWallet/rainbowWallet";
|
|
47
|
-
import { ramperWallet } from "./default/ramperWallet/ramperWallet";
|
|
48
|
-
import { readyWallet } from "./default/readyWallet/readyWallet";
|
|
49
|
-
import { roninWallet } from "./default/roninWallet/roninWallet";
|
|
50
|
-
import { safeWallet } from "./default/safeWallet/safeWallet";
|
|
51
|
-
import { safeheronWallet } from "./default/safeheronWallet/safeheronWallet";
|
|
52
|
-
import { safepalWallet } from "./default/safepalWallet/safepalWallet";
|
|
53
|
-
import { seifWallet } from "./default/seifWallet/seifWallet";
|
|
54
|
-
import { solflareWallet } from "./default/solflareWallet/solflareWallet";
|
|
55
|
-
import { subWallet } from "./default/subWallet/subWallet";
|
|
56
|
-
import { tahoWallet } from "./default/tahoWallet/tahoWallet";
|
|
57
|
-
import { talismanWallet } from "./default/talismanWallet/talismanWallet";
|
|
58
|
-
import { tokenPocketWallet } from "./default/tokenPocketWallet/tokenPocketWallet";
|
|
59
|
-
import { tokenaryWallet } from "./default/tokenaryWallet/tokenaryWallet";
|
|
60
|
-
import { trezorWallet } from "./default/trezorWallet/trezorWallet";
|
|
61
|
-
import { trustWallet } from "./default/trustWallet/trustWallet";
|
|
62
|
-
import { uniswapWallet } from "./default/uniswapWallet/uniswapWallet";
|
|
63
|
-
import { universalProfilesWallet } from "./default/universalProfilesWallet/universalProfilesWallet";
|
|
64
|
-
import { valoraWallet } from "./default/valoraWallet/valoraWallet";
|
|
65
|
-
import { walletConnectWallet } from "./default/walletConnectWallet/walletConnectWallet";
|
|
66
|
-
import { wigwamWallet } from "./default/wigwamWallet/wigwamWallet";
|
|
67
|
-
import { xPortalWallet } from "./default/xPortalWallet/xPortalWallet";
|
|
68
|
-
import { zealWallet } from "./default/zealWallet/zealWallet";
|
|
69
|
-
import { zerionWallet } from "./default/zerionWallet/zerionWallet";
|
|
70
|
-
import { zilPayWallet } from "./default/zilPayWallet/zilPayWallet";
|
|
71
1
|
import { connectorDector } from "./detector";
|
|
72
2
|
|
|
73
|
-
|
|
74
|
-
abWallet,
|
|
75
|
-
backpackWallet,
|
|
76
|
-
berasigWallet,
|
|
77
|
-
binanceWallet,
|
|
78
|
-
bitgetWallet,
|
|
79
|
-
bitskiWallet,
|
|
80
|
-
bitverseWallet,
|
|
81
|
-
bloomWallet,
|
|
82
|
-
braveWallet,
|
|
83
|
-
bybitWallet,
|
|
84
|
-
clvWallet,
|
|
85
|
-
coin98Wallet,
|
|
86
|
-
coinbaseWallet,
|
|
87
|
-
compassWallet,
|
|
88
|
-
coreWallet,
|
|
89
|
-
ctrlWallet,
|
|
90
|
-
dawnWallet,
|
|
91
|
-
desigWallet,
|
|
92
|
-
enkryptWallet,
|
|
93
|
-
foxWallet,
|
|
94
|
-
frameWallet,
|
|
95
|
-
gateWallet,
|
|
96
|
-
imTokenWallet,
|
|
97
|
-
injectedWallet,
|
|
98
|
-
iopayWallet,
|
|
99
|
-
kaiaWallet,
|
|
100
|
-
kaikasWallet,
|
|
101
|
-
krakenWallet,
|
|
102
|
-
kresusWallet,
|
|
103
|
-
ledgerWallet,
|
|
104
|
-
magicEdenWallet,
|
|
105
|
-
mathWallet,
|
|
106
|
-
metaMaskWallet,
|
|
107
|
-
mydogeWallet,
|
|
108
|
-
nestWallet,
|
|
109
|
-
novaWallet,
|
|
110
|
-
oktoWallet,
|
|
111
|
-
okxWallet,
|
|
112
|
-
omniWallet,
|
|
113
|
-
oneInchWallet,
|
|
114
|
-
oneKeyWallet,
|
|
115
|
-
paraSwapWallet,
|
|
116
|
-
petraWallet,
|
|
117
|
-
phantomWallet,
|
|
118
|
-
rabbyWallet,
|
|
119
|
-
rainbowWallet,
|
|
120
|
-
ramperWallet,
|
|
121
|
-
readyWallet,
|
|
122
|
-
roninWallet,
|
|
123
|
-
safeheronWallet,
|
|
124
|
-
safepalWallet,
|
|
125
|
-
safeWallet,
|
|
126
|
-
seifWallet,
|
|
127
|
-
solflareWallet,
|
|
128
|
-
subWallet,
|
|
129
|
-
tahoWallet,
|
|
130
|
-
talismanWallet,
|
|
131
|
-
tokenaryWallet,
|
|
132
|
-
tokenPocketWallet,
|
|
133
|
-
trezorWallet,
|
|
134
|
-
trustWallet,
|
|
135
|
-
uniswapWallet,
|
|
136
|
-
universalProfilesWallet,
|
|
137
|
-
valoraWallet,
|
|
138
|
-
walletConnectWallet,
|
|
139
|
-
wigwamWallet,
|
|
140
|
-
xPortalWallet,
|
|
141
|
-
zealWallet,
|
|
142
|
-
zerionWallet,
|
|
143
|
-
zilPayWallet,
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
const walletList = [
|
|
147
|
-
abWallet,
|
|
148
|
-
backpackWallet,
|
|
149
|
-
berasigWallet,
|
|
150
|
-
binanceWallet,
|
|
151
|
-
bitgetWallet,
|
|
152
|
-
bitskiWallet,
|
|
153
|
-
bitverseWallet,
|
|
154
|
-
bloomWallet,
|
|
155
|
-
braveWallet,
|
|
156
|
-
bybitWallet,
|
|
157
|
-
clvWallet,
|
|
158
|
-
coin98Wallet,
|
|
159
|
-
coinbaseWallet,
|
|
160
|
-
compassWallet,
|
|
161
|
-
coreWallet,
|
|
162
|
-
ctrlWallet,
|
|
163
|
-
dawnWallet,
|
|
164
|
-
desigWallet,
|
|
165
|
-
enkryptWallet,
|
|
166
|
-
foxWallet,
|
|
167
|
-
frameWallet,
|
|
168
|
-
gateWallet,
|
|
169
|
-
imTokenWallet,
|
|
170
|
-
injectedWallet,
|
|
171
|
-
iopayWallet,
|
|
172
|
-
kaiaWallet,
|
|
173
|
-
kaikasWallet,
|
|
174
|
-
krakenWallet,
|
|
175
|
-
kresusWallet,
|
|
176
|
-
ledgerWallet,
|
|
177
|
-
magicEdenWallet,
|
|
178
|
-
mathWallet,
|
|
179
|
-
metaMaskWallet,
|
|
180
|
-
mydogeWallet,
|
|
181
|
-
nestWallet,
|
|
182
|
-
novaWallet,
|
|
183
|
-
oktoWallet,
|
|
184
|
-
okxWallet,
|
|
185
|
-
omniWallet,
|
|
186
|
-
oneInchWallet,
|
|
187
|
-
oneKeyWallet,
|
|
188
|
-
paraSwapWallet,
|
|
189
|
-
petraWallet,
|
|
190
|
-
phantomWallet,
|
|
191
|
-
rabbyWallet,
|
|
192
|
-
rainbowWallet,
|
|
193
|
-
ramperWallet,
|
|
194
|
-
readyWallet,
|
|
195
|
-
roninWallet,
|
|
196
|
-
safeheronWallet,
|
|
197
|
-
safepalWallet,
|
|
198
|
-
safeWallet,
|
|
199
|
-
seifWallet,
|
|
200
|
-
solflareWallet,
|
|
201
|
-
subWallet,
|
|
202
|
-
tahoWallet,
|
|
203
|
-
talismanWallet,
|
|
204
|
-
tokenaryWallet,
|
|
205
|
-
tokenPocketWallet,
|
|
206
|
-
trezorWallet,
|
|
207
|
-
trustWallet,
|
|
208
|
-
universalProfilesWallet,
|
|
209
|
-
uniswapWallet,
|
|
210
|
-
valoraWallet,
|
|
211
|
-
wigwamWallet,
|
|
212
|
-
xPortalWallet,
|
|
213
|
-
zealWallet,
|
|
214
|
-
zerionWallet,
|
|
215
|
-
zilPayWallet,
|
|
216
|
-
];
|
|
3
|
+
let defaultWallets: Record<string, any>[] = [];
|
|
217
4
|
|
|
218
|
-
const
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
5
|
+
export const getDefaultConnectors = async (baseUrl?: string) => {
|
|
6
|
+
if (defaultWallets.length > 0) {
|
|
7
|
+
return defaultWallets.map((wallet: any) => connectorDector(wallet));
|
|
8
|
+
}
|
|
9
|
+
const walletListResponse = await fetch((baseUrl || "https://web3-assets.tomo.inc") + "/api/wallets");
|
|
10
|
+
const walletList = await walletListResponse.json();
|
|
11
|
+
defaultWallets = walletList?.data.map((wallet: any) => ({
|
|
12
|
+
...wallet,
|
|
13
|
+
icon: (baseUrl || "https://web3-assets.tomo.inc") + wallet.icon,
|
|
14
|
+
}));
|
|
15
|
+
return defaultWallets?.map((wallet: any) => connectorDector(wallet));
|
|
222
16
|
};
|
|
223
|
-
|
|
224
|
-
export const defaultConnectors = getDefaultConnectors(walletBaseUrl);
|
package/src/wallets/index.ts
CHANGED
|
@@ -1,143 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { bitgetWallet } from "./default/bitgetWallet/bitgetWallet";
|
|
6
|
-
import { bitskiWallet } from "./default/bitskiWallet/bitskiWallet";
|
|
7
|
-
import { bitverseWallet } from "./default/bitverseWallet/bitverseWallet";
|
|
8
|
-
import { bloomWallet } from "./default/bloomWallet/bloomWallet";
|
|
9
|
-
import { braveWallet } from "./default/braveWallet/braveWallet";
|
|
10
|
-
import { bybitWallet } from "./default/bybitWallet/bybitWallet";
|
|
11
|
-
import { clvWallet } from "./default/clvWallet/clvWallet";
|
|
12
|
-
import { coin98Wallet } from "./default/coin98Wallet/coin98Wallet";
|
|
13
|
-
import { coinbaseWallet } from "./default/coinbaseWallet/coinbaseWallet";
|
|
14
|
-
import { compassWallet } from "./default/compassWallet/compassWallet";
|
|
15
|
-
import { coreWallet } from "./default/coreWallet/coreWallet";
|
|
16
|
-
import { ctrlWallet } from "./default/ctrlWallet/ctrlWallet";
|
|
17
|
-
import { dawnWallet } from "./default/dawnWallet/dawnWallet";
|
|
18
|
-
import { desigWallet } from "./default/desigWallet/desigWallet";
|
|
19
|
-
import { enkryptWallet } from "./default/enkryptWallet/enkryptWallet";
|
|
20
|
-
import { foxWallet } from "./default/foxWallet/foxWallet";
|
|
21
|
-
import { frameWallet } from "./default/frameWallet/frameWallet";
|
|
22
|
-
import { gateWallet } from "./default/gateWallet/gateWallet";
|
|
23
|
-
import { imTokenWallet } from "./default/imTokenWallet/imTokenWallet";
|
|
24
|
-
import { injectedWallet } from "./default/injectedWallet/injectedWallet";
|
|
25
|
-
import { iopayWallet } from "./default/iopayWallet/iopayWallet";
|
|
26
|
-
import { kaiaWallet } from "./default/kaiaWallet/kaiaWallet";
|
|
27
|
-
import { kaikasWallet } from "./default/kaikasWallet/kaikasWallet";
|
|
28
|
-
import { krakenWallet } from "./default/krakenWallet/krakenWallet";
|
|
29
|
-
import { kresusWallet } from "./default/kresusWallet/kresusWallet";
|
|
30
|
-
import { ledgerWallet } from "./default/ledgerWallet/ledgerWallet";
|
|
31
|
-
import { magicEdenWallet } from "./default/magicEdenWallet/magicEdenWallet";
|
|
32
|
-
import { mathWallet } from "./default/mathWallet/mathWallet";
|
|
33
|
-
import { metaMaskWallet } from "./default/metaMaskWallet/metaMaskWallet";
|
|
34
|
-
import { mydogeWallet } from "./default/myDogeWallet/mydogeWallet";
|
|
35
|
-
import { nestWallet } from "./default/nestWallet/nestWallet";
|
|
36
|
-
import { novaWallet } from "./default/novaWallet/novaWallet";
|
|
37
|
-
import { oktoWallet } from "./default/oktoWallet/oktoWallet";
|
|
38
|
-
import { okxWallet } from "./default/okxWallet/okxWallet";
|
|
39
|
-
import { omniWallet } from "./default/omniWallet/omniWallet";
|
|
40
|
-
import { oneInchWallet } from "./default/oneInchWallet/oneInchWallet";
|
|
41
|
-
import { oneKeyWallet } from "./default/oneKeyWallet/oneKeyWallet";
|
|
42
|
-
import { paraSwapWallet } from "./default/paraSwapWallet/paraswapWallet";
|
|
43
|
-
import { petraWallet } from "./default/petraWallet/petraWallet";
|
|
44
|
-
import { phantomWallet } from "./default/phantomWallet/phantomWallet";
|
|
45
|
-
import { rabbyWallet } from "./default/rabbyWallet/rabbyWallet";
|
|
46
|
-
import { rainbowWallet } from "./default/rainbowWallet/rainbowWallet";
|
|
47
|
-
import { ramperWallet } from "./default/ramperWallet/ramperWallet";
|
|
48
|
-
import { readyWallet } from "./default/readyWallet/readyWallet";
|
|
49
|
-
import { roninWallet } from "./default/roninWallet/roninWallet";
|
|
50
|
-
import { safeWallet } from "./default/safeWallet/safeWallet";
|
|
51
|
-
import { safeheronWallet } from "./default/safeheronWallet/safeheronWallet";
|
|
52
|
-
import { safepalWallet } from "./default/safepalWallet/safepalWallet";
|
|
53
|
-
import { seifWallet } from "./default/seifWallet/seifWallet";
|
|
54
|
-
import { solflareWallet } from "./default/solflareWallet/solflareWallet";
|
|
55
|
-
import { subWallet } from "./default/subWallet/subWallet";
|
|
56
|
-
import { tahoWallet } from "./default/tahoWallet/tahoWallet";
|
|
57
|
-
import { talismanWallet } from "./default/talismanWallet/talismanWallet";
|
|
58
|
-
import { tokenPocketWallet } from "./default/tokenPocketWallet/tokenPocketWallet";
|
|
59
|
-
import { tokenaryWallet } from "./default/tokenaryWallet/tokenaryWallet";
|
|
60
|
-
import { trezorWallet } from "./default/trezorWallet/trezorWallet";
|
|
61
|
-
import { trustWallet } from "./default/trustWallet/trustWallet";
|
|
62
|
-
import { uniswapWallet } from "./default/uniswapWallet/uniswapWallet";
|
|
63
|
-
import { universalProfilesWallet } from "./default/universalProfilesWallet/universalProfilesWallet";
|
|
64
|
-
import { valoraWallet } from "./default/valoraWallet/valoraWallet";
|
|
65
|
-
import { walletConnectWallet } from "./default/walletConnectWallet/walletConnectWallet";
|
|
66
|
-
import { wigwamWallet } from "./default/wigwamWallet/wigwamWallet";
|
|
67
|
-
import { xPortalWallet } from "./default/xPortalWallet/xPortalWallet";
|
|
68
|
-
import { zealWallet } from "./default/zealWallet/zealWallet";
|
|
69
|
-
import { zerionWallet } from "./default/zerionWallet/zerionWallet";
|
|
70
|
-
import { zilPayWallet } from "./default/zilPayWallet/zilPayWallet";
|
|
71
|
-
|
|
72
|
-
export {
|
|
73
|
-
abWallet,
|
|
74
|
-
backpackWallet,
|
|
75
|
-
berasigWallet,
|
|
76
|
-
binanceWallet,
|
|
77
|
-
bitgetWallet,
|
|
78
|
-
bitskiWallet,
|
|
79
|
-
bitverseWallet,
|
|
80
|
-
bloomWallet,
|
|
81
|
-
braveWallet,
|
|
82
|
-
bybitWallet,
|
|
83
|
-
clvWallet,
|
|
84
|
-
coin98Wallet,
|
|
85
|
-
coinbaseWallet,
|
|
86
|
-
compassWallet,
|
|
87
|
-
coreWallet,
|
|
88
|
-
ctrlWallet,
|
|
89
|
-
dawnWallet,
|
|
90
|
-
desigWallet,
|
|
91
|
-
enkryptWallet,
|
|
92
|
-
foxWallet,
|
|
93
|
-
frameWallet,
|
|
94
|
-
gateWallet,
|
|
95
|
-
imTokenWallet,
|
|
96
|
-
injectedWallet,
|
|
97
|
-
iopayWallet,
|
|
98
|
-
kaiaWallet,
|
|
99
|
-
kaikasWallet,
|
|
100
|
-
krakenWallet,
|
|
101
|
-
kresusWallet,
|
|
102
|
-
ledgerWallet,
|
|
103
|
-
magicEdenWallet,
|
|
104
|
-
mathWallet,
|
|
105
|
-
metaMaskWallet,
|
|
106
|
-
mydogeWallet,
|
|
107
|
-
nestWallet,
|
|
108
|
-
novaWallet,
|
|
109
|
-
oktoWallet,
|
|
110
|
-
okxWallet,
|
|
111
|
-
omniWallet,
|
|
112
|
-
oneInchWallet,
|
|
113
|
-
oneKeyWallet,
|
|
114
|
-
paraSwapWallet,
|
|
115
|
-
petraWallet,
|
|
116
|
-
phantomWallet,
|
|
117
|
-
rabbyWallet,
|
|
118
|
-
rainbowWallet,
|
|
119
|
-
ramperWallet,
|
|
120
|
-
readyWallet,
|
|
121
|
-
roninWallet,
|
|
122
|
-
safeheronWallet,
|
|
123
|
-
safepalWallet,
|
|
124
|
-
safeWallet,
|
|
125
|
-
seifWallet,
|
|
126
|
-
solflareWallet,
|
|
127
|
-
subWallet,
|
|
128
|
-
tahoWallet,
|
|
129
|
-
talismanWallet,
|
|
130
|
-
tokenaryWallet,
|
|
131
|
-
tokenPocketWallet,
|
|
132
|
-
trezorWallet,
|
|
133
|
-
trustWallet,
|
|
134
|
-
uniswapWallet,
|
|
135
|
-
universalProfilesWallet,
|
|
136
|
-
valoraWallet,
|
|
137
|
-
walletConnectWallet,
|
|
138
|
-
wigwamWallet,
|
|
139
|
-
xPortalWallet,
|
|
140
|
-
zealWallet,
|
|
141
|
-
zerionWallet,
|
|
142
|
-
zilPayWallet,
|
|
1
|
+
export const getAllWallets = async (baseUrl?: string) => {
|
|
2
|
+
const walletListResponse = await fetch((baseUrl || "https://web3-assets.tomo.inc") + "/api/wallets");
|
|
3
|
+
const walletList = await walletListResponse.json();
|
|
4
|
+
return walletList;
|
|
143
5
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { NamespaceConfig } from "@tomo-inc/wallet-connect-protocol";
|
|
2
2
|
import { Connector, ProviderProtocol } from "../type";
|
|
3
|
-
import { walletConnectWallet } from "./default/walletConnectWallet/walletConnectWallet";
|
|
4
3
|
import { WalletConnectProvider } from "./providers/WalletConnectProvider";
|
|
5
4
|
import { WalletConnectSolanaProvider } from "./providers/WalletConnectSolanaProvider";
|
|
6
5
|
|
|
6
|
+
let wcWallets: Record<string, any>[] = [];
|
|
7
|
+
|
|
7
8
|
/**
|
|
8
9
|
* WalletConnect wallet configuration
|
|
9
10
|
* Can be set via setWalletConnectConfig() before calling walletConnectWallets()
|
|
@@ -43,16 +44,25 @@ export function setWalletConnectConfig(config: {
|
|
|
43
44
|
* Get WalletConnect wallet as Connector
|
|
44
45
|
* Returns a single WalletConnect connector that can connect to any mobile wallet
|
|
45
46
|
*/
|
|
46
|
-
export async function walletConnectWallets(baseUrl
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
export async function walletConnectWallets(baseUrl?: string): Promise<Connector[]> {
|
|
48
|
+
if (wcWallets.length > 0) {
|
|
49
|
+
return wcWallets.map((wallet: any) => convertWalletToConnector(wallet));
|
|
50
|
+
}
|
|
51
|
+
const walletListResponse = await fetch(
|
|
52
|
+
(baseUrl || "https://web3-assets.tomo.inc") + "/api/wallets?walletId=walletConnect",
|
|
53
|
+
);
|
|
54
|
+
const walletList = await walletListResponse.json();
|
|
55
|
+
if (walletList?.data?.length === 0) {
|
|
56
|
+
return [];
|
|
57
|
+
}
|
|
58
|
+
wcWallets = walletList?.data;
|
|
59
|
+
return wcWallets.map((wallet: any) => convertWalletToConnector(wallet));
|
|
50
60
|
}
|
|
51
61
|
|
|
52
62
|
/**
|
|
53
63
|
* Convert WalletConnect Wallet to Connector format
|
|
54
64
|
*/
|
|
55
|
-
function convertWalletToConnector(wallet:
|
|
65
|
+
function convertWalletToConnector(wallet: Record<string, any>): Connector {
|
|
56
66
|
return {
|
|
57
67
|
info: {
|
|
58
68
|
uuid: wallet.id,
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { WalletConfig } from "../../Wallet";
|
|
2
|
-
|
|
3
|
-
export const abWallet = (baseUrl: string): WalletConfig => {
|
|
4
|
-
return {
|
|
5
|
-
id: "abwallet",
|
|
6
|
-
name: "ABWallet",
|
|
7
|
-
namespace: "abwallet.ethereum",
|
|
8
|
-
rdns: "org.ab",
|
|
9
|
-
icon: `${baseUrl}/abWallet.svg`,
|
|
10
|
-
iconBackground: "#2b6be3",
|
|
11
|
-
mobileUserAgent: "ABWallet",
|
|
12
|
-
downloadUrls: {
|
|
13
|
-
android: "https://play.google.com/store/apps/details?id=org.ab.abwallet.android.release",
|
|
14
|
-
ios: "https://apps.apple.com/us/app/ab-wallet/id6745787849",
|
|
15
|
-
mobile: "https://www.ab.org/zh/abwallet/",
|
|
16
|
-
qrCode: "https://www.ab.org/zh/abwallet/",
|
|
17
|
-
},
|
|
18
|
-
};
|
|
19
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { WalletConfig } from "../../Wallet";
|
|
2
|
-
|
|
3
|
-
export const backpackWallet = (baseUrl: string): WalletConfig => {
|
|
4
|
-
return {
|
|
5
|
-
id: "backpack",
|
|
6
|
-
name: "Backpack",
|
|
7
|
-
namespace: "backpack.ethereum",
|
|
8
|
-
rdns: "app.backpack.mobile",
|
|
9
|
-
icon: `${baseUrl}/backpackWallet.svg`,
|
|
10
|
-
iconBackground: "#0C0D10",
|
|
11
|
-
downloadUrls: {
|
|
12
|
-
android: "https://play.google.com/store/apps/details?id=app.backpack.mobile",
|
|
13
|
-
browserExtension: "https://backpack.app/download",
|
|
14
|
-
chrome: "https://chromewebstore.google.com/detail/backpack/aflkmfhebedbjioipglgcbcmnbpgliof",
|
|
15
|
-
ios: "https://apps.apple.com/app/backpack-wallet-exchange/id6445964121",
|
|
16
|
-
mobile: "https://backpack.app/download",
|
|
17
|
-
qrCode: "https://backpack.app/download",
|
|
18
|
-
},
|
|
19
|
-
};
|
|
20
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { WalletConfig } from "../../Wallet";
|
|
2
|
-
|
|
3
|
-
export const berasigWallet = (baseUrl: string): WalletConfig => {
|
|
4
|
-
return {
|
|
5
|
-
id: "berasig",
|
|
6
|
-
name: "BeraSig",
|
|
7
|
-
namespace: "berasig.ethereum",
|
|
8
|
-
rdns: "app.berasig",
|
|
9
|
-
icon: `${baseUrl}/berasigWallet.svg`,
|
|
10
|
-
iconBackground: "#ffffff",
|
|
11
|
-
downloadUrls: {
|
|
12
|
-
android: "https://play.google.com/store/apps/details?id=io.berasig.ios",
|
|
13
|
-
ios: "https://apps.apple.com/us/app/berasig-wallet-on-berachain/id6502052535",
|
|
14
|
-
qrCode: "https://berasig.com",
|
|
15
|
-
mobile: "https://berasig.com",
|
|
16
|
-
browserExtension: "https://chromewebstore.google.com/detail/berasig/ckedkkegjbflcfblcjklibnedmfjppbj",
|
|
17
|
-
},
|
|
18
|
-
};
|
|
19
|
-
};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { isAndroid } from "../../../utils/isMobile";
|
|
2
|
-
import type { WalletConfig } from "../../Wallet";
|
|
3
|
-
|
|
4
|
-
export const binanceWallet = (baseUrl: string): WalletConfig => {
|
|
5
|
-
return {
|
|
6
|
-
id: "binance",
|
|
7
|
-
name: "Binance Wallet",
|
|
8
|
-
namespace: "binancew3w.isExtension",
|
|
9
|
-
flag: "isBinance",
|
|
10
|
-
rdns: "com.binance.wallet",
|
|
11
|
-
icon: `${baseUrl}/binanceWallet.svg`,
|
|
12
|
-
iconBackground: "#000000",
|
|
13
|
-
downloadUrls: {
|
|
14
|
-
android: "https://play.google.com/store/apps/details?id=com.binance.dev",
|
|
15
|
-
ios: "https://apps.apple.com/us/app/id1436799971",
|
|
16
|
-
mobile: "https://www.binance.com/en/download",
|
|
17
|
-
qrCode: "https://www.binance.com/en/web3wallet",
|
|
18
|
-
chrome: "https://chromewebstore.google.com/detail/cadiboklkpojfamcoggejbbdjcoiljjk",
|
|
19
|
-
},
|
|
20
|
-
mobile: {
|
|
21
|
-
getUri: (uri: string) => {
|
|
22
|
-
return isAndroid() ? uri : `bnc://app.binance.com/cedefi/wc?uri=${encodeURIComponent(uri)}`;
|
|
23
|
-
},
|
|
24
|
-
getDeeplink: async (dappUrl?: string, chainId?: number): Promise<string> => {
|
|
25
|
-
if (!dappUrl) return "";
|
|
26
|
-
// Binance wallet uses @binance/w3w-utils for deep link generation
|
|
27
|
-
// This is a fallback implementation. For full support, use the binance utils package
|
|
28
|
-
try {
|
|
29
|
-
// Try to use binance utils if available
|
|
30
|
-
const binanceUtils = await import("@binance/w3w-utils").catch(() => null);
|
|
31
|
-
if (binanceUtils && "getDeepLink" in binanceUtils) {
|
|
32
|
-
const getDeepLink = binanceUtils.getDeepLink as (
|
|
33
|
-
url: string,
|
|
34
|
-
chainId?: number,
|
|
35
|
-
) => { http: string; bnc: string };
|
|
36
|
-
const result = getDeepLink(dappUrl, chainId);
|
|
37
|
-
return result?.http || "";
|
|
38
|
-
}
|
|
39
|
-
} catch (e) {
|
|
40
|
-
// Fallback if binance utils not available
|
|
41
|
-
}
|
|
42
|
-
// Fallback: use binance deep link format
|
|
43
|
-
return `bnc://app.binance.com/cedefi/dapp?url=${encodeURIComponent(dappUrl)}`;
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
};
|
|
47
|
-
};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import type { WalletConfig } from "../../Wallet";
|
|
2
|
-
import { isAndroid } from "../../../utils/isMobile";
|
|
3
|
-
|
|
4
|
-
export const bitgetWallet = (baseUrl: string): WalletConfig => {
|
|
5
|
-
return {
|
|
6
|
-
id: "bitget",
|
|
7
|
-
name: "Bitget Wallet",
|
|
8
|
-
namespace: "bitkeep.ethereum",
|
|
9
|
-
solana: {
|
|
10
|
-
namespace: "bitkeep.solana",
|
|
11
|
-
},
|
|
12
|
-
aptos: {
|
|
13
|
-
namespace: "bitkeep.aptos",
|
|
14
|
-
},
|
|
15
|
-
rdns: "com.bitget.web3",
|
|
16
|
-
icon: `${baseUrl}/bitgetWallet.svg`,
|
|
17
|
-
iconAccent: "#f6851a",
|
|
18
|
-
iconBackground: "#fff",
|
|
19
|
-
downloadUrls: {
|
|
20
|
-
android: "https://web3.bitget.com/en/wallet-download?type=0",
|
|
21
|
-
ios: "https://apps.apple.com/app/bitkeep/id1395301115",
|
|
22
|
-
mobile: "https://web3.bitget.com/en/wallet-download?type=2",
|
|
23
|
-
qrCode: "https://web3.bitget.com/en/wallet-download",
|
|
24
|
-
chrome: "https://chrome.google.com/webstore/detail/bitkeep-crypto-nft-wallet/jiidiaalihmmhddjgbnbgdfflelocpak",
|
|
25
|
-
browserExtension: "https://web3.bitget.com/en/wallet-download",
|
|
26
|
-
},
|
|
27
|
-
mobile: {
|
|
28
|
-
getUri: (uri: string) => {
|
|
29
|
-
return isAndroid() ? uri : `bitkeep://wc?uri=${encodeURIComponent(uri)}`;
|
|
30
|
-
},
|
|
31
|
-
getDeeplink: (dappUrl?: string): string => {
|
|
32
|
-
if (!dappUrl) return "";
|
|
33
|
-
return `https://bkcode.vip?action=dapp&url=${dappUrl}`;
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
};
|
|
37
|
-
};
|