Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
130 commits
Select commit Hold shift + click to select a range
5a13086
update to @syscoin package domain
Jul 25, 2025
a41a00d
update to @sidhujag namespace
Jul 26, 2025
c6899ed
export getChainById
Jul 26, 2025
269b5a9
update keyring
Jul 26, 2025
a867823
update utils
Jul 26, 2025
880616d
Update package.json
Jul 26, 2025
46319cd
update keyring
Jul 26, 2025
4558378
fix tests
Jul 26, 2025
4158ef8
rm deprecated Descriptor usage in ledger bitcoin and rm unused package
Jul 26, 2025
b068f1c
move ethers to peer dep
Jul 26, 2025
af2efc1
proper peer dep management
Jul 26, 2025
f5fcd45
update utils
Jul 26, 2025
a8844aa
update dep
Jul 26, 2025
ab02da6
Revert "update dep"
Jul 26, 2025
f78ea60
Revert "update utils"
Jul 26, 2025
89623f4
Revert "proper peer dep management"
Jul 26, 2025
863d322
Revert "move ethers to peer dep"
Jul 26, 2025
b205cab
stable dep
Jul 26, 2025
9ad5e40
finalize deps
Jul 26, 2025
13b65a4
rm ISyscoinTransactionError
Jul 27, 2025
359e2d9
update node version for yml
Jul 27, 2025
e95ca49
rm tokens.json (not used)
Jul 27, 2025
71a3330
update utils + remove rounding on getBalance
Jul 27, 2025
9e2c7f5
add secure wrapper for crypto operations
Jul 29, 2025
115ed2f
fix: vault corruption
Jul 29, 2025
3c18dd9
rev keyring
Jul 29, 2025
66edd8b
use readonly signers until actually signing
Jul 29, 2025
7c07aa8
rm unused getsigner in trezor
Jul 29, 2025
78e0420
add address and amount checks on trezor type
Jul 29, 2025
7df680e
update packages from sjs lib update
Jul 30, 2025
bbe428e
Update package.json
Jul 30, 2025
24b66ba
cleanup when locked, cleanup sensitive logging
Jul 30, 2025
64df6ef
update versions
Jul 30, 2025
53409cc
fix: solve trezor signing bug
lucasgabrielgsp Jul 30, 2025
4a0eb3b
Revert "fix: solve trezor signing bug"
Jul 31, 2025
448133f
get proper abi to check for nft metadata
Jul 31, 2025
4fdd033
Update package.json
Jul 31, 2025
7752518
update utils version
Jul 31, 2025
b40d750
update from eth-sig-util to @metamask/eth-sig-util
Aug 1, 2025
ea6248b
rm global ethers packages
Aug 3, 2025
3d19763
update ethers packages
Aug 3, 2025
adfd37e
reject invalid private keys based on network type
Aug 3, 2025
0b5cf24
fix: bypass wrong validation for hardware wallets
lucasgabrielgsp Aug 4, 2025
df8bd1a
rm deprecated sendtransaction and add hw support for speedup/cancel
Aug 4, 2025
62723dc
fix: adjust speed/cancel txs for hw wallets
lucasgabrielgsp Aug 4, 2025
e6bc214
chore: merge changes
lucasgabrielgsp Aug 4, 2025
9ba71ca
set legacy type so ethers doesnt override it for legacy sends
Aug 5, 2025
c2e89ee
send/cancel fix for gas prices if not set or 0
Aug 5, 2025
ac2a585
use fallback if tx doesnt exist from provider
Aug 5, 2025
443e1f7
fix potential precision issues with amounts/balances
Aug 6, 2025
72b10d4
fix psbt unknownKeyVals key lookup
Aug 7, 2025
632e9e2
fix sending odd decimal amounts, resolve based on provided decimals n…
Aug 8, 2025
f72b297
speedup reliability and error codes
Aug 11, 2025
acdc443
feat: add support for utxo networks with ledger
lucasgabrielgsp Aug 13, 2025
94d4028
chore: merge changes
lucasgabrielgsp Aug 13, 2025
cfb90e8
add cancellation checks and ledger display true fallback, add wallet …
Aug 13, 2025
8d89f49
feat: use internal UTXO client to handle UTXO networks
lucasgabrielgsp Aug 13, 2025
7b749dd
chore: merge changes
lucasgabrielgsp Aug 13, 2025
1cd2b7d
convertExtendedKeyVersion + fix fromBase58
Aug 13, 2025
700e447
enhance convertToLedgerFormat to add derivations for change/outputs
Aug 13, 2025
8ae72e4
log any missing derivation paths on inputs and outputs
Aug 13, 2025
1a418c6
use device friendly xpub format in signpsbt
Aug 13, 2025
947b785
add wif import support for utxo
Aug 21, 2025
2a1d872
update sjs lib
Aug 21, 2025
d864f46
add watch only utxo support
Aug 22, 2025
84cdd52
direct BB validation + update sjs lib
Aug 22, 2025
c0eaf25
add std seed word lengths
Aug 23, 2025
c3316d8
clamp utxo fee to 1 to ensure rounding issues wont prevent sends on t…
Aug 26, 2025
c0ebe97
add support for importing legacy utxo address types
Aug 27, 2025
19c72e3
rm network labels from default labels for import/watch-only accounts
Aug 27, 2025
f46ec84
update to latest bjs lib and add taproot support
Aug 27, 2025
266e3c1
use sjs bip84, rm bip39/84 bs58check from dependencies
Aug 27, 2025
3b89eb0
rm depenenceis from utils
Aug 27, 2025
653ff53
update sjs lib
Aug 27, 2025
40f523b
fix signers (readonly for hw and proper signer for creating psbts for…
Aug 28, 2025
05faa94
update sjs lib
Aug 28, 2025
ef97827
update sjs lib
Aug 28, 2025
f4c7539
update sjs lib
Aug 28, 2025
391c1f8
rm unused dependencies and factor out descriptors
Aug 29, 2025
8b98fd3
fix wif import test
Aug 29, 2025
d3163fc
rm zksync ethers provider
Aug 29, 2025
c2c48d1
omit legacy tx fields if sending non legacy txs
Aug 29, 2025
0e37df6
always import address index 0 for hw accounts
Aug 30, 2025
72b10d9
fix ledger conversion checking for path in derivation properly
Sep 1, 2025
99873a9
clean up input path checks
Sep 1, 2025
07d8ec2
Update package.json
Sep 1, 2025
413e1c5
only use bitcoinjs for typing but use embedded one from sjs lib for c…
Sep 1, 2025
32cdc58
fix prevhash hex string issue
Sep 1, 2025
6e72b15
use sjs finalize psbt helper instead of custom validator in trezor si…
Sep 1, 2025
81b62b2
update btc test bb
Sep 2, 2025
4cc1363
add psbt typings
Sep 2, 2025
83ffec6
update versions
Sep 2, 2025
3dc524f
fix fromBitcoinJS to allow string/buffer input
Sep 2, 2025
5aa1232
resolve networks re: testnet for psbt conversions
Sep 2, 2025
f3b6ce4
fix external psbt wrapping typing confusion + fromPali fix
Sep 2, 2025
6a98ff5
Update package.json
Sep 2, 2025
f35ce2a
use paytowitness for both p2wpkh and p2wsh outputs
Sep 2, 2025
76ea2e7
update ledger-bitcoin code
Sep 2, 2025
16ef984
pass errors up on connect to hw
Sep 3, 2025
9c139a5
await hw destroys on lock
Sep 4, 2025
7b16b61
chore: merge changes from main
lucasgabrielgsp Sep 10, 2025
a2ba45d
generic verifyUtxoAddress for ledger/trezor
Sep 11, 2025
1555f74
Revert "chore: merge changes from main"
lucasgabrielgsp Sep 12, 2025
772a4b7
Merge branch 'main' of https://github.com/sidhujag/sysweb3
Sep 12, 2025
54e3ed5
use correct xpub extended key version bytes for ledger, avoid dbl con…
Sep 12, 2025
03221ff
fix: use named policy
lucasgabrielgsp Sep 19, 2025
46c098f
Update package.json
Sep 25, 2025
c173343
fix: add zksync support to getting fees correctly
lucasgabrielgsp Oct 6, 2025
16758f5
1.0.564
Oct 14, 2025
a742a37
fix: solve ledger connection across networks
lucasgabrielgsp Oct 22, 2025
e356d61
Merge branch 'main' of https://github.com/sidhujag/sysweb3
lucasgabrielgsp Oct 22, 2025
a089723
update version of keyring to 1.0.565
Oct 22, 2025
2796048
fix 001, 007
Dec 29, 2025
6ab4b69
refactor(ledger): remove excessive debug logging from PSBT enrichment
guilhermefleury Dec 29, 2025
97a3006
rm hash from vault storage, use aes-gcm for blob storage
Dec 30, 2025
9fbb26c
use default wallet policy instead of custom HMAC for ledger
Dec 30, 2025
6c3cf80
Update package.json
Dec 30, 2025
f942eb0
go back to wallet policy as it was
Dec 31, 2025
ffa2577
harden web3 provider singleton to check network state and recreate
Dec 31, 2025
7f39c15
Update package.json
Dec 31, 2025
e902bb1
handle max send when sending tx
Dec 31, 2025
84caffa
dont block evm signer from being set of xpub is missing
Dec 31, 2025
b08edb2
Update package.json
Dec 31, 2025
b497151
Revert "handle max send when sending tx"
Dec 31, 2025
1ad4272
Update package.json
Dec 31, 2025
8287885
update dependences include kdf to 900k
Jan 16, 2026
dae621b
Fix imported zpub signing and remove zkSync handling
May 27, 2026
f91fc36
Merge pull request #3 from sidhujag/keyring-zpub-zksync-cleanup
sidhujag May 27, 2026
955d013
Update yarn.lock
May 27, 2026
642f17b
feat(keyring): add passkey smart account metadata
May 31, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
],
"pathGroups": [
{
"pattern": "@pollum-io/**",
"pattern": "syscoin/**",
"group": "index"
}
],
"pathGroupsExcludedImportTypes": ["@pollum-io/**"],
"pathGroupsExcludedImportTypes": ["syscoin/**"],
"newlines-between": "always",
"alphabetize": {
"order": "asc",
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16'
node-version: '23.11.1'
check-latest: true
- run: yarn install
- run: |
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ SysWeb3 is a JavaScript API for Syscoin multi-chain, providing a collection of u

This monorepo contains the following packages:

- **@pollum-io/sysweb3-keyring**: A keyring manager for UTXO and Web3 wallets, providing functions for handling wallets, addresses, accounts, transactions, and Trezor wallet integration.
- **@pollum-io/sysweb3-network**: A network management tool for multi-chain accounts, offering functions to validate RPC URLs and manage network configurations.
- **@pollum-io/sysweb3-utils**: A helper library for multi-chain accounts, providing TypeScript interfaces and utility functions for contract interactions, token validation, and more.
- **@pollum-io/sysweb3-core**: A localStorage manager for private keys, offering browser interaction functions for setting, getting, and deleting storage.
- **@sidhujag/sysweb3-keyring**: A keyring manager for UTXO and Web3 wallets, providing functions for handling wallets, addresses, accounts, transactions, and Trezor wallet integration.
- **@sidhujag/sysweb3-network**: A network management tool for multi-chain accounts, offering functions to validate RPC URLs and manage network configurations.
- **@sidhujag/sysweb3-utils**: A helper library for multi-chain accounts, providing TypeScript interfaces and utility functions for contract interactions, token validation, and more.
- **@sidhujag/sysweb3-core**: A localStorage manager for private keys, offering browser interaction functions for setting, getting, and deleting storage.

## Setup

Expand All @@ -23,7 +23,7 @@ This monorepo contains the following packages:
To install the packages, run:

```bash
yarn add @pollum-io/sysweb3-keyring @pollum-io/sysweb3-network @pollum-io/sysweb3-utils @pollum-io/sysweb3-core
yarn add @sidhujag/sysweb3-keyring @sidhujag/sysweb3-network @sidhujag/sysweb3-utils @sidhujag/sysweb3-core
```

## Usage
Expand All @@ -33,7 +33,7 @@ yarn add @pollum-io/sysweb3-keyring @pollum-io/sysweb3-network @pollum-io/sysweb
The SysWeb3 Keyring package provides functions for managing accounts, addresses, and transactions. Here's a simple example:

```js
import sysweb3 from '@pollum-io/sysweb3-keyring';
import sysweb3 from '@sidhujag/sysweb3-keyring';

console.log(sysweb3);
// Outputs available functions like Web3Accounts, SyscoinAddress, initialize, TrezorTransactions, etc.
Expand All @@ -44,7 +44,7 @@ console.log(sysweb3);
The SysWeb3 Network package offers functions for network management. Example:

```js
import sysweb3 from '@pollum-io/sysweb3-network';
import sysweb3 from '@sidhujag/sysweb3-network';

console.log(sysweb3);
// Outputs functions like validateCurrentRpcUrl, validateSysRpc, setSignerNetwork, etc.
Expand All @@ -55,7 +55,7 @@ console.log(sysweb3);
The SysWeb3 Utils package provides utility functions for multi-chain accounts. Example:

```js
import sysweb3 from '@pollum-io/sysweb3-utils';
import sysweb3 from '@sidhujag/sysweb3-utils';

console.log(sysweb3);
// Outputs functions like isValidSYSAddress, isValidEthereumAddress, getNftImage, createContractUsingAbi, etc.
Expand All @@ -66,7 +66,7 @@ console.log(sysweb3);
The SysWeb3 Core package offers browser interaction functions. Example:

```js
import sysweb3 from '@pollum-io/sysweb3-core';
import sysweb3 from '@sidhujag/sysweb3-core';

console.log(sysweb3);
// Outputs functions like useLocalStorageClient, getStateStorageDb, etc.
Expand Down
213 changes: 213 additions & 0 deletions docs/npm-publish-guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,213 @@
# Publishing sysweb3 Packages to npm under @syscoin

This guide explains how to publish the sysweb3 packages to npm under the `@syscoin` organization scope.

## Prerequisites

1. **npm Account**: You need an npm account with publish access to the `@syscoin` organization
2. **Node.js**: Version 14 or higher
3. **Yarn**: Version 1.x installed globally

## Step 1: Run the Migration Script

First, update all package names from the incorrect format to the proper npm scoped format:

```bash
cd sysweb3
node scripts/migrate-to-syscoin-npm.js
```

This script will:

- Update all package names from `syscoin/package-name` to `@sidhujag/package-name`
- Update inter-package dependencies to use the new names
- Update pali-wallet's package.json to reference the new names

## Step 2: Build All Packages

Build all packages with their updated names:

```bash
cd sysweb3
yarn build:all
```

This builds all packages in the correct order:

1. sysweb3-core
2. sysweb3-network
3. sysweb3-utils
4. sysweb3-keyring

## Step 3: Login to npm

Login to npm with your account that has access to the @syscoin organization:

```bash
npm login --scope=@syscoin
```

## Step 4: Verify Package Contents (Optional but Recommended)

Before publishing, verify what will be published for each package:

```bash
cd packages/sysweb3-core
yarn release:preflight

cd ../sysweb3-network
yarn release:preflight

cd ../sysweb3-utils
yarn release:preflight

cd ../sysweb3-keyring
yarn release:preflight
```

## Step 5: Publish to npm

### Option A: Publish All at Once

From the sysweb3 root directory:

```bash
cd sysweb3
yarn publish:all
```

### Option B: Publish Individually

If you prefer to publish packages one by one:

```bash
# Publish core first
cd packages/sysweb3-core
yarn release:npm

# Then network
cd ../sysweb3-network
yarn release:npm

# Then utils
cd ../sysweb3-utils
yarn release:npm

# Finally keyring
cd ../sysweb3-keyring
yarn release:npm
```

## Step 6: Update pali-wallet to Use npm Packages

After publishing, update pali-wallet to use the npm packages instead of local file references:

```bash
cd pali-wallet

# Remove local symlinks
rm -rf node_modules/@syscoin

# Install from npm
yarn add @sidhujag/sysweb3-core@latest @sidhujag/sysweb3-network@latest @sidhujag/sysweb3-utils@latest @sidhujag/sysweb3-keyring@latest
```

## Version Management

### Updating Version Numbers

Before publishing, update version numbers in each package's package.json:

```bash
# Example: bump patch version
cd packages/sysweb3-core
npm version patch

# Or manually edit package.json
```

### Version Strategy

- **Patch**: Bug fixes (1.0.1 → 1.0.2)
- **Minor**: New features, backward compatible (1.0.0 → 1.1.0)
- **Major**: Breaking changes (1.0.0 → 2.0.0)

## Troubleshooting

### Permission Denied Error

If you get a permission error when publishing:

```bash
npm ERR! 403 Forbidden - You do not have permission to publish "@sidhujag/package-name"
```

Make sure:

1. You're logged in: `npm whoami`
2. You have publish access to @syscoin org
3. The package doesn't already exist with that exact version

### Package Already Exists

If a version already exists, bump the version number:

```bash
cd packages/sysweb3-core
npm version patch
yarn release:npm
```

### Build Errors

If you encounter build errors:

```bash
# Clean and rebuild
cd sysweb3
rm -rf packages/*/dist
yarn build:all
```

## CI/CD Integration

For automated publishing, you can use GitHub Actions with npm tokens:

1. Generate an npm token: https://www.npmjs.com/settings/YOUR_USERNAME/tokens
2. Add it as a GitHub secret: `NPM_TOKEN`
3. Use in GitHub Actions workflow

## Security Notes

- Never commit npm tokens or credentials
- Use 2FA on your npm account
- Regularly rotate npm tokens
- Review package contents before publishing

## Summary

The complete publishing flow:

```bash
# 1. Migrate package names
cd sysweb3
node scripts/migrate-to-syscoin-npm.js

# 2. Build everything
yarn build:all

# 3. Login to npm
npm login --scope=@syscoin

# 4. Publish
yarn publish:all

# 5. Success! 🎉
```

Your packages are now available at:

- https://www.npmjs.com/package/@sidhujag/sysweb3-core
- https://www.npmjs.com/package/@sidhujag/sysweb3-network
- https://www.npmjs.com/package/@sidhujag/sysweb3-utils
- https://www.npmjs.com/package/@sidhujag/sysweb3-keyring
11 changes: 7 additions & 4 deletions jest.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@
"isomorphic-fetch": "<rootDir>/__mocks__/isomorphic-fetch.js"
},
"setupFilesAfterEnv": ["<rootDir>/jest.setup.js"],
"globals": {
"ts-jest": {
"isolatedModules": true
}
"transform": {
"^.+\\.tsx?$": [
"ts-jest",
{
"isolatedModules": true
}
]
}
}
Loading
Loading