-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Claim CLI Skeleton * Tidy up code * Update Claim CLI tools * Update format, added test cases * Update Claim CLI Readme * Add details to README * Update function structures * Update description * Rename network -> networkParams * Update confirmSendTransaction * Rename networkParams to network-params * Update success comment * Rearrange utils and import order * Apply suggestions from code review Co-authored-by: Himanshu Nagda <[email protected]> * Apply suggestions from code review Co-authored-by: Himanshu Nagda <[email protected]> * Update suggestions from review * Update yarn.lock * Add Exodus Wallet support * Rename Lisk L1 to Lisk v4 * Update Testnet API endpoint * Update suggestions according to PR review * Update test cases * Use throw instead of process.exit --------- Co-authored-by: Himanshu Nagda <[email protected]>
- Loading branch information
1 parent
57163cd
commit 737c81d
Showing
32 changed files
with
2,148 additions
and
8 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"require": ["ts-node/register"], | ||
"watch-extensions": ["ts"], | ||
"recursive": true, | ||
"reporter": "spec", | ||
"timeout": 60000 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Claim CLI | ||
|
||
This library is a tool to claim Lisk tokens without the need for UI. This tool can provide the following services: | ||
|
||
- Check Eligibility | ||
- Submit a Claim | ||
- Publish a Multisig claim with completed signatures onchain | ||
|
||
![cli_screenshot.png](../../documentation/Claim_CLI/cli_screenshot.png) | ||
|
||
## Run | ||
|
||
``` | ||
# Navigate to claim-cli package | ||
cd packages/claim-cli | ||
# Install dependencies | ||
yarn && yarn build | ||
# Start Claim CLI on mainnet | ||
./bin/run.js start | ||
# Or start Claim CLI on testnet | ||
# ./bin/run.js start --network testnet | ||
``` | ||
|
||
## Workflow | ||
|
||
### Check Eligibility | ||
|
||
![check_eligibility.png](../../documentation/Claim_CLI/check_eligibility.png) | ||
|
||
### Submit a Claim | ||
|
||
![img_2.png](../../documentation/Claim_CLI/submit_a_claim.png) | ||
|
||
### Publish a Multisig claim with completed signatures onchain | ||
|
||
![submit_multisig.png](../../documentation/Claim_CLI/submit_multisig.png) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
@echo off | ||
|
||
node "%~dp0\dev" %* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/usr/bin/env node_modules/.bin/ts-node | ||
// eslint-disable-next-line node/shebang, unicorn/prefer-top-level-await | ||
(async () => { | ||
const oclif = await import('@oclif/core'); | ||
await oclif.execute({ development: true, dir: __dirname }); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
@echo off | ||
|
||
node "%~dp0\run" %* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env node | ||
|
||
// eslint-disable-next-line unicorn/prefer-top-level-await | ||
(async () => { | ||
const oclif = await import('@oclif/core'); | ||
await oclif.execute({ development: false, dir: __dirname }); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
{ | ||
"name": "@liskhq/claim-cli", | ||
"version": "0.1.0", | ||
"private": true, | ||
"description": "CLI to claim process", | ||
"author": "Lisk Foundation <[email protected]>, lightcurve GmbH <[email protected]>", | ||
"license": "Apache-2.0", | ||
"keywords": [ | ||
"blockchain", | ||
"lisk" | ||
], | ||
"main": "index.js", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/LiskHQ/lisk-token-claim.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/LiskHQ/lisk-token-claim/issues" | ||
}, | ||
"homepage": "https://github.com/LiskHQ/lisk-token-claim#readme", | ||
"bin": { | ||
"claim-cli": "./bin/run" | ||
}, | ||
"engines": { | ||
"node": ">=18.0.0" | ||
}, | ||
"scripts": { | ||
"build": "shx rm -rf dist tsconfig.tsbuildinfo && tsc -b", | ||
"postpack": "shx rm -f oclif.manifest.json", | ||
"prepack": "yarn build && oclif manifest && oclif readme", | ||
"prepare": "yarn build", | ||
"test": "mocha --forbid-only \"test/**/*.test.ts\"" | ||
}, | ||
"oclif": { | ||
"bin": "claim-cli", | ||
"dirname": "claim-cli", | ||
"commands": { | ||
"strategy": "single", | ||
"target": "./dist/index.js" | ||
}, | ||
"plugins": [ | ||
"@oclif/plugin-help" | ||
] | ||
}, | ||
"dependencies": { | ||
"@inquirer/prompts": "^5.0.4", | ||
"@liskhq/lisk-codec": "0.5.0", | ||
"@liskhq/lisk-cryptography": "4.1.0", | ||
"@liskhq/lisk-db": "0.3.10", | ||
"@oclif/core": "^3.26.6", | ||
"@oclif/plugin-help": "^6", | ||
"@openzeppelin/merkle-tree": "^1.0.6", | ||
"ethereumjs-util": "^7.1.5", | ||
"ethers": "^6.8.1", | ||
"inquirer": "^9.2.22", | ||
"tweetnacl": "^1.0.3" | ||
}, | ||
"devDependencies": { | ||
"@oclif/prettier-config": "^0.2.1", | ||
"@oclif/test": "^3.1.8", | ||
"@types/chai": "^4", | ||
"@types/inquirer": "^9.0.7", | ||
"@types/mocha": "^9.0.0", | ||
"@types/node": "^18", | ||
"chai": "^4", | ||
"mocha": "^10", | ||
"oclif": "^4.10.5", | ||
"shx": "^0.3.3", | ||
"sinon": "^17.0.1", | ||
"ts-node": "^10.9.2", | ||
"typescript": "^5" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,185 @@ | ||
export default [ | ||
{ | ||
type: 'function', | ||
name: 'allowance', | ||
inputs: [ | ||
{ | ||
name: 'owner', | ||
type: 'address', | ||
internalType: 'address', | ||
}, | ||
{ | ||
name: 'spender', | ||
type: 'address', | ||
internalType: 'address', | ||
}, | ||
], | ||
outputs: [ | ||
{ | ||
name: '', | ||
type: 'uint256', | ||
internalType: 'uint256', | ||
}, | ||
], | ||
stateMutability: 'view', | ||
}, | ||
{ | ||
type: 'function', | ||
name: 'approve', | ||
inputs: [ | ||
{ | ||
name: 'spender', | ||
type: 'address', | ||
internalType: 'address', | ||
}, | ||
{ | ||
name: 'value', | ||
type: 'uint256', | ||
internalType: 'uint256', | ||
}, | ||
], | ||
outputs: [ | ||
{ | ||
name: '', | ||
type: 'bool', | ||
internalType: 'bool', | ||
}, | ||
], | ||
stateMutability: 'nonpayable', | ||
}, | ||
{ | ||
type: 'function', | ||
name: 'balanceOf', | ||
inputs: [ | ||
{ | ||
name: 'account', | ||
type: 'address', | ||
internalType: 'address', | ||
}, | ||
], | ||
outputs: [ | ||
{ | ||
name: '', | ||
type: 'uint256', | ||
internalType: 'uint256', | ||
}, | ||
], | ||
stateMutability: 'view', | ||
}, | ||
{ | ||
type: 'function', | ||
name: 'totalSupply', | ||
inputs: [], | ||
outputs: [ | ||
{ | ||
name: '', | ||
type: 'uint256', | ||
internalType: 'uint256', | ||
}, | ||
], | ||
stateMutability: 'view', | ||
}, | ||
{ | ||
type: 'function', | ||
name: 'transfer', | ||
inputs: [ | ||
{ | ||
name: 'to', | ||
type: 'address', | ||
internalType: 'address', | ||
}, | ||
{ | ||
name: 'value', | ||
type: 'uint256', | ||
internalType: 'uint256', | ||
}, | ||
], | ||
outputs: [ | ||
{ | ||
name: '', | ||
type: 'bool', | ||
internalType: 'bool', | ||
}, | ||
], | ||
stateMutability: 'nonpayable', | ||
}, | ||
{ | ||
type: 'function', | ||
name: 'transferFrom', | ||
inputs: [ | ||
{ | ||
name: 'from', | ||
type: 'address', | ||
internalType: 'address', | ||
}, | ||
{ | ||
name: 'to', | ||
type: 'address', | ||
internalType: 'address', | ||
}, | ||
{ | ||
name: 'value', | ||
type: 'uint256', | ||
internalType: 'uint256', | ||
}, | ||
], | ||
outputs: [ | ||
{ | ||
name: '', | ||
type: 'bool', | ||
internalType: 'bool', | ||
}, | ||
], | ||
stateMutability: 'nonpayable', | ||
}, | ||
{ | ||
type: 'event', | ||
name: 'Approval', | ||
inputs: [ | ||
{ | ||
name: 'owner', | ||
type: 'address', | ||
indexed: true, | ||
internalType: 'address', | ||
}, | ||
{ | ||
name: 'spender', | ||
type: 'address', | ||
indexed: true, | ||
internalType: 'address', | ||
}, | ||
{ | ||
name: 'value', | ||
type: 'uint256', | ||
indexed: false, | ||
internalType: 'uint256', | ||
}, | ||
], | ||
anonymous: false, | ||
}, | ||
{ | ||
type: 'event', | ||
name: 'Transfer', | ||
inputs: [ | ||
{ | ||
name: 'from', | ||
type: 'address', | ||
indexed: true, | ||
internalType: 'address', | ||
}, | ||
{ | ||
name: 'to', | ||
type: 'address', | ||
indexed: true, | ||
internalType: 'address', | ||
}, | ||
{ | ||
name: 'value', | ||
type: 'uint256', | ||
indexed: false, | ||
internalType: 'uint256', | ||
}, | ||
], | ||
anonymous: false, | ||
}, | ||
]; |
Oops, something went wrong.