From f068bc56b23602f13d5d84c7a5080726981ecc1d Mon Sep 17 00:00:00 2001 From: Matt Grote Date: Thu, 18 Jun 2026 16:52:28 -0300 Subject: [PATCH 1/2] Convert package to ESM --- eslint.config.js | 4 +++- package.json | 1 + src/index.ts | 20 ++++++++++---------- src/keys.ts | 2 +- src/mnemonic/index.ts | 2 +- src/notes/commitment.ts | 6 +++--- src/notes/index.ts | 26 +++++++++++++------------- src/notes/memo.ts | 6 +++--- src/notes/note.ts | 6 +++--- src/notes/shield-note.ts | 12 ++++++------ src/notes/token-utils.ts | 4 ++-- src/notes/transact-note.ts | 8 ++++---- src/notes/unshield-note.ts | 10 +++++----- src/wallet/bip32.ts | 4 ++-- src/wallet/derivation.ts | 4 ++-- src/wallet/index.ts | 4 ++-- src/wallet/railgun-wallet.ts | 8 ++++---- src/wallet/wallet-node.ts | 8 ++++---- test/commitment-memo.test.ts | 8 ++++---- test/commitment.test.ts | 10 +++++----- test/derivation.test.ts | 4 ++-- test/encoding.test.ts | 2 +- test/keys.test.ts | 2 +- test/memo.test.ts | 6 +++--- test/mnemonic.test.ts | 4 ++-- test/note.test.ts | 6 +++--- test/shield-note.test.ts | 6 +++--- test/token-utils.test.ts | 4 ++-- test/transact-note.test.ts | 12 ++++++------ test/unshield-note.test.ts | 4 ++-- test/wallet-info.test.ts | 2 +- test/wallet-node.test.ts | 6 +++--- 32 files changed, 107 insertions(+), 104 deletions(-) diff --git a/eslint.config.js b/eslint.config.js index 2df50ff..c5e87b1 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -1 +1,3 @@ -module.exports = require('@railgun-reloaded/eslint-config')() +import railgunEslintConfig from '@railgun-reloaded/eslint-config' + +export default railgunEslintConfig() diff --git a/package.json b/package.json index 8710d23..66a2d52 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,7 @@ "name": "@railgun-reloaded/wallet-node", "version": "0.0.0", "description": "TODO", + "type": "module", "scripts": { "build": "tsc --build", "clean": "tsc --build --clean", diff --git a/src/index.ts b/src/index.ts index c005f55..a485ea2 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,12 +1,12 @@ -export * from './notes' -export * from './keys' -export * from './encoding' +export * from './notes/index.js' +export * from './keys.js' +export * from './encoding.js' -export * from './wallet/derivation' -export * from './wallet/bip32' -export type * from './wallet/types' -export type * from './wallet/wallet-node' -export { WalletNode } from './wallet/wallet-node' -export { RailgunWallet } from './wallet/railgun-wallet' +export * from './wallet/derivation.js' +export * from './wallet/bip32.js' +export type * from './wallet/types.js' +export type * from './wallet/wallet-node.js' +export { WalletNode } from './wallet/wallet-node.js' +export { RailgunWallet } from './wallet/railgun-wallet.js' -export { Mnemonic } from './mnemonic' +export { Mnemonic } from './mnemonic/index.js' diff --git a/src/keys.ts b/src/keys.ts index 4c5c597..25715ff 100644 --- a/src/keys.ts +++ b/src/keys.ts @@ -4,7 +4,7 @@ import { randomBytes } from '@noble/hashes/utils' import { bigIntToBytes, bytesToBigInt } from '@railgun-reloaded/bytes' import { eddsa, initCircomlib, initializeEddsa, poseidon } from '@railgun-reloaded/cryptography' -import { xorBytesInPlace } from './encoding' +import { xorBytesInPlace } from './encoding.js' type Ed25519Module = typeof Ed25519 diff --git a/src/mnemonic/index.ts b/src/mnemonic/index.ts index be0e3b7..ba5868b 100644 --- a/src/mnemonic/index.ts +++ b/src/mnemonic/index.ts @@ -1 +1 @@ -export * from './mnemonic' +export * from './mnemonic.js' diff --git a/src/notes/commitment.ts b/src/notes/commitment.ts index aec1da8..6437b07 100644 --- a/src/notes/commitment.ts +++ b/src/notes/commitment.ts @@ -1,10 +1,10 @@ import { bytesToBigInt, bytesToHex } from '@railgun-reloaded/bytes' import { AES } from '@railgun-reloaded/cryptography' -import { getSharedSymmetricKey } from '../keys' +import { getSharedSymmetricKey } from '../keys.js' -import type { Chain, Ciphertext, TokenData, TokenDataGetter } from './definitions' -import { TXIDVersion } from './definitions' +import type { Chain, Ciphertext, TokenData, TokenDataGetter } from './definitions.js' +import { TXIDVersion } from './definitions.js' interface DecryptedCommitmentData { random: string diff --git a/src/notes/index.ts b/src/notes/index.ts index 2f31cdd..7eb2422 100644 --- a/src/notes/index.ts +++ b/src/notes/index.ts @@ -1,14 +1,14 @@ -export * from './commitment' -export * from './definitions' -export * from './token-utils' +export * from './commitment.js' +export * from './definitions.js' +export * from './token-utils.js' -export { WalletInfo } from './wallet-info' -export { Memo } from './memo' -export type { NoteParams } from './note' -export { Note } from './note' -export type { ShieldNoteParams } from './shield-note' -export { ShieldNote } from './shield-note' -export type { UnshieldNoteParams } from './unshield-note' -export { UnshieldNote } from './unshield-note' -export type { TransactNoteParams } from './transact-note' -export { TransactNote } from './transact-note' +export { WalletInfo } from './wallet-info.js' +export { Memo } from './memo.js' +export type { NoteParams } from './note.js' +export { Note } from './note.js' +export type { ShieldNoteParams } from './shield-note.js' +export { ShieldNote } from './shield-note.js' +export type { UnshieldNoteParams } from './unshield-note.js' +export { UnshieldNote } from './unshield-note.js' +export type { TransactNoteParams } from './transact-note.js' +export { TransactNote } from './transact-note.js' diff --git a/src/notes/memo.ts b/src/notes/memo.ts index 39e65d0..872fbc8 100644 --- a/src/notes/memo.ts +++ b/src/notes/memo.ts @@ -2,9 +2,9 @@ import { bytesToHex, hexToBytes, stripHexPrefix } from '@railgun-reloaded/bytes' import type { CiphertextCTR } from '@railgun-reloaded/cryptography' import { AES } from '@railgun-reloaded/cryptography' -import type { NoteAnnotationData } from './definitions' -import { MEMO_SENDER_RANDOM_NULL, OutputType } from './definitions' -import { WalletInfo } from './wallet-info' +import type { NoteAnnotationData } from './definitions.js' +import { MEMO_SENDER_RANDOM_NULL, OutputType } from './definitions.js' +import { WalletInfo } from './wallet-info.js' /** * Memo encoding, decoding, and V2 annotation data encryption/decryption. diff --git a/src/notes/note.ts b/src/notes/note.ts index 6bfb6fb..eb0e077 100644 --- a/src/notes/note.ts +++ b/src/notes/note.ts @@ -1,10 +1,10 @@ import { bigIntToBytes, stripHexPrefix } from '@railgun-reloaded/bytes' import { poseidon } from '@railgun-reloaded/cryptography' -import { assertCryptoInitialized } from '../keys' +import { assertCryptoInitialized } from '../keys.js' -import type { TokenData } from './definitions' -import { assertValidNoteToken, computeTokenHash } from './token-utils' +import type { TokenData } from './definitions.js' +import { assertValidNoteToken, computeTokenHash } from './token-utils.js' /** * Base parameters shared by all note types. diff --git a/src/notes/shield-note.ts b/src/notes/shield-note.ts index a333179..6909d6d 100644 --- a/src/notes/shield-note.ts +++ b/src/notes/shield-note.ts @@ -2,13 +2,13 @@ import { decode, encode } from '@msgpack/msgpack' import { bytesToHex, hexToBytes } from '@railgun-reloaded/bytes' import { AES } from '@railgun-reloaded/cryptography' -import { getSharedSymmetricKey } from '../keys' +import { getSharedSymmetricKey } from '../keys.js' -import type { GeneratedCommitment, ShieldCommitment } from './definitions' -import { TokenType } from './definitions' -import type { NoteParams } from './note' -import { Note } from './note' -import { deserializeTokenData, serializeTokenData } from './token-utils' +import type { GeneratedCommitment, ShieldCommitment } from './definitions.js' +import { TokenType } from './definitions.js' +import type { NoteParams } from './note.js' +import { Note } from './note.js' +import { deserializeTokenData, serializeTokenData } from './token-utils.js' /** * Parameters for constructing a ShieldNote. diff --git a/src/notes/token-utils.ts b/src/notes/token-utils.ts index 73ac137..68d9050 100644 --- a/src/notes/token-utils.ts +++ b/src/notes/token-utils.ts @@ -1,8 +1,8 @@ import { keccak_256 as keccak256 } from '@noble/hashes/sha3' import { bigIntToBytes, bytesToBigInt, bytesToHex, hexToBytes, padBytesLeft } from '@railgun-reloaded/bytes' -import type { TokenData } from './definitions' -import { SNARK_PRIME, TokenType } from './definitions' +import type { TokenData } from './definitions.js' +import { SNARK_PRIME, TokenType } from './definitions.js' /** * Computes the token hash for ERC20 tokens. diff --git a/src/notes/transact-note.ts b/src/notes/transact-note.ts index 29c1038..ddc3dac 100644 --- a/src/notes/transact-note.ts +++ b/src/notes/transact-note.ts @@ -3,10 +3,10 @@ import { parse as parse0zkAddress, stringify as stringify0zkAddress } from '@rai import { bytesToBigInt, bytesToHex, hexToBytes } from '@railgun-reloaded/bytes' import { AES } from '@railgun-reloaded/cryptography' -import type { AddressData, Chain, Ciphertext, EncryptedData, LegacyCiphertext, TXIDVersion, TokenData, TokenDataGetter } from './definitions' -import type { NoteParams } from './note' -import { Note } from './note' -import { computeTokenHash, getTokenDataERC20 } from './token-utils' +import type { AddressData, Chain, Ciphertext, EncryptedData, LegacyCiphertext, TXIDVersion, TokenData, TokenDataGetter } from './definitions.js' +import type { NoteParams } from './note.js' +import { Note } from './note.js' +import { computeTokenHash, getTokenDataERC20 } from './token-utils.js' /** * Parameters for constructing a TransactNote. diff --git a/src/notes/unshield-note.ts b/src/notes/unshield-note.ts index 5fb2bc5..4e9ed2c 100644 --- a/src/notes/unshield-note.ts +++ b/src/notes/unshield-note.ts @@ -1,11 +1,11 @@ import { decode, encode } from '@msgpack/msgpack' import { bytesToBigInt, bytesToHex, hexToBytes } from '@railgun-reloaded/bytes' -import type { Unshield } from './definitions' -import { TokenType } from './definitions' -import type { NoteParams } from './note' -import { Note } from './note' -import { computeTokenHash, deserializeTokenData, serializeTokenData } from './token-utils' +import type { Unshield } from './definitions.js' +import { TokenType } from './definitions.js' +import type { NoteParams } from './note.js' +import { Note } from './note.js' +import { computeTokenHash, deserializeTokenData, serializeTokenData } from './token-utils.js' /** * Parameters for constructing an UnshieldNote. diff --git a/src/wallet/bip32.ts b/src/wallet/bip32.ts index bd7c36d..93ae2db 100644 --- a/src/wallet/bip32.ts +++ b/src/wallet/bip32.ts @@ -1,6 +1,6 @@ -import { sha512HMAC } from '../encoding' +import { sha512HMAC } from '../encoding.js' -import type { KeyNode } from './types' +import type { KeyNode } from './types.js' const CURVE_SEED = new TextEncoder().encode('babyjubjub seed') diff --git a/src/wallet/derivation.ts b/src/wallet/derivation.ts index 9c9b31f..31c9ff2 100644 --- a/src/wallet/derivation.ts +++ b/src/wallet/derivation.ts @@ -1,5 +1,5 @@ -import type { WalletNodes } from './wallet-node' -import { WalletNode } from './wallet-node' +import type { WalletNodes } from './wallet-node.js' +import { WalletNode } from './wallet-node.js' /** * A collection of derivation path prefixes used for generating hierarchical deterministic (HD) wallet keys. diff --git a/src/wallet/index.ts b/src/wallet/index.ts index 266c58e..53bb581 100644 --- a/src/wallet/index.ts +++ b/src/wallet/index.ts @@ -1,2 +1,2 @@ -export * from './railgun-wallet' -export * from './wallet-node' +export * from './railgun-wallet.js' +export * from './wallet-node.js' diff --git a/src/wallet/railgun-wallet.ts b/src/wallet/railgun-wallet.ts index 23afb6a..6d938c5 100644 --- a/src/wallet/railgun-wallet.ts +++ b/src/wallet/railgun-wallet.ts @@ -1,11 +1,11 @@ -import { deriveNodes } from './derivation' +import { deriveNodes } from './derivation.js' import type { SpendingKeyPair, SpendingPublicKey, ViewingKeyPair, -} from './types' -import type { WalletNodes } from './wallet-node' -import { WalletNode } from './wallet-node' +} from './types.js' +import type { WalletNodes } from './wallet-node.js' +import { WalletNode } from './wallet-node.js' type RailgunKeystore = { spendingKeyPair: SpendingKeyPair; diff --git a/src/wallet/wallet-node.ts b/src/wallet/wallet-node.ts index a493543..31eaf53 100644 --- a/src/wallet/wallet-node.ts +++ b/src/wallet/wallet-node.ts @@ -1,10 +1,10 @@ import { poseidon } from '@railgun-reloaded/cryptography' -import { assertCryptoInitialized, getPublicSpendingKey, getPublicViewingKey } from '../keys' -import { Mnemonic } from '../mnemonic' +import { assertCryptoInitialized, getPublicSpendingKey, getPublicViewingKey } from '../keys.js' +import { Mnemonic } from '../mnemonic/index.js' -import { childKeyDerivationHardened, getMasterKeyFromSeed, getPathSegments } from './bip32' -import type { KeyNode, SpendingKeyPair, ViewingKeyPair } from './types' +import { childKeyDerivationHardened, getMasterKeyFromSeed, getPathSegments } from './bip32.js' +import type { KeyNode, SpendingKeyPair, ViewingKeyPair } from './types.js' const HARDENED_OFFSET = 0x80000000 as const type WalletNodes = { spending: WalletNode; viewing: WalletNode } diff --git a/test/commitment-memo.test.ts b/test/commitment-memo.test.ts index 5ea2aac..37a50ec 100644 --- a/test/commitment-memo.test.ts +++ b/test/commitment-memo.test.ts @@ -10,10 +10,10 @@ import { getPublicViewingKey, getSharedSymmetricKey, initializeCryptographyLibs, -} from '../src/keys' -import { decryptCommitment } from '../src/notes/commitment' -import type { TokenDataGetter } from '../src/notes/definitions' -import { ChainType, TXIDVersion } from '../src/notes/definitions' +} from '../src/keys.js' +import { decryptCommitment } from '../src/notes/commitment.js' +import type { TokenDataGetter } from '../src/notes/definitions.js' +import { ChainType, TXIDVersion } from '../src/notes/definitions.js' const TEST_CHAIN = { type: ChainType.EVM, id: 11155111 } const EMPTY_MEMO = new Uint8Array(0) diff --git a/test/commitment.test.ts b/test/commitment.test.ts index b2dfe34..aa24a21 100644 --- a/test/commitment.test.ts +++ b/test/commitment.test.ts @@ -10,14 +10,14 @@ import { getPublicViewingKey, getSharedSymmetricKey, initializeCryptographyLibs, -} from '../src/keys' +} from '../src/keys.js' import { decryptCommitment, decryptCommitmentAsReceiverOrSender, -} from '../src/notes/commitment' -import type { TokenDataGetter } from '../src/notes/definitions' -import { ChainType, TXIDVersion } from '../src/notes/definitions' -import { computeTokenHash } from '../src/notes/token-utils' +} from '../src/notes/commitment.js' +import type { TokenDataGetter } from '../src/notes/definitions.js' +import { ChainType, TXIDVersion } from '../src/notes/definitions.js' +import { computeTokenHash } from '../src/notes/token-utils.js' const TEST_CHAIN = { type: ChainType.EVM, id: 1 } const TEST_VALUE = 1000000000000000000n // 1 ETH diff --git a/test/derivation.test.ts b/test/derivation.test.ts index 88b0cac..3006e18 100644 --- a/test/derivation.test.ts +++ b/test/derivation.test.ts @@ -1,8 +1,8 @@ import assert from 'node:assert/strict' import { before, test } from 'node:test' -import { initializeCryptographyLibs } from '../src/keys' -import { DERIVATION_PATH_PREFIXES, deriveNodes, derivePathsForIndex } from '../src/wallet/derivation' +import { initializeCryptographyLibs } from '../src/keys.js' +import { DERIVATION_PATH_PREFIXES, deriveNodes, derivePathsForIndex } from '../src/wallet/derivation.js' const TEST_MNEMONIC = 'test test test test test test test test test test test junk' diff --git a/test/encoding.test.ts b/test/encoding.test.ts index 641d9db..3d31c5f 100644 --- a/test/encoding.test.ts +++ b/test/encoding.test.ts @@ -6,7 +6,7 @@ import { bytesToHex } from '@railgun-reloaded/bytes' import { sha512HMAC, xorBytesInPlace, -} from '../src/encoding' +} from '../src/encoding.js' test('encoding - sha512HMAC', () => { const key = new Uint8Array([1, 2, 3, 4]) diff --git a/test/keys.test.ts b/test/keys.test.ts index f118215..bbedf56 100644 --- a/test/keys.test.ts +++ b/test/keys.test.ts @@ -15,7 +15,7 @@ import { initializeCryptographyLibs, seedToScalar, unblindNoteKey, -} from '../src/keys' +} from '../src/keys.js' before(async () => { await initializeCryptographyLibs() diff --git a/test/memo.test.ts b/test/memo.test.ts index 0806ce4..55a0639 100644 --- a/test/memo.test.ts +++ b/test/memo.test.ts @@ -3,9 +3,9 @@ import { before, test } from 'node:test' import { randomBytes } from '@noble/hashes/utils' -import { initializeCryptographyLibs } from '../src/keys' -import { MEMO_SENDER_RANDOM_NULL, OutputType } from '../src/notes/definitions' -import { Memo } from '../src/notes/memo' +import { initializeCryptographyLibs } from '../src/keys.js' +import { MEMO_SENDER_RANDOM_NULL, OutputType } from '../src/notes/definitions.js' +import { Memo } from '../src/notes/memo.js' before(async () => { await initializeCryptographyLibs() diff --git a/test/mnemonic.test.ts b/test/mnemonic.test.ts index 4fdeec4..8445308 100644 --- a/test/mnemonic.test.ts +++ b/test/mnemonic.test.ts @@ -3,8 +3,8 @@ import { test } from 'node:test' import { bytesToHex, hexToBytes } from '@railgun-reloaded/bytes' -import { Mnemonic } from '../src/mnemonic' -import { childKeyDerivationHardened, getMasterKeyFromSeed, getPathSegments } from '../src/wallet/bip32' +import { Mnemonic } from '../src/mnemonic/index.js' +import { childKeyDerivationHardened, getMasterKeyFromSeed, getPathSegments } from '../src/wallet/bip32.js' const TEST_MNEMONIC = 'test test test test test test test test test test test junk' const MNEMONIC_ABANDON = 'abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about' diff --git a/test/note.test.ts b/test/note.test.ts index abf73dd..e7058c7 100644 --- a/test/note.test.ts +++ b/test/note.test.ts @@ -3,9 +3,9 @@ import { before, test } from 'node:test' import { bytesToBigInt, bytesToHex, hexToBytes } from '@railgun-reloaded/bytes' -import { initializeCryptographyLibs } from '../src/keys' -import { Note } from '../src/notes/note' -import { computeTokenHash } from '../src/notes/token-utils' +import { initializeCryptographyLibs } from '../src/keys.js' +import { Note } from '../src/notes/note.js' +import { computeTokenHash } from '../src/notes/token-utils.js' const TEST_TOKEN_ADDRESS = hexToBytes('0x1234567890123456789012345678901234567890') const TEST_NPK = diff --git a/test/shield-note.test.ts b/test/shield-note.test.ts index 40babfd..8e426d8 100644 --- a/test/shield-note.test.ts +++ b/test/shield-note.test.ts @@ -9,9 +9,9 @@ import { getPublicViewingKey, getSharedSymmetricKey, initializeCryptographyLibs, -} from '../src/keys' -import { ShieldNote } from '../src/notes/shield-note' -import { computeTokenHash } from '../src/notes/token-utils' +} from '../src/keys.js' +import { ShieldNote } from '../src/notes/shield-note.js' +import { computeTokenHash } from '../src/notes/token-utils.js' const TEST_TOKEN_ADDRESS = hexToBytes('0x1234567890123456789012345678901234567890') const TEST_TOKEN_SUB_ID_ZERO = new Uint8Array(32) diff --git a/test/token-utils.test.ts b/test/token-utils.test.ts index 8d5fe8a..37041a6 100644 --- a/test/token-utils.test.ts +++ b/test/token-utils.test.ts @@ -3,7 +3,7 @@ import { before, test } from 'node:test' import { bytesToBigInt, hexToBytes } from '@railgun-reloaded/bytes' -import { initializeCryptographyLibs } from '../src/keys' +import { initializeCryptographyLibs } from '../src/keys.js' import { assertValidNoteToken, computeTokenHash, @@ -13,7 +13,7 @@ import { getReadableTokenAddress, getTokenDataERC20, serializeTokenData, -} from '../src/notes/token-utils' +} from '../src/notes/token-utils.js' const TEST_TOKEN_ADDRESS = hexToBytes('0x1234567890123456789012345678901234567890') const TEST_VALUE = 1000000000000000000n // 1 ETH diff --git a/test/transact-note.test.ts b/test/transact-note.test.ts index 08edb0d..6b9f80b 100644 --- a/test/transact-note.test.ts +++ b/test/transact-note.test.ts @@ -4,12 +4,12 @@ import { before, test } from 'node:test' import { randomBytes } from '@noble/hashes/utils' import { bytesToBigInt, hexToBytes, stripHexPrefix } from '@railgun-reloaded/bytes' -import { initializeCryptographyLibs } from '../src/keys' -import type { TokenDataGetter } from '../src/notes/definitions' -import { ChainType, TXIDVersion } from '../src/notes/definitions' -import { Note } from '../src/notes/note' -import { computeTokenHash } from '../src/notes/token-utils' -import { TransactNote } from '../src/notes/transact-note' +import { initializeCryptographyLibs } from '../src/keys.js' +import type { TokenDataGetter } from '../src/notes/definitions.js' +import { ChainType, TXIDVersion } from '../src/notes/definitions.js' +import { Note } from '../src/notes/note.js' +import { computeTokenHash } from '../src/notes/token-utils.js' +import { TransactNote } from '../src/notes/transact-note.js' const TEST_CHAIN = { type: ChainType.EVM, id: 1 } diff --git a/test/unshield-note.test.ts b/test/unshield-note.test.ts index 9327ccd..b88952d 100644 --- a/test/unshield-note.test.ts +++ b/test/unshield-note.test.ts @@ -4,8 +4,8 @@ import { before, test } from 'node:test' import { hexToBytes } from '@railgun-reloaded/bytes' import { ActionType } from '@railgun-reloaded/scanner' -import { initializeCryptographyLibs } from '../src/keys' -import { UnshieldNote } from '../src/notes/unshield-note' +import { initializeCryptographyLibs } from '../src/keys.js' +import { UnshieldNote } from '../src/notes/unshield-note.js' const TEST_TOKEN_ADDRESS = hexToBytes('0x1234567890123456789012345678901234567890') const TEST_TOKEN_SUB_ID_ZERO = new Uint8Array(32) diff --git a/test/wallet-info.test.ts b/test/wallet-info.test.ts index c74fc10..6764a07 100644 --- a/test/wallet-info.test.ts +++ b/test/wallet-info.test.ts @@ -1,7 +1,7 @@ import assert from 'node:assert/strict' import { test } from 'node:test' -import { WalletInfo } from '../src/notes/wallet-info' +import { WalletInfo } from '../src/notes/wallet-info.js' test('wallet-info - encode and decode roundtrip', () => { const source = 'railway wallet' diff --git a/test/wallet-node.test.ts b/test/wallet-node.test.ts index 1d7f554..bb6fb89 100644 --- a/test/wallet-node.test.ts +++ b/test/wallet-node.test.ts @@ -4,9 +4,9 @@ import { before, test } from 'node:test' import { stringify } from '@railgun-reloaded/0zk-addresses' import { hexToBytes } from '@railgun-reloaded/bytes' -import { initializeCryptographyLibs } from '../src/keys' -import { RailgunWallet } from '../src/wallet/railgun-wallet' -import { WalletNode } from '../src/wallet/wallet-node' +import { initializeCryptographyLibs } from '../src/keys.js' +import { RailgunWallet } from '../src/wallet/railgun-wallet.js' +import { WalletNode } from '../src/wallet/wallet-node.js' const TEST_MNEMONIC = 'test test test test test test test test test test test junk' const TEST_MNEMONIC_2 = 'abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about' From b36430f1898a8ea2fce3503d8f59aef161b4e4b7 Mon Sep 17 00:00:00 2001 From: Matt Grote Date: Fri, 19 Jun 2026 14:20:02 -0300 Subject: [PATCH 2/2] chore: repoint 0zk-addresses and cryptography pins to dev and regenerate lockfile --- package-lock.json | 16 ++++++++-------- package.json | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9c1e398..dadab3e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,9 +12,9 @@ "@msgpack/msgpack": "^3.1.3", "@noble/ed25519": "^2.3.0", "@noble/hashes": "^1.8.0", - "@railgun-reloaded/0zk-addresses": "https://github.com/railgun-reloaded/0zk-addresses", + "@railgun-reloaded/0zk-addresses": "https://github.com/railgun-reloaded/0zk-addresses#dev", "@railgun-reloaded/bytes": "git+https://github.com/railgun-reloaded/bytes.git#dev", - "@railgun-reloaded/cryptography": "git+https://github.com/railgun-reloaded/cryptography.git#main", + "@railgun-reloaded/cryptography": "git+https://github.com/railgun-reloaded/cryptography.git#dev", "@railgun-reloaded/eslint-config": "^1.1.0", "@railgun-reloaded/scanner": "https://github.com/railgun-reloaded/scanner#dev", "@railgun-reloaded/tsconfig": "^1.2.0", @@ -1022,7 +1022,7 @@ }, "node_modules/@railgun-reloaded/0zk-addresses": { "version": "1.0.0", - "resolved": "git+ssh://git@github.com/railgun-reloaded/0zk-addresses.git#f4809f4cdf568af75063471471109e18ee3126b0", + "resolved": "git+ssh://git@github.com/railgun-reloaded/0zk-addresses.git#ae42669384becd51132d74eabeb966dc03f833b5", "license": "MIT", "dependencies": { "@scure/base": "^1.2.4" @@ -1040,7 +1040,7 @@ }, "node_modules/@railgun-reloaded/cryptography": { "version": "0.0.1", - "resolved": "git+ssh://git@github.com/railgun-reloaded/cryptography.git#8f4a819bcaa6891724f01724a4c841e236f20a55", + "resolved": "git+ssh://git@github.com/railgun-reloaded/cryptography.git#9d381d2dbd22ffaa6c887ba8e3e8a4a87390b94f", "license": "MIT", "dependencies": { "@noble/hashes": "^1.8.0", @@ -5752,8 +5752,8 @@ "integrity": "sha512-uu43FGU34B5VM9mCNjXCwLaGHYjXdNincqKLaraaCW+7S2+SmiBg1Nv8bPnmschrIfZmfKNY9f3fC376MRrObw==" }, "@railgun-reloaded/0zk-addresses": { - "version": "git+ssh://git@github.com/railgun-reloaded/0zk-addresses.git#f4809f4cdf568af75063471471109e18ee3126b0", - "from": "@railgun-reloaded/0zk-addresses@https://github.com/railgun-reloaded/0zk-addresses", + "version": "git+ssh://git@github.com/railgun-reloaded/0zk-addresses.git#ae42669384becd51132d74eabeb966dc03f833b5", + "from": "@railgun-reloaded/0zk-addresses@https://github.com/railgun-reloaded/0zk-addresses#dev", "requires": { "@scure/base": "^1.2.4" } @@ -5768,8 +5768,8 @@ "integrity": "sha512-mY5xNq3DPbVLHCMoUPfo360o8fb055yqCIxIKSr+P9U1AFReX5+zlPLE0t1xbb3bkCjiEVkCC7iiishCoeUZvQ==" }, "@railgun-reloaded/cryptography": { - "version": "git+ssh://git@github.com/railgun-reloaded/cryptography.git#8f4a819bcaa6891724f01724a4c841e236f20a55", - "from": "@railgun-reloaded/cryptography@git+https://github.com/railgun-reloaded/cryptography.git#main", + "version": "git+ssh://git@github.com/railgun-reloaded/cryptography.git#9d381d2dbd22ffaa6c887ba8e3e8a4a87390b94f", + "from": "@railgun-reloaded/cryptography@git+https://github.com/railgun-reloaded/cryptography.git#dev", "requires": { "@noble/hashes": "^1.8.0", "@railgun-reloaded/bytes": "git+https://github.com/railgun-reloaded/bytes.git#dev", diff --git a/package.json b/package.json index 66a2d52..81a6d5f 100644 --- a/package.json +++ b/package.json @@ -35,9 +35,9 @@ "@msgpack/msgpack": "^3.1.3", "@noble/ed25519": "^2.3.0", "@noble/hashes": "^1.8.0", - "@railgun-reloaded/0zk-addresses": "https://github.com/railgun-reloaded/0zk-addresses", + "@railgun-reloaded/0zk-addresses": "https://github.com/railgun-reloaded/0zk-addresses#dev", "@railgun-reloaded/bytes": "git+https://github.com/railgun-reloaded/bytes.git#dev", - "@railgun-reloaded/cryptography": "git+https://github.com/railgun-reloaded/cryptography.git#main", + "@railgun-reloaded/cryptography": "git+https://github.com/railgun-reloaded/cryptography.git#dev", "@railgun-reloaded/eslint-config": "^1.1.0", "@railgun-reloaded/scanner": "https://github.com/railgun-reloaded/scanner#dev", "@railgun-reloaded/tsconfig": "^1.2.0",