@lunch-money/ethereum-to-lunch-money 1.2.0 → 1.4.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/README.md +36 -6
- package/dist/cjs/fixtures/1inch.json +1 -1
- package/dist/cjs/src/client.d.ts +3 -2
- package/dist/cjs/src/client.js +36 -16
- package/dist/cjs/src/client.js.map +1 -1
- package/dist/cjs/src/main.d.ts +2 -3
- package/dist/cjs/src/main.js +65 -14
- package/dist/cjs/src/main.js.map +1 -1
- package/dist/cjs/src/types.d.ts +4 -4
- package/dist/cjs/src/types.js.map +1 -1
- package/dist/mjs/fixtures/1inch.json +1 -1
- package/dist/mjs/src/client.d.ts +3 -2
- package/dist/mjs/src/client.js +24 -11
- package/dist/mjs/src/client.js.map +1 -1
- package/dist/mjs/src/main.d.ts +2 -3
- package/dist/mjs/src/main.js +61 -11
- package/dist/mjs/src/main.js.map +1 -1
- package/dist/mjs/src/types.d.ts +4 -4
- package/dist/mjs/src/types.js.map +1 -1
- package/package.json +39 -31
package/README.md
CHANGED
|
@@ -15,18 +15,48 @@ yarn
|
|
|
15
15
|
yarn test
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
client against a real wallet. It is invoked in the following way:
|
|
18
|
+
## Debugging
|
|
20
19
|
|
|
20
|
+
The following environment variables can be run with the test script or when using the plugin with Lunch Money
|
|
21
|
+
|
|
22
|
+
- DEBUG_ETHEREUM - set to enable detailed debug messages and enable API Key validation
|
|
23
|
+
- ETHEREUM_BALANCE_TIMEOUT_MSECS - the number of msecs to wait for a response before timing out
|
|
24
|
+
|
|
25
|
+
The timeout was added to avoid a false CORS message when the API never returns.
|
|
26
|
+
|
|
27
|
+
Tweaking this to about 1000-2000, and watching the debug messages can be useful for validating that failover is working as expected.
|
|
28
|
+
|
|
29
|
+
## Live Testing
|
|
30
|
+
|
|
31
|
+
There is a script, `get-balances.ts`, that can be invoked to invoke the client against a real or test wallet. This mimics the behavior of the Lunch Money server when a user attempts to connect an Ethereum wallet.
|
|
32
|
+
|
|
33
|
+
Copy [env.example](./env.example) to .env and set some or all of the environment variables that the script and connector use.
|
|
34
|
+
|
|
35
|
+
### Ethereum Service Provider API Keys
|
|
36
|
+
|
|
37
|
+
If no keys are set, the script will use the public APIs which may or may not work. One or both of the following are recommended:
|
|
38
|
+
|
|
39
|
+
- ALCHEMY_API_KEY - [set up a key here](https://dashboard.alchemy.com/). This is the recommended service to use
|
|
40
|
+
- INFURA_API_KEY - [set up a key here](https://developer.metamask.io/). If set with Alchemy will be used as a secondary
|
|
41
|
+
|
|
42
|
+
While the connector can run with other service node keys, such as Etherscan, the test script will not support it.
|
|
43
|
+
|
|
44
|
+
### Wallet Configuration
|
|
45
|
+
- LM_ETHEREUM_WALLET_ADDRESS
|
|
46
|
+
|
|
47
|
+
If no wallet is set, the test script will use a well know test wallet
|
|
48
|
+
|
|
49
|
+
The Blockchain network is no longer configurable in the test script and defaults to "mainnet".
|
|
50
|
+
|
|
51
|
+
To run the script
|
|
21
52
|
```
|
|
22
|
-
|
|
53
|
+
yarn test-live
|
|
23
54
|
```
|
|
24
|
-
|
|
25
|
-
You can obtain a Etherscan API key by following the documentation [here](https://docs.etherscan.io/getting-started/viewing-api-usage-statistics).
|
|
55
|
+
A .vscode/launch.json configuration is include to facilitate running the script in the debugger with VSCode.
|
|
26
56
|
|
|
27
57
|
## Refreshing the Token List
|
|
28
58
|
|
|
29
59
|
This package uses a fixed token list fetched as the token list that the 1inch
|
|
30
|
-
exchange uses
|
|
60
|
+
exchange uses. Run the included script
|
|
31
61
|
`./bin/refresh-token-list.sh` to refresh the token list. Refreshing the token
|
|
32
62
|
list will require a new version of this package to be released.
|