@keplr-wallet/provider 0.12.222 → 0.12.224-rc.0
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/build/core.d.ts +7 -7
- package/build/core.js +153 -107
- package/build/core.js.map +1 -1
- package/build/inject.js +0 -3
- package/build/inject.js.map +1 -1
- package/package.json +4 -4
- package/src/core.ts +289 -117
- package/src/inject.ts +0 -4
package/src/core.ts
CHANGED
@@ -1603,7 +1603,9 @@ class EthereumProvider extends EventEmitter implements IEthereumProvider {
|
|
1603
1603
|
super();
|
1604
1604
|
}
|
1605
1605
|
|
1606
|
-
protected async protectedEnableAccess(
|
1606
|
+
protected async protectedEnableAccess(
|
1607
|
+
newCurrentChainId?: string
|
1608
|
+
): Promise<void> {
|
1607
1609
|
return new Promise((resolve, reject) => {
|
1608
1610
|
let f = false;
|
1609
1611
|
|
@@ -1612,7 +1614,9 @@ class EthereumProvider extends EventEmitter implements IEthereumProvider {
|
|
1612
1614
|
BACKGROUND_PORT,
|
1613
1615
|
"permission-interactive",
|
1614
1616
|
"enable-access-for-evm",
|
1615
|
-
{
|
1617
|
+
{
|
1618
|
+
chainId: newCurrentChainId,
|
1619
|
+
}
|
1616
1620
|
)
|
1617
1621
|
.then(resolve)
|
1618
1622
|
.catch(reject)
|
@@ -1626,6 +1630,36 @@ class EthereumProvider extends EventEmitter implements IEthereumProvider {
|
|
1626
1630
|
});
|
1627
1631
|
}
|
1628
1632
|
|
1633
|
+
protected async protectedGetNewCurrentChainIdFromRequest(
|
1634
|
+
method: string,
|
1635
|
+
params?: readonly unknown[] | Record<string, unknown>
|
1636
|
+
): Promise<string | undefined> {
|
1637
|
+
return await sendSimpleMessage(
|
1638
|
+
this.requester,
|
1639
|
+
BACKGROUND_PORT,
|
1640
|
+
"keyring-ethereum",
|
1641
|
+
"get-new-current-chain-id-for-evm",
|
1642
|
+
{
|
1643
|
+
method,
|
1644
|
+
params,
|
1645
|
+
}
|
1646
|
+
);
|
1647
|
+
}
|
1648
|
+
|
1649
|
+
protected async protectedCheckNeedEnableAccess(
|
1650
|
+
method: string
|
1651
|
+
): Promise<boolean> {
|
1652
|
+
return await sendSimpleMessage(
|
1653
|
+
this.requester,
|
1654
|
+
BACKGROUND_PORT,
|
1655
|
+
"keyring-ethereum",
|
1656
|
+
"check-need-enable-access-for-evm",
|
1657
|
+
{
|
1658
|
+
method,
|
1659
|
+
}
|
1660
|
+
);
|
1661
|
+
}
|
1662
|
+
|
1629
1663
|
isConnected(): boolean {
|
1630
1664
|
return true;
|
1631
1665
|
}
|
@@ -1648,8 +1682,12 @@ class EthereumProvider extends EventEmitter implements IEthereumProvider {
|
|
1648
1682
|
// XXX: 원래 enable을 미리하지 않아도 백그라운드에서 알아서 처리해주는 시스템이였는데...
|
1649
1683
|
// side panel에서는 불가능하기 때문에 이젠 provider에서 permission도 관리해줘야한다...
|
1650
1684
|
// request의 경우는 일종의 쿼리이기 때문에 언제 결과가 올지 알 수 없다. 그러므로 미리 권한 처리를 해야한다.
|
1651
|
-
if (method
|
1652
|
-
|
1685
|
+
if (await this.protectedCheckNeedEnableAccess(method)) {
|
1686
|
+
// 활성화할 체인을 변경하는 요청인 경우, 권한 승인하는 UI에서 변경할 체인 아이디가 기본으로 선택되도록 하기 위함이다.
|
1687
|
+
// 로직이 파편화 되는 것을 막기 위해 백그라운드에서 처리해서 값을 받아오는 방식으로 구현한다.
|
1688
|
+
const newCurrentChainId =
|
1689
|
+
await this.protectedGetNewCurrentChainIdFromRequest(method, params);
|
1690
|
+
await this.protectedEnableAccess(newCurrentChainId);
|
1653
1691
|
}
|
1654
1692
|
|
1655
1693
|
return new Promise((resolve, reject) => {
|
@@ -1721,7 +1759,9 @@ class StarknetProvider implements IStarknetProvider {
|
|
1721
1759
|
protected readonly requester: MessageRequester
|
1722
1760
|
) {}
|
1723
1761
|
|
1724
|
-
protected async protectedEnableAccess(
|
1762
|
+
protected async protectedEnableAccess(
|
1763
|
+
newCurrentChainId?: string
|
1764
|
+
): Promise<void> {
|
1725
1765
|
return new Promise((resolve, reject) => {
|
1726
1766
|
let f = false;
|
1727
1767
|
|
@@ -1730,7 +1770,9 @@ class StarknetProvider implements IStarknetProvider {
|
|
1730
1770
|
BACKGROUND_PORT,
|
1731
1771
|
"permission-interactive",
|
1732
1772
|
"enable-access-for-starknet",
|
1733
|
-
{
|
1773
|
+
{
|
1774
|
+
chainId: newCurrentChainId,
|
1775
|
+
}
|
1734
1776
|
)
|
1735
1777
|
.then(resolve)
|
1736
1778
|
.catch(reject)
|
@@ -1744,6 +1786,38 @@ class StarknetProvider implements IStarknetProvider {
|
|
1744
1786
|
});
|
1745
1787
|
}
|
1746
1788
|
|
1789
|
+
protected async protectedGetNewCurrentChainIdFromRequest(
|
1790
|
+
method: string,
|
1791
|
+
params?: readonly unknown[] | Record<string, unknown>
|
1792
|
+
): Promise<string | undefined> {
|
1793
|
+
return await sendSimpleMessage(
|
1794
|
+
this.requester,
|
1795
|
+
BACKGROUND_PORT,
|
1796
|
+
"keyring-starknet",
|
1797
|
+
"get-new-current-chain-id-for-starknet",
|
1798
|
+
{
|
1799
|
+
method,
|
1800
|
+
params,
|
1801
|
+
}
|
1802
|
+
);
|
1803
|
+
}
|
1804
|
+
|
1805
|
+
protected async protectedCheckNeedEnableAccess(
|
1806
|
+
method: string,
|
1807
|
+
params?: readonly unknown[] | Record<string, unknown>
|
1808
|
+
): Promise<boolean> {
|
1809
|
+
return await sendSimpleMessage(
|
1810
|
+
this.requester,
|
1811
|
+
BACKGROUND_PORT,
|
1812
|
+
"keyring-starknet",
|
1813
|
+
"check-need-enable-access-for-starknet",
|
1814
|
+
{
|
1815
|
+
method,
|
1816
|
+
params,
|
1817
|
+
}
|
1818
|
+
);
|
1819
|
+
}
|
1820
|
+
|
1747
1821
|
async request<T = unknown>({
|
1748
1822
|
type,
|
1749
1823
|
params,
|
@@ -1758,21 +1832,10 @@ class StarknetProvider implements IStarknetProvider {
|
|
1758
1832
|
// XXX: 원래 enable을 미리하지 않아도 백그라운드에서 알아서 처리해주는 시스템이였는데...
|
1759
1833
|
// side panel에서는 불가능하기 때문에 이젠 provider에서 permission도 관리해줘야한다...
|
1760
1834
|
// request의 경우는 일종의 쿼리이기 때문에 언제 결과가 올지 알 수 없다. 그러므로 미리 권한 처리를 해야한다.
|
1761
|
-
|
1762
|
-
|
1763
|
-
|
1764
|
-
|
1765
|
-
if (type === "wallet_getPermissions") {
|
1766
|
-
skipEnable = true;
|
1767
|
-
}
|
1768
|
-
if (type === "wallet_requestAccounts") {
|
1769
|
-
if (!Array.isArray(params) && params?.["silent_mode"]) {
|
1770
|
-
skipEnable = true;
|
1771
|
-
}
|
1772
|
-
}
|
1773
|
-
|
1774
|
-
if (!skipEnable) {
|
1775
|
-
await this.protectedEnableAccess();
|
1835
|
+
if (await this.protectedCheckNeedEnableAccess(type, params)) {
|
1836
|
+
const newCurrentChainId =
|
1837
|
+
await this.protectedGetNewCurrentChainIdFromRequest(type, params);
|
1838
|
+
await this.protectedEnableAccess(newCurrentChainId);
|
1776
1839
|
}
|
1777
1840
|
|
1778
1841
|
return new Promise((resolve, reject) => {
|
@@ -1815,16 +1878,6 @@ class StarknetProvider implements IStarknetProvider {
|
|
1815
1878
|
}
|
1816
1879
|
}
|
1817
1880
|
|
1818
|
-
const sidePanelOpenNeededBitcoinMethods = [
|
1819
|
-
"switchNetwork",
|
1820
|
-
"switchChain",
|
1821
|
-
"signMessage",
|
1822
|
-
"sendBitcoin",
|
1823
|
-
"pushTx",
|
1824
|
-
"signPsbt",
|
1825
|
-
"signPsbts",
|
1826
|
-
];
|
1827
|
-
|
1828
1881
|
class BitcoinProvider extends EventEmitter implements IBitcoinProvider {
|
1829
1882
|
constructor(
|
1830
1883
|
protected readonly keplr: Keplr,
|
@@ -1856,27 +1909,61 @@ class BitcoinProvider extends EventEmitter implements IBitcoinProvider {
|
|
1856
1909
|
});
|
1857
1910
|
}
|
1858
1911
|
|
1859
|
-
|
1860
|
-
|
1861
|
-
|
1862
|
-
|
1863
|
-
|
1864
|
-
|
1865
|
-
|
1866
|
-
|
1867
|
-
|
1868
|
-
|
1912
|
+
async getAccounts(): Promise<string[]> {
|
1913
|
+
return await sendSimpleMessage(
|
1914
|
+
this.requester,
|
1915
|
+
BACKGROUND_PORT,
|
1916
|
+
"keyring-bitcoin",
|
1917
|
+
"request-bitcoin-get-accounts",
|
1918
|
+
{}
|
1919
|
+
);
|
1920
|
+
}
|
1921
|
+
|
1922
|
+
async requestAccounts(): Promise<string[]> {
|
1923
|
+
await this.protectedEnableAccess();
|
1924
|
+
|
1925
|
+
return await sendSimpleMessage(
|
1926
|
+
this.requester,
|
1927
|
+
BACKGROUND_PORT,
|
1928
|
+
"keyring-bitcoin",
|
1929
|
+
"request-bitcoin-request-accounts",
|
1930
|
+
{}
|
1931
|
+
);
|
1932
|
+
}
|
1933
|
+
|
1934
|
+
async disconnect(): Promise<void> {
|
1935
|
+
return await sendSimpleMessage(
|
1936
|
+
this.requester,
|
1937
|
+
BACKGROUND_PORT,
|
1938
|
+
"keyring-bitcoin",
|
1939
|
+
"request-bitcoin-disconnect",
|
1940
|
+
{}
|
1941
|
+
);
|
1942
|
+
}
|
1943
|
+
|
1944
|
+
async getNetwork(): Promise<BitcoinNetwork> {
|
1945
|
+
await this.protectedEnableAccess();
|
1946
|
+
|
1947
|
+
return await sendSimpleMessage(
|
1948
|
+
this.requester,
|
1949
|
+
BACKGROUND_PORT,
|
1950
|
+
"keyring-bitcoin",
|
1951
|
+
"request-bitcoin-get-network",
|
1952
|
+
{}
|
1953
|
+
);
|
1954
|
+
}
|
1869
1955
|
|
1956
|
+
async switchNetwork(network: BitcoinNetwork): Promise<BitcoinNetwork> {
|
1957
|
+
// Side panel을 어차피 열어야 하는 메소드이므로 여기선 권한 체크 요청을 생략한다.
|
1870
1958
|
return new Promise((resolve, reject) => {
|
1871
1959
|
let f = false;
|
1872
1960
|
sendSimpleMessage(
|
1873
1961
|
this.requester,
|
1874
1962
|
BACKGROUND_PORT,
|
1875
1963
|
"keyring-bitcoin",
|
1876
|
-
"request-
|
1964
|
+
"request-bitcoin-switch-network",
|
1877
1965
|
{
|
1878
|
-
|
1879
|
-
params,
|
1966
|
+
network,
|
1880
1967
|
}
|
1881
1968
|
)
|
1882
1969
|
.then(resolve)
|
@@ -1884,71 +1971,64 @@ class BitcoinProvider extends EventEmitter implements IBitcoinProvider {
|
|
1884
1971
|
.finally(() => (f = true));
|
1885
1972
|
|
1886
1973
|
setTimeout(() => {
|
1887
|
-
if (!f
|
1974
|
+
if (!f) {
|
1888
1975
|
this.keplr.protectedTryOpenSidePanelIfEnabled();
|
1889
1976
|
}
|
1890
1977
|
}, 100);
|
1891
1978
|
});
|
1892
1979
|
}
|
1893
1980
|
|
1894
|
-
async getAccounts(): Promise<string[]> {
|
1895
|
-
return this.protectedRequestMethod({
|
1896
|
-
method: "getAccounts",
|
1897
|
-
params: [],
|
1898
|
-
});
|
1899
|
-
}
|
1900
|
-
|
1901
|
-
async requestAccounts(): Promise<string[]> {
|
1902
|
-
return this.protectedRequestMethod({
|
1903
|
-
method: "requestAccounts",
|
1904
|
-
params: [],
|
1905
|
-
});
|
1906
|
-
}
|
1907
|
-
|
1908
|
-
async disconnect(): Promise<void> {
|
1909
|
-
return this.protectedRequestMethod({
|
1910
|
-
method: "disconnect",
|
1911
|
-
params: [],
|
1912
|
-
});
|
1913
|
-
}
|
1914
|
-
|
1915
|
-
async getNetwork(): Promise<BitcoinNetwork> {
|
1916
|
-
return this.protectedRequestMethod({
|
1917
|
-
method: "getNetwork",
|
1918
|
-
params: [],
|
1919
|
-
});
|
1920
|
-
}
|
1921
|
-
|
1922
|
-
async switchNetwork(network: BitcoinNetwork): Promise<BitcoinNetwork> {
|
1923
|
-
return this.protectedRequestMethod({
|
1924
|
-
method: "switchNetwork",
|
1925
|
-
params: [network],
|
1926
|
-
});
|
1927
|
-
}
|
1928
|
-
|
1929
1981
|
async getChain(): Promise<{
|
1930
1982
|
enum: BitcoinChainType;
|
1931
1983
|
name: string;
|
1932
1984
|
network: BitcoinNetwork;
|
1933
1985
|
}> {
|
1934
|
-
|
1935
|
-
|
1936
|
-
|
1937
|
-
|
1986
|
+
await this.protectedEnableAccess();
|
1987
|
+
|
1988
|
+
return await sendSimpleMessage(
|
1989
|
+
this.requester,
|
1990
|
+
BACKGROUND_PORT,
|
1991
|
+
"keyring-bitcoin",
|
1992
|
+
"request-bitcoin-get-chain",
|
1993
|
+
{}
|
1994
|
+
);
|
1938
1995
|
}
|
1939
1996
|
|
1940
1997
|
async switchChain(chain: BitcoinChainType): Promise<BitcoinChainType> {
|
1941
|
-
|
1942
|
-
|
1943
|
-
|
1998
|
+
// Side panel을 어차피 열어야 하는 메소드이므로 여기선 권한 체크 요청을 생략한다.
|
1999
|
+
return new Promise((resolve, reject) => {
|
2000
|
+
let f = false;
|
2001
|
+
sendSimpleMessage(
|
2002
|
+
this.requester,
|
2003
|
+
BACKGROUND_PORT,
|
2004
|
+
"keyring-bitcoin",
|
2005
|
+
"request-bitcoin-switch-chain",
|
2006
|
+
{
|
2007
|
+
chainType: chain,
|
2008
|
+
}
|
2009
|
+
)
|
2010
|
+
.then(resolve)
|
2011
|
+
.catch(reject)
|
2012
|
+
.finally(() => (f = true));
|
2013
|
+
|
2014
|
+
setTimeout(() => {
|
2015
|
+
if (!f) {
|
2016
|
+
this.keplr.protectedTryOpenSidePanelIfEnabled();
|
2017
|
+
}
|
2018
|
+
}, 100);
|
1944
2019
|
});
|
1945
2020
|
}
|
1946
2021
|
|
1947
2022
|
async getPublicKey(): Promise<string> {
|
1948
|
-
|
1949
|
-
|
1950
|
-
|
1951
|
-
|
2023
|
+
await this.protectedEnableAccess();
|
2024
|
+
|
2025
|
+
return await sendSimpleMessage(
|
2026
|
+
this.requester,
|
2027
|
+
BACKGROUND_PORT,
|
2028
|
+
"keyring-bitcoin",
|
2029
|
+
"request-bitcoin-get-public-key",
|
2030
|
+
{}
|
2031
|
+
);
|
1952
2032
|
}
|
1953
2033
|
|
1954
2034
|
async getBalance(): Promise<{
|
@@ -1956,48 +2036,121 @@ class BitcoinProvider extends EventEmitter implements IBitcoinProvider {
|
|
1956
2036
|
unconfirmed: number;
|
1957
2037
|
total: number;
|
1958
2038
|
}> {
|
1959
|
-
|
1960
|
-
|
1961
|
-
|
1962
|
-
|
2039
|
+
await this.protectedEnableAccess();
|
2040
|
+
|
2041
|
+
return await sendSimpleMessage(
|
2042
|
+
this.requester,
|
2043
|
+
BACKGROUND_PORT,
|
2044
|
+
"keyring-bitcoin",
|
2045
|
+
"request-bitcoin-get-balance",
|
2046
|
+
{}
|
2047
|
+
);
|
1963
2048
|
}
|
1964
2049
|
|
1965
2050
|
async getInscriptions(): Promise<string[]> {
|
1966
|
-
|
1967
|
-
|
1968
|
-
|
1969
|
-
|
2051
|
+
await this.protectedEnableAccess();
|
2052
|
+
|
2053
|
+
return await sendSimpleMessage(
|
2054
|
+
this.requester,
|
2055
|
+
BACKGROUND_PORT,
|
2056
|
+
"keyring-bitcoin",
|
2057
|
+
"request-bitcoin-get-inscriptions",
|
2058
|
+
{}
|
2059
|
+
);
|
1970
2060
|
}
|
1971
2061
|
|
1972
2062
|
async signMessage(
|
1973
2063
|
message: string,
|
1974
|
-
|
2064
|
+
signType?: BitcoinSignMessageType
|
1975
2065
|
): Promise<string> {
|
1976
|
-
//
|
1977
|
-
return
|
1978
|
-
|
1979
|
-
|
2066
|
+
// Side panel을 어차피 열어야 하는 메소드이므로 여기선 권한 체크 요청을 생략한다.
|
2067
|
+
return new Promise((resolve, reject) => {
|
2068
|
+
let f = false;
|
2069
|
+
sendSimpleMessage(
|
2070
|
+
this.requester,
|
2071
|
+
BACKGROUND_PORT,
|
2072
|
+
"keyring-bitcoin",
|
2073
|
+
"request-sign-bitcoin-message",
|
2074
|
+
{
|
2075
|
+
message,
|
2076
|
+
signType,
|
2077
|
+
}
|
2078
|
+
)
|
2079
|
+
.then(resolve)
|
2080
|
+
.catch(reject)
|
2081
|
+
.finally(() => (f = true));
|
2082
|
+
|
2083
|
+
setTimeout(() => {
|
2084
|
+
if (!f) {
|
2085
|
+
this.keplr.protectedTryOpenSidePanelIfEnabled();
|
2086
|
+
}
|
2087
|
+
}, 100);
|
1980
2088
|
});
|
1981
2089
|
}
|
1982
2090
|
|
1983
2091
|
async sendBitcoin(to: string, amount: number): Promise<string> {
|
1984
|
-
|
1985
|
-
|
1986
|
-
|
2092
|
+
// Side panel을 어차피 열어야 하는 메소드이므로 여기선 권한 체크 요청을 생략한다.
|
2093
|
+
return new Promise((resolve, reject) => {
|
2094
|
+
let f = false;
|
2095
|
+
sendSimpleMessage(
|
2096
|
+
this.requester,
|
2097
|
+
BACKGROUND_PORT,
|
2098
|
+
"keyring-bitcoin",
|
2099
|
+
"request-bitcoin-send-bitcoin",
|
2100
|
+
{
|
2101
|
+
to,
|
2102
|
+
amount,
|
2103
|
+
}
|
2104
|
+
)
|
2105
|
+
.then(resolve)
|
2106
|
+
.catch(reject)
|
2107
|
+
.finally(() => (f = true));
|
2108
|
+
|
2109
|
+
setTimeout(() => {
|
2110
|
+
if (!f) {
|
2111
|
+
this.keplr.protectedTryOpenSidePanelIfEnabled();
|
2112
|
+
}
|
2113
|
+
}, 100);
|
1987
2114
|
});
|
1988
2115
|
}
|
1989
2116
|
|
1990
2117
|
async pushTx(rawTxHex: string): Promise<string> {
|
1991
|
-
|
1992
|
-
|
1993
|
-
|
1994
|
-
|
2118
|
+
await this.protectedEnableAccess();
|
2119
|
+
|
2120
|
+
return await sendSimpleMessage(
|
2121
|
+
this.requester,
|
2122
|
+
BACKGROUND_PORT,
|
2123
|
+
"keyring-bitcoin",
|
2124
|
+
"request-bitcoin-push-tx",
|
2125
|
+
{
|
2126
|
+
rawTxHex,
|
2127
|
+
}
|
2128
|
+
);
|
1995
2129
|
}
|
1996
2130
|
|
1997
2131
|
async signPsbt(psbtHex: string, options?: SignPsbtOptions): Promise<string> {
|
1998
|
-
|
1999
|
-
|
2000
|
-
|
2132
|
+
// Side panel을 어차피 열어야 하는 메소드이므로 여기선 권한 체크 요청을 생략한다.
|
2133
|
+
return new Promise((resolve, reject) => {
|
2134
|
+
let f = false;
|
2135
|
+
sendSimpleMessage(
|
2136
|
+
this.requester,
|
2137
|
+
BACKGROUND_PORT,
|
2138
|
+
"keyring-bitcoin",
|
2139
|
+
"request-sign-bitcoin-psbt",
|
2140
|
+
{
|
2141
|
+
psbtHex,
|
2142
|
+
options,
|
2143
|
+
}
|
2144
|
+
)
|
2145
|
+
.then(resolve)
|
2146
|
+
.catch(reject)
|
2147
|
+
.finally(() => (f = true));
|
2148
|
+
|
2149
|
+
setTimeout(() => {
|
2150
|
+
if (!f) {
|
2151
|
+
this.keplr.protectedTryOpenSidePanelIfEnabled();
|
2152
|
+
}
|
2153
|
+
}, 100);
|
2001
2154
|
});
|
2002
2155
|
}
|
2003
2156
|
|
@@ -2005,9 +2158,28 @@ class BitcoinProvider extends EventEmitter implements IBitcoinProvider {
|
|
2005
2158
|
psbtsHexes: string[],
|
2006
2159
|
options?: SignPsbtOptions
|
2007
2160
|
): Promise<string[]> {
|
2008
|
-
|
2009
|
-
|
2010
|
-
|
2161
|
+
// Side panel을 어차피 열어야 하는 메소드이므로 여기선 권한 체크 요청을 생략한다.
|
2162
|
+
return new Promise((resolve, reject) => {
|
2163
|
+
let f = false;
|
2164
|
+
sendSimpleMessage(
|
2165
|
+
this.requester,
|
2166
|
+
BACKGROUND_PORT,
|
2167
|
+
"keyring-bitcoin",
|
2168
|
+
"request-sign-bitcoin-psbts",
|
2169
|
+
{
|
2170
|
+
psbtsHexes,
|
2171
|
+
options,
|
2172
|
+
}
|
2173
|
+
)
|
2174
|
+
.then(resolve)
|
2175
|
+
.catch(reject)
|
2176
|
+
.finally(() => (f = true));
|
2177
|
+
|
2178
|
+
setTimeout(() => {
|
2179
|
+
if (!f) {
|
2180
|
+
this.keplr.protectedTryOpenSidePanelIfEnabled();
|
2181
|
+
}
|
2182
|
+
}, 100);
|
2011
2183
|
});
|
2012
2184
|
}
|
2013
2185
|
|
package/src/inject.ts
CHANGED
@@ -1401,10 +1401,6 @@ class EthereumProvider extends EventEmitter implements IEthereumProvider {
|
|
1401
1401
|
await this._initProviderState();
|
1402
1402
|
}
|
1403
1403
|
|
1404
|
-
if (method === "eth_accounts") {
|
1405
|
-
return (this.selectedAddress ? [this.selectedAddress] : []) as T;
|
1406
|
-
}
|
1407
|
-
|
1408
1404
|
return await this._requestMethod<T>("request", {
|
1409
1405
|
method,
|
1410
1406
|
params,
|