Skip to content

Commit eaae406

Browse files
authored
Merge pull request #93 from blocknative/fix/temporary-remove-squarelink
Temporarily remove squarelink due to bug. Closes #91
2 parents bbb43ec + 8202cd8 commit eaae406

File tree

5 files changed

+433
-149
lines changed

5 files changed

+433
-149
lines changed

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@
4949
"bowser": "^2.5.2",
5050
"fortmatic": "^0.8.2",
5151
"promise-cancelable": "^2.1.1",
52-
"regenerator-runtime": "^0.13.3",
53-
"squarelink": "^1.1.3"
52+
"regenerator-runtime": "^0.13.3"
5453
},
5554
"scripts": {
5655
"build": "rollup -c && babel dist/onboard.esm.js --out-file dist/onboard.esm.js && babel dist/onboard.umd.js --out-file dist/onboard.umd.js --minified",

rollup.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export default [
9797
'@portis/web3',
9898
'@walletconnect/web3-provider',
9999
'fortmatic',
100-
'squarelink',
100+
// 'squarelink',
101101
'authereum',
102102
'regenerator-runtime/runtime'
103103
]

src/modules/select/index.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import trust from './wallets/trust'
66
import portis from './wallets/portis'
77
import fortmatic from './wallets/fortmatic'
88
import authereum from './wallets/authereum'
9-
import squarelink from './wallets/squarelink'
9+
// import squarelink from './wallets/squarelink'
1010
import opera from './wallets/opera'
1111
import operaTouch from './wallets/opera-touch'
1212

@@ -22,7 +22,7 @@ function defaults(options: SelectDefaultsOptions): WalletSelectModule {
2222
networkId,
2323
fortmaticInit,
2424
portisInit,
25-
squarelinkInit,
25+
// squarelinkInit,
2626
walletConnectInit,
2727
preferredWallets
2828
} = options
@@ -49,10 +49,10 @@ function defaults(options: SelectDefaultsOptions): WalletSelectModule {
4949
)
5050
}
5151

52-
if (squarelinkInit) {
53-
desktopWallets.push(squarelink({ ...squarelinkInit, networkId }))
54-
mobileWallets.push(squarelink({ ...squarelinkInit, networkId }))
55-
}
52+
// if (squarelinkInit) {
53+
// desktopWallets.push(squarelink({ ...squarelinkInit, networkId }))
54+
// mobileWallets.push(squarelink({ ...squarelinkInit, networkId }))
55+
// }
5656

5757
desktopWallets.push(authereum({ networkId }))
5858
mobileWallets.push(authereum({ networkId }))
@@ -98,7 +98,7 @@ export default {
9898
portis,
9999
fortmatic,
100100
authereum,
101-
squarelink,
101+
// squarelink,
102102
opera,
103103
operaTouch
104104
}
Lines changed: 56 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,66 @@
1-
import Squarelink from 'squarelink'
1+
// import Squarelink from 'squarelink'
22

3-
import { networkName, networkToId } from '../../../utilities'
4-
import { validateType } from '../../../validation'
5-
import sqlkIcon from '../wallet-icons/icon-squarelink.svg'
6-
import { SdkWalletOptions, WalletModule, Helpers } from '../../../interfaces'
3+
// import { networkName, networkToId } from '../../../utilities'
4+
// import { validateType } from '../../../validation'
5+
// import sqlkIcon from '../wallet-icons/icon-squarelink.svg'
6+
// import { SdkWalletOptions, WalletModule, Helpers } from '../../../interfaces'
77

8-
function squarelink(options: SdkWalletOptions): WalletModule {
9-
validateType({ name: 'Squarelink Options', value: options, type: 'object' })
8+
// function squarelink(options: SdkWalletOptions): WalletModule {
9+
// validateType({ name: 'Squarelink Options', value: options, type: 'object' })
1010

11-
const { apiKey, networkId } = options
11+
// const { apiKey, networkId } = options
1212

13-
validateType({ name: 'apiKey', value: apiKey, type: 'string' })
14-
validateType({ name: 'networkId', value: networkId, type: 'number' })
13+
// validateType({ name: 'apiKey', value: apiKey, type: 'string' })
14+
// validateType({ name: 'networkId', value: networkId, type: 'number' })
1515

16-
return {
17-
name: 'Squarelink',
18-
iconSrc: sqlkIcon,
19-
wallet: (helpers: Helpers) => {
20-
const { BigNumber } = helpers
16+
// return {
17+
// name: 'Squarelink',
18+
// iconSrc: sqlkIcon,
19+
// wallet: (helpers: Helpers) => {
20+
// const { BigNumber } = helpers
2121

22-
const instance = new Squarelink(apiKey, networkName(networkId), {
23-
useSync: true
24-
})
22+
// const instance = new Squarelink(apiKey, networkName(networkId), {
23+
// useSync: true
24+
// })
2525

26-
const provider = instance.getProviderSync()
26+
// const provider = instance.getProviderSync()
2727

28-
return {
29-
provider,
30-
instance,
31-
interface: {
32-
name: 'Squarelink',
33-
connect: provider.enable,
34-
address: {
35-
get: () => Promise.resolve(instance.accounts[0])
36-
},
37-
network: {
38-
get: () => Promise.resolve(networkToId(instance.network))
39-
},
40-
balance: {
41-
get: () =>
42-
new Promise(resolve => {
43-
if (!instance.accounts.length) {
44-
resolve(null)
45-
return
46-
}
28+
// return {
29+
// provider,
30+
// instance,
31+
// interface: {
32+
// name: 'Squarelink',
33+
// connect: provider.enable,
34+
// address: {
35+
// get: () => Promise.resolve(instance.accounts[0])
36+
// },
37+
// network: {
38+
// get: () => Promise.resolve(networkToId(instance.network))
39+
// },
40+
// balance: {
41+
// get: () =>
42+
// new Promise(resolve => {
43+
// if (!instance.accounts.length) {
44+
// resolve(null)
45+
// return
46+
// }
4747

48-
provider.sendAsync(
49-
{
50-
method: 'eth_getBalance',
51-
params: [instance.accounts[0], 'latest'],
52-
id: 1
53-
},
54-
(e: any, res: any) => {
55-
resolve(BigNumber(res.result).toString(10))
56-
}
57-
)
58-
})
59-
}
60-
}
61-
}
62-
}
63-
}
64-
}
48+
// provider.sendAsync(
49+
// {
50+
// method: 'eth_getBalance',
51+
// params: [instance.accounts[0], 'latest'],
52+
// id: 1
53+
// },
54+
// (e: any, res: any) => {
55+
// resolve(BigNumber(res.result).toString(10))
56+
// }
57+
// )
58+
// })
59+
// }
60+
// }
61+
// }
62+
// }
63+
// }
64+
// }
6565

66-
export default squarelink
66+
// export default squarelink

0 commit comments

Comments
 (0)