Skip to content

Commit

Permalink
cli: add sound when awaiting ledger interaction (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
juliangruber authored Dec 5, 2024
1 parent 27b840f commit 3167b3e
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
3 changes: 3 additions & 0 deletions bin/release-rewards.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import HIDTransport from '@ledgerhq/hw-transport-node-hid'
import * as SparkImpactEvaluator from '@filecoin-station/spark-impact-evaluator'
import readline from 'node:readline/promises'
import pRetry from 'p-retry'
import beeper from 'beeper'

process.title = 'release-rewards'
const { RPC_URL = 'https://api.node.glif.io/rpc/v1', WALLET_SEED } = process.env
Expand Down Expand Up @@ -60,6 +61,7 @@ for (let i = 0; i < batchCount; i++) {
}
console.log(`^ Batch ${i + 1}/${batchCount}`)
if (!WALLET_SEED) {
await beeper()
console.log('Please approve on ledger...')
}
const tx = await ie.addBalances(
Expand All @@ -77,6 +79,7 @@ for (let i = 0; i < batchCount; i++) {

if (!WALLET_SEED) {
console.log(`Please sign batch ${i + 1}/${batchCount} on ledger...`)
await beeper()
}
const signed = await signer.signMessage(digest)
const { v, r, s } = ethers.Signature.from(signed)
Expand Down
27 changes: 27 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"@ethers-ext/signer-ledger": "^6.0.0-beta.1",
"@filecoin-station/spark-impact-evaluator": "^1.2.4",
"@ledgerhq/hw-transport-node-hid": "^6.29.5",
"beeper": "^3.0.0",
"standard": "^17.1.2"
}
}

0 comments on commit 3167b3e

Please sign in to comment.