|
1 |
| -import Squarelink from 'squarelink' |
| 1 | +// import Squarelink from 'squarelink' |
2 | 2 |
|
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' |
7 | 7 |
|
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' }) |
10 | 10 |
|
11 |
| - const { apiKey, networkId } = options |
| 11 | +// const { apiKey, networkId } = options |
12 | 12 |
|
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' }) |
15 | 15 |
|
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 |
21 | 21 |
|
22 |
| - const instance = new Squarelink(apiKey, networkName(networkId), { |
23 |
| - useSync: true |
24 |
| - }) |
| 22 | +// const instance = new Squarelink(apiKey, networkName(networkId), { |
| 23 | +// useSync: true |
| 24 | +// }) |
25 | 25 |
|
26 |
| - const provider = instance.getProviderSync() |
| 26 | +// const provider = instance.getProviderSync() |
27 | 27 |
|
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 | +// } |
47 | 47 |
|
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 | +// } |
65 | 65 |
|
66 |
| -export default squarelink |
| 66 | +// export default squarelink |
0 commit comments