@onekeyfe/inpage-providers-hub 2.2.14 → 2.2.17
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/cjs/connectButtonHack/index.js +0 -6
- package/dist/cjs/connectButtonHack/universal/config.js +350 -8
- package/dist/cjs/injectWeb3Provider.js +9 -17
- package/dist/connectButtonHack/index.js +0 -6
- package/dist/connectButtonHack/universal/config.js +350 -8
- package/dist/injectWeb3Provider.d.ts +3 -0
- package/dist/injectWeb3Provider.js +9 -17
- package/package.json +23 -22
- package/dist/cjs/connectButtonHack/sites/lidofi.js +0 -55
- package/dist/cjs/connectButtonHack/sites/rocketpool.js +0 -39
- package/dist/cjs/connectButtonHack/sites/solv.js +0 -45
- package/dist/connectButtonHack/sites/lidofi.d.ts +0 -2
- package/dist/connectButtonHack/sites/lidofi.js +0 -53
- package/dist/connectButtonHack/sites/rocketpool.d.ts +0 -2
- package/dist/connectButtonHack/sites/rocketpool.js +0 -37
- package/dist/connectButtonHack/sites/solv.d.ts +0 -2
- package/dist/connectButtonHack/sites/solv.js +0 -40
|
@@ -514,7 +514,7 @@ export const sitesConfig = [
|
|
|
514
514
|
},
|
|
515
515
|
},
|
|
516
516
|
{
|
|
517
|
-
urls: ['app.arrakis.
|
|
517
|
+
urls: ['app.arrakis.finance'],
|
|
518
518
|
testPath: [':text("For Users")', ':text("Connect Wallet")'],
|
|
519
519
|
walletsForProvider: {
|
|
520
520
|
[IInjectedProviderNames.ethereum]: [metamaskForRainbowKit, walletConnectForRainbowKit],
|
|
@@ -1925,10 +1925,15 @@ export const sitesConfig = [
|
|
|
1925
1925
|
},
|
|
1926
1926
|
},
|
|
1927
1927
|
{
|
|
1928
|
-
urls: ['
|
|
1929
|
-
testPath: [':text("
|
|
1928
|
+
urls: ['app.wasabi.xyz'],
|
|
1929
|
+
testPath: [':text("CONNECT WALLET")'],
|
|
1930
1930
|
walletsForProvider: {
|
|
1931
|
-
[IInjectedProviderNames.ethereum]: [
|
|
1931
|
+
[IInjectedProviderNames.ethereum]: [
|
|
1932
|
+
Object.assign(Object.assign({}, basicWalletInfo['metamask']), { container: () => getConnectWalletModalByTitle('#headlessui-portal-root div[id*="headlessui-dialog-"]', ['Connect Wallet', 'Wallet Overview']) }),
|
|
1933
|
+
],
|
|
1934
|
+
[IInjectedProviderNames.solana]: [
|
|
1935
|
+
Object.assign(Object.assign({}, basicWalletInfo['phantom']), { container: () => getConnectWalletModalByTitle('#headlessui-portal-root div[id*="headlessui-dialog-"]', ['Connect Wallet', 'Wallet Overview']) }),
|
|
1936
|
+
],
|
|
1932
1937
|
},
|
|
1933
1938
|
},
|
|
1934
1939
|
{
|
|
@@ -2839,7 +2844,7 @@ export const sitesConfig = [
|
|
|
2839
2844
|
icon.style.width = '26px';
|
|
2840
2845
|
icon.style.height = '26px';
|
|
2841
2846
|
return true;
|
|
2842
|
-
}
|
|
2847
|
+
},
|
|
2843
2848
|
],
|
|
2844
2849
|
text: [],
|
|
2845
2850
|
},
|
|
@@ -2847,9 +2852,346 @@ export const sitesConfig = [
|
|
|
2847
2852
|
[IInjectedProviderNames.solana]: [
|
|
2848
2853
|
Object.assign(Object.assign({}, basicWalletInfo['phantom']), { container: 'div.wallet-list', afterUpdate(textNode) {
|
|
2849
2854
|
const ledgerInput = document.getElementById('connect-ledger-wallet-with-phantom');
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2855
|
+
if (textNode) {
|
|
2856
|
+
textNode.textContent = 'OneKey Hardware & Phantom';
|
|
2857
|
+
}
|
|
2858
|
+
const label = ledgerInput === null || ledgerInput === void 0 ? void 0 : ledgerInput.parentElement;
|
|
2859
|
+
if (label) {
|
|
2860
|
+
const span = label.querySelector('span');
|
|
2861
|
+
if (span) {
|
|
2862
|
+
span.textContent = 'I am using my ledger/onekey hardware with one of these wallets';
|
|
2863
|
+
}
|
|
2864
|
+
label.style.padding = '20px';
|
|
2865
|
+
label.style.display = 'flex';
|
|
2866
|
+
label.style.alignItems = 'center';
|
|
2867
|
+
}
|
|
2868
|
+
} }),
|
|
2869
|
+
],
|
|
2870
|
+
},
|
|
2871
|
+
},
|
|
2872
|
+
{
|
|
2873
|
+
urls: ['www.desyn.io'],
|
|
2874
|
+
walletsForProvider: {
|
|
2875
|
+
[IInjectedProviderNames.ethereum]: [
|
|
2876
|
+
Object.assign(Object.assign({}, basicWalletInfo['metamask']), { findIconAndName({ name }) {
|
|
2877
|
+
var _a, _b;
|
|
2878
|
+
const modal = document.querySelector('div.modal div.modal-body');
|
|
2879
|
+
const text = modal && findWalletTextByParent(modal, name, []);
|
|
2880
|
+
const icon = (_b = (_a = text === null || text === void 0 ? void 0 : text.parentElement) === null || _a === void 0 ? void 0 : _a.parentElement) === null || _b === void 0 ? void 0 : _b.querySelector('img');
|
|
2881
|
+
return (text && {
|
|
2882
|
+
textNode: text,
|
|
2883
|
+
iconNode: icon !== null && icon !== void 0 ? icon : null,
|
|
2884
|
+
});
|
|
2885
|
+
} }),
|
|
2886
|
+
],
|
|
2887
|
+
},
|
|
2888
|
+
},
|
|
2889
|
+
{
|
|
2890
|
+
urls: ['stake.lido.fi'],
|
|
2891
|
+
walletsForProvider: {
|
|
2892
|
+
[IInjectedProviderNames.ethereum]: [
|
|
2893
|
+
Object.assign(Object.assign({}, basicWalletInfo['metamask']), { container: '#reef-knot-modal-root' }),
|
|
2894
|
+
],
|
|
2895
|
+
},
|
|
2896
|
+
},
|
|
2897
|
+
{
|
|
2898
|
+
urls: ['bridge.arbitrum.io'],
|
|
2899
|
+
walletsForProvider: {
|
|
2900
|
+
[IInjectedProviderNames.ethereum]: [
|
|
2901
|
+
Object.assign(Object.assign({}, basicWalletInfo['metamask']), { container: 'div[role="document"]', findIconAndName({ name, container }) {
|
|
2902
|
+
var _a;
|
|
2903
|
+
const modal = getConnectWalletModalByTitle(container, 'Connect a Wallet');
|
|
2904
|
+
return (_a = (modal && findIconAndNameByName(modal, name, 'auto-search-icon'))) !== null && _a !== void 0 ? _a : null;
|
|
2905
|
+
} }),
|
|
2906
|
+
],
|
|
2907
|
+
},
|
|
2908
|
+
},
|
|
2909
|
+
{
|
|
2910
|
+
urls: ['app.optimism.io'],
|
|
2911
|
+
walletsForProvider: {
|
|
2912
|
+
[IInjectedProviderNames.ethereum]: [
|
|
2913
|
+
Object.assign(Object.assign({}, basicWalletInfo['metamask']), { container: 'div[role="document"]' }),
|
|
2914
|
+
],
|
|
2915
|
+
},
|
|
2916
|
+
},
|
|
2917
|
+
{
|
|
2918
|
+
urls: ['stake.rocketpool.net'],
|
|
2919
|
+
walletsForProvider: {
|
|
2920
|
+
[IInjectedProviderNames.ethereum]: [
|
|
2921
|
+
Object.assign(Object.assign({}, basicWalletInfo['metamask']), { findIconAndName({ name }) {
|
|
2922
|
+
const modal = document.querySelector('div[role="dialog"].fixed.inset-0');
|
|
2923
|
+
return modal && findIconAndNameByIcon('img[alt="MetaMask"]', 'auto-search-text', name, modal);
|
|
2924
|
+
} }),
|
|
2925
|
+
],
|
|
2926
|
+
},
|
|
2927
|
+
},
|
|
2928
|
+
{
|
|
2929
|
+
urls: ['app.solv.finance'],
|
|
2930
|
+
walletsForProvider: {
|
|
2931
|
+
[IInjectedProviderNames.ethereum]: [
|
|
2932
|
+
Object.assign(Object.assign({}, basicWalletInfo['metamask']), { container: 'div[role="dialog"]', findIconAndName({ name }) {
|
|
2933
|
+
var _a;
|
|
2934
|
+
const modal = getConnectWalletModalByTitle('div[role="dialog"]', 'Connect your wallet');
|
|
2935
|
+
return (_a = (modal && findIconAndNameByName(modal, name, 'auto-search-icon', {
|
|
2936
|
+
icon: [
|
|
2937
|
+
isWalletIconLessEqualThan,
|
|
2938
|
+
(icon) => icon.getAttribute('aria-hidden') !== 'true'
|
|
2939
|
+
],
|
|
2940
|
+
text: []
|
|
2941
|
+
}))) !== null && _a !== void 0 ? _a : null;
|
|
2942
|
+
} }),
|
|
2943
|
+
],
|
|
2944
|
+
},
|
|
2945
|
+
},
|
|
2946
|
+
{
|
|
2947
|
+
urls: ['app.symbiotic.fi'],
|
|
2948
|
+
walletsForProvider: {
|
|
2949
|
+
[IInjectedProviderNames.ethereum]: [
|
|
2950
|
+
Object.assign(Object.assign({}, basicWalletInfo['metamask']), { container: 'div[data-dialog-wrapper="true"]', findIconAndName({ name, container }) {
|
|
2951
|
+
var _a;
|
|
2952
|
+
const modal = getConnectWalletModalByTitle(container, 'CONNECT WALLET');
|
|
2953
|
+
return (_a = (modal && findIconAndNameByName(modal, name, 'auto-search-icon'))) !== null && _a !== void 0 ? _a : null;
|
|
2954
|
+
} }),
|
|
2955
|
+
],
|
|
2956
|
+
},
|
|
2957
|
+
},
|
|
2958
|
+
{
|
|
2959
|
+
urls: ['app.free.tech', 'core.app', 'blast.io'],
|
|
2960
|
+
walletsForProvider: {
|
|
2961
|
+
[IInjectedProviderNames.ethereum]: [
|
|
2962
|
+
Object.assign(Object.assign({}, basicWalletInfo['metamask']), { findIconAndName({ name }) {
|
|
2963
|
+
var _a;
|
|
2964
|
+
return (_a = findIconAndNameByName(document.body, name, 'auto-search-icon')) !== null && _a !== void 0 ? _a : null;
|
|
2965
|
+
} }),
|
|
2966
|
+
],
|
|
2967
|
+
},
|
|
2968
|
+
},
|
|
2969
|
+
{
|
|
2970
|
+
urls: ['yieldlayer.cian.app'],
|
|
2971
|
+
walletsForProvider: {
|
|
2972
|
+
[IInjectedProviderNames.ethereum]: [
|
|
2973
|
+
Object.assign(Object.assign({}, basicWalletInfo['walletconnect']), { container: () => getConnectWalletModalByTitle('div[role="dialog"]', 'Connect Wallet') }),
|
|
2974
|
+
],
|
|
2975
|
+
},
|
|
2976
|
+
},
|
|
2977
|
+
{
|
|
2978
|
+
urls: ['app.unirouter.io'],
|
|
2979
|
+
walletsForProvider: {
|
|
2980
|
+
[IInjectedProviderNames.btc]: [
|
|
2981
|
+
Object.assign(Object.assign({}, basicWalletInfo['unisat']), { findIconAndName({ name }) {
|
|
2982
|
+
const modal = getConnectWalletModalByTitle('div.dropdown.dropdown-end', 'Connect Wallet');
|
|
2983
|
+
return modal && findIconAndNameByIcon('img[alt="Unisat Wallet"]', 'auto-search-text', name, modal);
|
|
2984
|
+
},
|
|
2985
|
+
afterUpdate(textNode, iconNode) {
|
|
2986
|
+
if (textNode) {
|
|
2987
|
+
textNode.textContent = 'OneKey&UniSat';
|
|
2988
|
+
}
|
|
2989
|
+
if (iconNode) {
|
|
2990
|
+
iconNode.style.width = '28px';
|
|
2991
|
+
iconNode.style.height = '28px';
|
|
2992
|
+
}
|
|
2993
|
+
} }),
|
|
2994
|
+
],
|
|
2995
|
+
},
|
|
2996
|
+
},
|
|
2997
|
+
{
|
|
2998
|
+
urls: ['sunswap.com'],
|
|
2999
|
+
walletsForProvider: {
|
|
3000
|
+
[IInjectedProviderNames.tron]: [
|
|
3001
|
+
Object.assign(Object.assign({}, basicWalletInfo['tronlink']), { container: () => {
|
|
3002
|
+
return getConnectWalletModalByTitle('div.ant-modal-content', 'Connect to Wallet');
|
|
3003
|
+
} }),
|
|
3004
|
+
],
|
|
3005
|
+
},
|
|
3006
|
+
},
|
|
3007
|
+
{
|
|
3008
|
+
urls: ['dashboard.threshold.network'],
|
|
3009
|
+
walletsForProvider: {
|
|
3010
|
+
[IInjectedProviderNames.ethereum]: [
|
|
3011
|
+
Object.assign(Object.assign({}, basicWalletInfo['metamask']), { findIconAndName({ name }) {
|
|
3012
|
+
var _a;
|
|
3013
|
+
return (_a = findIconAndNameByName(document.body, name, 'auto-search-icon', {
|
|
3014
|
+
icon: [
|
|
3015
|
+
(icon) => icon.classList.contains('chakra-icon')
|
|
3016
|
+
],
|
|
3017
|
+
text: []
|
|
3018
|
+
})) !== null && _a !== void 0 ? _a : null;
|
|
3019
|
+
} }),
|
|
3020
|
+
],
|
|
3021
|
+
},
|
|
3022
|
+
},
|
|
3023
|
+
{
|
|
3024
|
+
urls: ['app.pell.network'],
|
|
3025
|
+
walletsForProvider: {
|
|
3026
|
+
[IInjectedProviderNames.ethereum]: [
|
|
3027
|
+
Object.assign(Object.assign({}, basicWalletInfo['metamask']), { findIconAndName({ name }) {
|
|
3028
|
+
var _a;
|
|
3029
|
+
return (_a = findIconAndNameByName(document.body, name, 'auto-search-icon')) !== null && _a !== void 0 ? _a : null;
|
|
3030
|
+
} }),
|
|
3031
|
+
],
|
|
3032
|
+
},
|
|
3033
|
+
},
|
|
3034
|
+
{
|
|
3035
|
+
urls: ['www.bitlayer.org'],
|
|
3036
|
+
walletsForProvider: {
|
|
3037
|
+
[IInjectedProviderNames.btc]: [
|
|
3038
|
+
Object.assign(Object.assign({}, basicWalletInfo['unisat']), { findIconAndName({ name }) {
|
|
3039
|
+
var _a;
|
|
3040
|
+
return (_a = findIconAndNameByName(document.body, name, 'auto-search-icon')) !== null && _a !== void 0 ? _a : null;
|
|
3041
|
+
},
|
|
3042
|
+
afterUpdate(textNode, iconNode) {
|
|
3043
|
+
if (iconNode) {
|
|
3044
|
+
iconNode.style.width = '26px';
|
|
3045
|
+
iconNode.style.height = '26px';
|
|
3046
|
+
}
|
|
3047
|
+
} }),
|
|
3048
|
+
],
|
|
3049
|
+
},
|
|
3050
|
+
},
|
|
3051
|
+
{
|
|
3052
|
+
urls: ['app.abex.fi'],
|
|
3053
|
+
walletsForProvider: {
|
|
3054
|
+
[IInjectedProviderNames.sui]: [
|
|
3055
|
+
Object.assign(Object.assign({}, basicWalletInfo['suiwallet']), { container: "div[role='dialog'].wkit-dialog__content" }),
|
|
3056
|
+
],
|
|
3057
|
+
},
|
|
3058
|
+
},
|
|
3059
|
+
{
|
|
3060
|
+
urls: ['dex.bluemove.net'],
|
|
3061
|
+
walletsForProvider: {
|
|
3062
|
+
[IInjectedProviderNames.sui]: [
|
|
3063
|
+
Object.assign(Object.assign({}, basicWalletInfo['suiwallet']), { findIconAndName({ name }) {
|
|
3064
|
+
var _a;
|
|
3065
|
+
return (_a = findIconAndNameByName(document.body, name, 'auto-search-icon')) !== null && _a !== void 0 ? _a : null;
|
|
3066
|
+
},
|
|
3067
|
+
afterUpdate(textNode, iconNode) {
|
|
3068
|
+
if (iconNode) {
|
|
3069
|
+
iconNode.style.width = '32px';
|
|
3070
|
+
iconNode.style.height = '32px';
|
|
3071
|
+
}
|
|
3072
|
+
} }),
|
|
3073
|
+
],
|
|
3074
|
+
},
|
|
3075
|
+
},
|
|
3076
|
+
{
|
|
3077
|
+
urls: ['app.sudo.finance'],
|
|
3078
|
+
walletsForProvider: {
|
|
3079
|
+
[IInjectedProviderNames.sui]: [
|
|
3080
|
+
Object.assign(Object.assign({}, basicWalletInfo['suiwallet']), { container: "div[role='dialog'].wkit-dialog__content" }),
|
|
3081
|
+
],
|
|
3082
|
+
},
|
|
3083
|
+
},
|
|
3084
|
+
{
|
|
3085
|
+
urls: ['app.streamflow.finance'],
|
|
3086
|
+
walletsForProvider: {
|
|
3087
|
+
[IInjectedProviderNames.sui]: [
|
|
3088
|
+
Object.assign(Object.assign({}, basicWalletInfo['suiwallet']), { container: "div.w-full.sm\\:w-100" }),
|
|
3089
|
+
],
|
|
3090
|
+
},
|
|
3091
|
+
},
|
|
3092
|
+
{
|
|
3093
|
+
urls: ['farm.bucketprotocol.io'],
|
|
3094
|
+
walletsForProvider: {
|
|
3095
|
+
[IInjectedProviderNames.sui]: [
|
|
3096
|
+
Object.assign(Object.assign({}, basicWalletInfo['suiwallet']), { findIconAndName({ name }) {
|
|
3097
|
+
const modal = getConnectWalletModalByTitle('div[role="dialog"]', 'Connect a Wallet from list');
|
|
3098
|
+
return modal && findIconAndNameByIcon('img[alt="Sui Wallet"]', 'auto-search-text', name, modal);
|
|
3099
|
+
} }),
|
|
3100
|
+
],
|
|
3101
|
+
},
|
|
3102
|
+
},
|
|
3103
|
+
{
|
|
3104
|
+
urls: ['stake.volosui.com'],
|
|
3105
|
+
walletsForProvider: {
|
|
3106
|
+
[IInjectedProviderNames.sui]: [
|
|
3107
|
+
Object.assign(Object.assign({}, basicWalletInfo['suiwallet']), { container: "div[role='dialog'].wkit-dialog__content" }),
|
|
3108
|
+
],
|
|
3109
|
+
},
|
|
3110
|
+
},
|
|
3111
|
+
{
|
|
3112
|
+
urls: ['app.houstonswap.io'],
|
|
3113
|
+
walletsForProvider: {
|
|
3114
|
+
[IInjectedProviderNames.aptos]: [
|
|
3115
|
+
Object.assign(Object.assign({}, basicWalletInfo['petra']), { container: 'div.relative.rounded-lg.bg-white.shadow' }),
|
|
3116
|
+
],
|
|
3117
|
+
},
|
|
3118
|
+
},
|
|
3119
|
+
{
|
|
3120
|
+
urls: ['app.eternalfinance.io'],
|
|
3121
|
+
walletsForProvider: {
|
|
3122
|
+
[IInjectedProviderNames.aptos]: [
|
|
3123
|
+
Object.assign(Object.assign({}, basicWalletInfo['petra']), { container: 'div.relative.rounded-lg.bg-white.shadow' }),
|
|
3124
|
+
],
|
|
3125
|
+
},
|
|
3126
|
+
},
|
|
3127
|
+
{
|
|
3128
|
+
urls: ['launchpad.movegpt.io'],
|
|
3129
|
+
walletsForProvider: {
|
|
3130
|
+
[IInjectedProviderNames.aptos]: [
|
|
3131
|
+
Object.assign(Object.assign({}, basicWalletInfo['petra']), { findIconAndName({ name }) {
|
|
3132
|
+
var _a;
|
|
3133
|
+
const modal = getConnectWalletModalByTitle('div[role="dialog"]', 'Connect wallet');
|
|
3134
|
+
return (_a = (modal && findIconAndNameByName(modal, name, 'auto-search-icon'))) !== null && _a !== void 0 ? _a : null;
|
|
3135
|
+
} }),
|
|
3136
|
+
],
|
|
3137
|
+
},
|
|
3138
|
+
},
|
|
3139
|
+
{
|
|
3140
|
+
urls: ['tsunami.finance'],
|
|
3141
|
+
walletsForProvider: {
|
|
3142
|
+
[IInjectedProviderNames.ethereum]: [metamaskForRainbowKit, walletConnectForRainbowKit],
|
|
3143
|
+
},
|
|
3144
|
+
},
|
|
3145
|
+
{
|
|
3146
|
+
urls: ['portalbridge.com'],
|
|
3147
|
+
walletsForProvider: {
|
|
3148
|
+
[IInjectedProviderNames.aptos]: [
|
|
3149
|
+
Object.assign(Object.assign({}, basicWalletInfo['martian']), { findIconAndName({ name }) {
|
|
3150
|
+
var _a;
|
|
3151
|
+
const modal = getConnectWalletModalByTitle('div.MuiTypography-root.MuiTypography-body1.css-jeyoma-MuiTypography-root', 'Connect a wallet');
|
|
3152
|
+
return (_a = (modal && findIconAndNameByName(modal, name, 'auto-search-icon'))) !== null && _a !== void 0 ? _a : null;
|
|
3153
|
+
} }),
|
|
3154
|
+
],
|
|
3155
|
+
},
|
|
3156
|
+
},
|
|
3157
|
+
{
|
|
3158
|
+
urls: ['app.aptoslaunch.io'],
|
|
3159
|
+
walletsForProvider: {
|
|
3160
|
+
[IInjectedProviderNames.aptos]: [
|
|
3161
|
+
Object.assign(Object.assign({}, basicWalletInfo['petra']), { findIconAndName(wallet) {
|
|
3162
|
+
return findIconAndNameByIcon(() => {
|
|
3163
|
+
var _a;
|
|
3164
|
+
return (_a = Array.from(document.querySelectorAll('img[alt="Petra icon"]')).filter((e) => isVisible(e))) === null || _a === void 0 ? void 0 : _a[0];
|
|
3165
|
+
}, 'auto-search-text', wallet.name);
|
|
3166
|
+
} }),
|
|
3167
|
+
],
|
|
3168
|
+
},
|
|
3169
|
+
},
|
|
3170
|
+
{
|
|
3171
|
+
urls: ['app.animeswap.org'],
|
|
3172
|
+
walletsForProvider: {
|
|
3173
|
+
[IInjectedProviderNames.aptos]: [
|
|
3174
|
+
Object.assign(Object.assign({}, basicWalletInfo['petra']), { findIconAndName(wallet) {
|
|
3175
|
+
return findIconAndNameByIcon(() => {
|
|
3176
|
+
var _a;
|
|
3177
|
+
return (_a = Array.from(document.querySelectorAll('img[src*="./static/media/petra"]')).filter((e) => isVisible(e))) === null || _a === void 0 ? void 0 : _a[0];
|
|
3178
|
+
}, 'auto-search-text', wallet.name);
|
|
3179
|
+
} }),
|
|
3180
|
+
],
|
|
3181
|
+
},
|
|
3182
|
+
},
|
|
3183
|
+
{
|
|
3184
|
+
urls: ['bluemove.net'],
|
|
3185
|
+
walletsForProvider: {
|
|
3186
|
+
[IInjectedProviderNames.aptos]: [
|
|
3187
|
+
Object.assign(Object.assign({}, basicWalletInfo['petra']), { findIconAndName({ name }) {
|
|
3188
|
+
var _a;
|
|
3189
|
+
return (_a = findIconAndNameByName(document.body, name, 'auto-search-icon')) !== null && _a !== void 0 ? _a : null;
|
|
3190
|
+
},
|
|
3191
|
+
afterUpdate(textNode, iconNode) {
|
|
3192
|
+
if (iconNode) {
|
|
3193
|
+
iconNode.style.width = '28px';
|
|
3194
|
+
iconNode.style.height = '28px';
|
|
2853
3195
|
}
|
|
2854
3196
|
} }),
|
|
2855
3197
|
],
|
|
@@ -13,6 +13,7 @@ import { ProviderScdo } from '@onekeyfe/onekey-scdo-provider';
|
|
|
13
13
|
import { ProviderTon } from '@onekeyfe/onekey-ton-provider';
|
|
14
14
|
import { ProviderNostr } from '@onekeyfe/onekey-nostr-provider';
|
|
15
15
|
import { ProviderBtc, ProviderBtcWallet } from '@onekeyfe/onekey-btc-provider';
|
|
16
|
+
import { NEOLineN3 } from '@onekeyfe/onekey-neo-provider';
|
|
16
17
|
export type IWindowOneKeyHub = {
|
|
17
18
|
debugLogger?: any;
|
|
18
19
|
jsBridge?: JsBridgeBase;
|
|
@@ -35,6 +36,8 @@ export type IWindowOneKeyHub = {
|
|
|
35
36
|
btcwallet?: ProviderBtcWallet;
|
|
36
37
|
alephium?: ProviderAlph;
|
|
37
38
|
scdo?: ProviderScdo;
|
|
39
|
+
NEOLineN3?: NEOLineN3;
|
|
40
|
+
NEOLine?: NEOLineN3;
|
|
38
41
|
$private?: ProviderPrivate;
|
|
39
42
|
$walletInfo?: {
|
|
40
43
|
buildNumber: string;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ProviderEthereum, shimWeb3, registerEIP6963Provider } from '@onekeyfe/onekey-eth-provider';
|
|
2
2
|
import { ProviderPrivate } from '@onekeyfe/onekey-private-provider';
|
|
3
3
|
import { ProviderSolana, registerSolanaWallet } from '@onekeyfe/onekey-solana-provider';
|
|
4
|
-
// import { ProviderStarcoin } from '@onekeyfe/onekey-starcoin-provider';
|
|
5
4
|
import { ProviderAptosMartian, registerAptosWallet, } from '@onekeyfe/onekey-aptos-provider';
|
|
6
5
|
import { ProviderConflux } from '@onekeyfe/onekey-conflux-provider';
|
|
7
6
|
import { ProviderAlph, registerAlephiumProvider } from '@onekeyfe/onekey-alph-provider';
|
|
@@ -18,6 +17,7 @@ import { createTonProviderOpenMask, ProviderTon } from '@onekeyfe/onekey-ton-pro
|
|
|
18
17
|
import { ProviderNostr } from '@onekeyfe/onekey-nostr-provider';
|
|
19
18
|
import { ProviderBtc, ProviderBtcWallet } from '@onekeyfe/onekey-btc-provider';
|
|
20
19
|
import { ProviderAlgo } from '@onekeyfe/onekey-algo-provider';
|
|
20
|
+
import { ProviderNeo, NEOLineN3, emitNeoReadyEvent } from '@onekeyfe/onekey-neo-provider';
|
|
21
21
|
import { hackAllConnectButtons } from './connectButtonHack';
|
|
22
22
|
import { detectWebsiteRiskLevel, listenPageFocus } from './detectRiskWebsite';
|
|
23
23
|
import { injectFloatingButton } from './floatingButton';
|
|
@@ -37,9 +37,6 @@ function injectWeb3Provider({ showFloatingButton = false, } = {}) {
|
|
|
37
37
|
const solana = new ProviderSolana({
|
|
38
38
|
bridge,
|
|
39
39
|
});
|
|
40
|
-
// const starcoin = new ProviderStarcoin({
|
|
41
|
-
// bridge,
|
|
42
|
-
// });
|
|
43
40
|
const martian = new ProviderAptosMartian({
|
|
44
41
|
bridge,
|
|
45
42
|
});
|
|
@@ -84,6 +81,8 @@ function injectWeb3Provider({ showFloatingButton = false, } = {}) {
|
|
|
84
81
|
const btcWallet = new ProviderBtcWallet({ bridge });
|
|
85
82
|
const algorand = new ProviderAlgo({ bridge });
|
|
86
83
|
const scdo = new ProviderScdo({ bridge });
|
|
84
|
+
const neo = new ProviderNeo({ bridge });
|
|
85
|
+
NEOLineN3.instance = neo;
|
|
87
86
|
// providerHub
|
|
88
87
|
const $onekey = Object.assign(Object.assign({}, window.$onekey), { jsBridge: bridge, $private,
|
|
89
88
|
ethereum,
|
|
@@ -100,17 +99,8 @@ function injectWeb3Provider({ showFloatingButton = false, } = {}) {
|
|
|
100
99
|
scdo,
|
|
101
100
|
webln,
|
|
102
101
|
nostr,
|
|
103
|
-
btc, btcwallet: btcWallet, algorand });
|
|
102
|
+
btc, btcwallet: btcWallet, algorand, neo: NEOLineN3 });
|
|
104
103
|
defineWindowProperty('$onekey', $onekey, { enumerable: true, alwaysInject: true });
|
|
105
|
-
// const martianProxy = new Proxy(martian, {
|
|
106
|
-
// get: (target, property, ...args) => {
|
|
107
|
-
// if (property === 'aptosProviderType') {
|
|
108
|
-
// return 'martian';
|
|
109
|
-
// }
|
|
110
|
-
// // eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
111
|
-
// return Reflect.get(target, property, ...args);
|
|
112
|
-
// },
|
|
113
|
-
// });
|
|
114
104
|
defineWindowProperty('ethereum', ethereum);
|
|
115
105
|
// OneKey Ethereum EIP6963 Provider
|
|
116
106
|
registerEIP6963Provider({
|
|
@@ -128,11 +118,9 @@ function injectWeb3Provider({ showFloatingButton = false, } = {}) {
|
|
|
128
118
|
});
|
|
129
119
|
}
|
|
130
120
|
defineWindowProperty('solana', solana);
|
|
131
|
-
defineWindowProperty('phantom', { solana });
|
|
132
|
-
// defineWindowProperty('starcoin', starcoin);
|
|
121
|
+
defineWindowProperty('phantom', { solana, ethereum });
|
|
133
122
|
defineWindowProperty('aptos', martian);
|
|
134
123
|
defineWindowProperty('petra', martian, { enumerable: true });
|
|
135
|
-
// defineWindowProperty('martian', martianProxy, { enumerable: true });
|
|
136
124
|
defineWindowProperty('conflux', conflux);
|
|
137
125
|
defineWindowProperty('alephium', alephium);
|
|
138
126
|
defineWindowProperty('alephiumProviders', {
|
|
@@ -171,6 +159,10 @@ function injectWeb3Provider({ showFloatingButton = false, } = {}) {
|
|
|
171
159
|
// Lightning Network
|
|
172
160
|
defineWindowProperty('webln', webln);
|
|
173
161
|
defineWindowProperty('nostr', nostr);
|
|
162
|
+
// NEO N3
|
|
163
|
+
defineWindowProperty('NEOLineN3', NEOLineN3);
|
|
164
|
+
defineWindowProperty('NEOLine', NEOLineN3);
|
|
165
|
+
emitNeoReadyEvent();
|
|
174
166
|
// ** shim or inject real web3
|
|
175
167
|
//
|
|
176
168
|
// if (!window.web3) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/inpage-providers-hub",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.17",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"cross-inpage-provider"
|
|
6
6
|
],
|
|
@@ -28,26 +28,27 @@
|
|
|
28
28
|
"start": "tsc --watch"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@onekeyfe/cross-inpage-provider-core": "2.2.
|
|
32
|
-
"@onekeyfe/cross-inpage-provider-types": "2.2.
|
|
33
|
-
"@onekeyfe/onekey-algo-provider": "2.2.
|
|
34
|
-
"@onekeyfe/onekey-alph-provider": "2.2.
|
|
35
|
-
"@onekeyfe/onekey-aptos-provider": "2.2.
|
|
36
|
-
"@onekeyfe/onekey-bfc-provider": "2.2.
|
|
37
|
-
"@onekeyfe/onekey-btc-provider": "2.2.
|
|
38
|
-
"@onekeyfe/onekey-cardano-provider": "2.2.
|
|
39
|
-
"@onekeyfe/onekey-conflux-provider": "2.2.
|
|
40
|
-
"@onekeyfe/onekey-cosmos-provider": "2.2.
|
|
41
|
-
"@onekeyfe/onekey-eth-provider": "2.2.
|
|
42
|
-
"@onekeyfe/onekey-
|
|
43
|
-
"@onekeyfe/onekey-
|
|
44
|
-
"@onekeyfe/onekey-
|
|
45
|
-
"@onekeyfe/onekey-
|
|
46
|
-
"@onekeyfe/onekey-
|
|
47
|
-
"@onekeyfe/onekey-
|
|
48
|
-
"@onekeyfe/onekey-
|
|
49
|
-
"@onekeyfe/onekey-
|
|
50
|
-
"@onekeyfe/onekey-
|
|
31
|
+
"@onekeyfe/cross-inpage-provider-core": "2.2.17",
|
|
32
|
+
"@onekeyfe/cross-inpage-provider-types": "2.2.17",
|
|
33
|
+
"@onekeyfe/onekey-algo-provider": "2.2.17",
|
|
34
|
+
"@onekeyfe/onekey-alph-provider": "2.2.17",
|
|
35
|
+
"@onekeyfe/onekey-aptos-provider": "2.2.17",
|
|
36
|
+
"@onekeyfe/onekey-bfc-provider": "2.2.17",
|
|
37
|
+
"@onekeyfe/onekey-btc-provider": "2.2.17",
|
|
38
|
+
"@onekeyfe/onekey-cardano-provider": "2.2.17",
|
|
39
|
+
"@onekeyfe/onekey-conflux-provider": "2.2.17",
|
|
40
|
+
"@onekeyfe/onekey-cosmos-provider": "2.2.17",
|
|
41
|
+
"@onekeyfe/onekey-eth-provider": "2.2.17",
|
|
42
|
+
"@onekeyfe/onekey-neo-provider": "2.2.17",
|
|
43
|
+
"@onekeyfe/onekey-nostr-provider": "2.2.17",
|
|
44
|
+
"@onekeyfe/onekey-polkadot-provider": "2.2.17",
|
|
45
|
+
"@onekeyfe/onekey-private-provider": "2.2.17",
|
|
46
|
+
"@onekeyfe/onekey-scdo-provider": "2.2.17",
|
|
47
|
+
"@onekeyfe/onekey-solana-provider": "2.2.17",
|
|
48
|
+
"@onekeyfe/onekey-sui-provider": "2.2.17",
|
|
49
|
+
"@onekeyfe/onekey-ton-provider": "2.2.17",
|
|
50
|
+
"@onekeyfe/onekey-tron-provider": "2.2.17",
|
|
51
|
+
"@onekeyfe/onekey-webln-provider": "2.2.17",
|
|
51
52
|
"lodash-es": "^4.17.21",
|
|
52
53
|
"preact": "^10.25.1",
|
|
53
54
|
"web3": "^1.7.3"
|
|
@@ -56,5 +57,5 @@
|
|
|
56
57
|
"@types/lodash-es": "^4.17.12",
|
|
57
58
|
"@types/node": "^20.12.7"
|
|
58
59
|
},
|
|
59
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "398d84bed03f60876b6ea5760121f260eff5b82b"
|
|
60
61
|
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const hackConnectButton_1 = require("../hackConnectButton");
|
|
4
|
-
const cross_inpage_provider_types_1 = require("@onekeyfe/cross-inpage-provider-types");
|
|
5
|
-
const consts_1 = require("../consts");
|
|
6
|
-
exports.default = () => (0, hackConnectButton_1.hackConnectButton)({
|
|
7
|
-
urls: ['stake.lido.fi'],
|
|
8
|
-
providers: [cross_inpage_provider_types_1.IInjectedProviderNames.ethereum],
|
|
9
|
-
replaceMethod(options) {
|
|
10
|
-
var _a;
|
|
11
|
-
const replaceFunc = ({ findName, icon, text, }) => {
|
|
12
|
-
var _a, _b;
|
|
13
|
-
const buttons = Array.from((_b = (_a = document.querySelector('div.idjqeC')) === null || _a === void 0 ? void 0 : _a.querySelectorAll('button')) !== null && _b !== void 0 ? _b : []);
|
|
14
|
-
const findButton = buttons.find((button) => {
|
|
15
|
-
const span = button.querySelector('span > span > div');
|
|
16
|
-
if (span && span.innerText === findName) {
|
|
17
|
-
return button;
|
|
18
|
-
}
|
|
19
|
-
return undefined;
|
|
20
|
-
});
|
|
21
|
-
if (findButton) {
|
|
22
|
-
// change button text
|
|
23
|
-
const span = findButton.querySelector('div');
|
|
24
|
-
if (span) {
|
|
25
|
-
span.innerText = text;
|
|
26
|
-
}
|
|
27
|
-
// change icon
|
|
28
|
-
const imgContainer = findButton.querySelector('span > span >span');
|
|
29
|
-
if (imgContainer) {
|
|
30
|
-
(0, hackConnectButton_1.createNewImageToContainer)({
|
|
31
|
-
container: imgContainer,
|
|
32
|
-
icon: icon,
|
|
33
|
-
removeSvg: true,
|
|
34
|
-
onCreated(img) {
|
|
35
|
-
img.style.maxWidth = '48px';
|
|
36
|
-
img.style.maxHeight = '48px';
|
|
37
|
-
},
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
if ((_a = options === null || options === void 0 ? void 0 : options.providers) === null || _a === void 0 ? void 0 : _a.includes(cross_inpage_provider_types_1.IInjectedProviderNames.ethereum)) {
|
|
43
|
-
replaceFunc({
|
|
44
|
-
findName: 'MetaMask',
|
|
45
|
-
icon: consts_1.WALLET_CONNECT_INFO.metamask.icon,
|
|
46
|
-
text: consts_1.WALLET_CONNECT_INFO.metamask.text,
|
|
47
|
-
});
|
|
48
|
-
replaceFunc({
|
|
49
|
-
findName: 'WalletConnect',
|
|
50
|
-
icon: consts_1.WALLET_CONNECT_INFO.walletconnect.icon,
|
|
51
|
-
text: consts_1.WALLET_CONNECT_INFO.walletconnect.text,
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
});
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const hackConnectButton_1 = require("../hackConnectButton");
|
|
4
|
-
const cross_inpage_provider_types_1 = require("@onekeyfe/cross-inpage-provider-types");
|
|
5
|
-
const consts_1 = require("../consts");
|
|
6
|
-
exports.default = () => (0, hackConnectButton_1.hackConnectButton)({
|
|
7
|
-
urls: ['stake.rocketpool.net'],
|
|
8
|
-
providers: [cross_inpage_provider_types_1.IInjectedProviderNames.ethereum],
|
|
9
|
-
replaceMethod(options) {
|
|
10
|
-
var _a;
|
|
11
|
-
const replaceFunc = ({ findName, icon, text, }) => {
|
|
12
|
-
const walletBtnList = Array.from(document.querySelectorAll(`#headlessui-portal-root [role="dialog"] ul li`));
|
|
13
|
-
for (const walletBtn of walletBtnList) {
|
|
14
|
-
if ((walletBtn === null || walletBtn === void 0 ? void 0 : walletBtn.innerText) === findName) {
|
|
15
|
-
const textNode = walletBtn === null || walletBtn === void 0 ? void 0 : walletBtn.querySelector('div span');
|
|
16
|
-
if (textNode) {
|
|
17
|
-
textNode.innerText = text;
|
|
18
|
-
}
|
|
19
|
-
const img = walletBtn === null || walletBtn === void 0 ? void 0 : walletBtn.querySelector('img');
|
|
20
|
-
if (img) {
|
|
21
|
-
img.src = icon; //keep the original size and style
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
if ((_a = options === null || options === void 0 ? void 0 : options.providers) === null || _a === void 0 ? void 0 : _a.includes(cross_inpage_provider_types_1.IInjectedProviderNames.ethereum)) {
|
|
27
|
-
replaceFunc({
|
|
28
|
-
findName: 'Metamask',
|
|
29
|
-
icon: consts_1.WALLET_CONNECT_INFO.metamask.icon,
|
|
30
|
-
text: consts_1.WALLET_CONNECT_INFO.metamask.text,
|
|
31
|
-
});
|
|
32
|
-
replaceFunc({
|
|
33
|
-
findName: 'Wallet Connect',
|
|
34
|
-
icon: consts_1.WALLET_CONNECT_INFO.walletconnect.icon,
|
|
35
|
-
text: consts_1.WALLET_CONNECT_INFO.walletconnect.text,
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
});
|