Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
54 changes: 54 additions & 0 deletions bindings/node/Cargo.lock

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

1 change: 1 addition & 0 deletions bindings/node/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ ows sign tx --wallet agent-treasury --chain evm --tx "deadbeef..."
| XRPL | secp256k1 | Base58Check (`r...`) | `m/44'/144'/0'/0/0` |
| Spark (Bitcoin L2) | secp256k1 | spark: prefixed | `m/84'/0'/0'/0/0` |
| Filecoin | secp256k1 | f1 base32 | `m/44'/461'/0'/0/0` |
| Stellar | Ed25519 | StrKey Base32 (`G...`) | `m/44'/148'/{index}'` |

## CLI Reference

Expand Down
15 changes: 8 additions & 7 deletions bindings/node/__test__/index.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,18 @@ describe('@open-wallet-standard/core', () => {

it('derives addresses for all chains', () => {
const phrase = generateMnemonic(12);
for (const chain of ['evm', 'solana', 'sui', 'bitcoin', 'cosmos', 'tron', 'ton', 'filecoin', 'xrpl']) {
for (const chain of ['evm', 'solana', 'sui', 'bitcoin', 'cosmos', 'tron', 'ton', 'filecoin', 'xrpl', 'stellar']) {
const addr = deriveAddress(phrase, chain);
assert.ok(addr.length > 0, `address should be non-empty for ${chain}`);
}
});

// ---- Universal wallet lifecycle ----

it('creates a universal wallet with 9 accounts', () => {
it('creates a universal wallet with 10 accounts', () => {
const wallet = createWallet('lifecycle-test', undefined, 12, vaultDir);
assert.equal(wallet.name, 'lifecycle-test');
assert.equal(wallet.accounts.length, 9);
assert.equal(wallet.accounts.length, 10);

const chainIds = wallet.accounts.map((a) => a.chainId);
assert.ok(chainIds.some((c) => c.startsWith('eip155:')));
Expand All @@ -74,6 +74,7 @@ describe('@open-wallet-standard/core', () => {
assert.ok(chainIds.some((c) => c.startsWith('ton:')));
assert.ok(chainIds.some((c) => c.startsWith('fil:')));
assert.ok(chainIds.some((c) => c.startsWith('xrpl:')));
assert.ok(chainIds.some((c) => c.startsWith('stellar:')));

// List
const wallets = listWallets(vaultDir);
Expand Down Expand Up @@ -107,7 +108,7 @@ describe('@open-wallet-standard/core', () => {

const wallet = importWalletMnemonic('mn-import', phrase, undefined, undefined, vaultDir);
assert.equal(wallet.name, 'mn-import');
assert.equal(wallet.accounts.length, 9);
assert.equal(wallet.accounts.length, 10);

const evmAcct = wallet.accounts.find((a) => a.chainId.startsWith('eip155:'));
assert.equal(evmAcct.address, expectedEvm);
Expand All @@ -125,7 +126,7 @@ describe('@open-wallet-standard/core', () => {
const wallet = importWalletPrivateKey('pk-secp', privkey, undefined, vaultDir, 'evm');

assert.equal(wallet.name, 'pk-secp');
assert.equal(wallet.accounts.length, 9, 'should have all 9 chain accounts');
assert.equal(wallet.accounts.length, 10, 'should have all 10 chain accounts');

// Sign on EVM (provided key's curve)
const evmSig = signMessage('pk-secp', 'evm', 'hello', undefined, undefined, undefined, vaultDir);
Expand All @@ -149,7 +150,7 @@ describe('@open-wallet-standard/core', () => {
const privkey = '9d61b19deffd5a60ba844af492ec2cc44449c5697b326919703bac031cae7f60';
const wallet = importWalletPrivateKey('pk-ed', privkey, undefined, vaultDir, 'solana');

assert.equal(wallet.accounts.length, 9);
assert.equal(wallet.accounts.length, 10);

// Sign on Solana (provided key)
const solSig = signMessage('pk-ed', 'solana', 'hello', undefined, undefined, undefined, vaultDir);
Expand Down Expand Up @@ -177,7 +178,7 @@ describe('@open-wallet-standard/core', () => {
);

assert.equal(wallet.name, 'pk-both');
assert.equal(wallet.accounts.length, 9, 'should have all 9 chain accounts');
assert.equal(wallet.accounts.length, 10, 'should have all 10 chain accounts');

// Sign on EVM (secp256k1 key)
const evmSig = signMessage('pk-both', 'evm', 'hello', undefined, undefined, undefined, vaultDir);
Expand Down
Loading