const rpc = new Rpc(env.NODE_URL ?? '', env.API_KEY_NAME)
/**
-* HID interactions require user gestures, so to reduce clicks, the variables
-* shared among tests like wallet and account are declared at the top-level.
-*
-* Some of these tests depend on a specific Ledger wallet owned by the developer
-* and dedicated to testing. Project clones or forks will need to modify the test
-* vectors to use the mnemonics, seeds, private keys, public keys, and addresses
-* from their own Ledger hardware wallets.
-*/
+ * HID interactions require user gestures, so to reduce clicks, the variables
+ * shared among tests like wallet and account are declared at the top-level.
+ *
+ * Some of these tests depend on a specific Ledger wallet owned by the developer
+ * and dedicated to testing. Project clones or forks will need to modify the
+ * test vectors to use the mnemonics, seeds, private keys, public keys, and
+ * addresses from their own Ledger hardware wallets.
+ */
await Promise.all([
suite('Ledger unsupported', { skip: !(isNode || navigator?.usb == null) }, async () => {
const { LEDGER_NANOS, LEDGER_NANOSP } = CUSTOM_TEST_VECTORS
const { OPEN_BLOCK, RECEIVE_BLOCK, SEND_BLOCK } = NANO_TEST_VECTORS
- let wallet, account, openBlock, sendBlock, receiveBlock, restored
+ let /** @type {Wallet} */ wallet,
+ /** @type {Account} */ account,
+ /** @type {Block} */ openBlock,
+ /** @type {Block} */ sendBlock,
+ /** @type {Block} */ receiveBlock,
+ restored
try {
wallet = await Wallet.create('Ledger')
} catch {
assert.exists(accounts)
assert.equal(accounts.size, 2)
- for (const [ index, account ] of accounts) {
+ for (const [index, account] of accounts) {
assert.ok(account instanceof Account)
assert.exists(account.address)
assert.exists(account.publicKey)
const accounts = await wallet.refresh(rpc, 0, 2)
assert.exists(accounts)
- for (const [ index, account ] of accounts) {
+ for (const [index, account] of accounts) {
assert.ok(account instanceof Account)
assert.exists(account.address)
assert.exists(account.publicKey)