@newtype-ai/nit 0.4.8 → 0.4.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,7 +1,20 @@
1
1
  # nit
2
2
 
3
+ [![Node.js 18+](https://img.shields.io/badge/Node.js-18%2B-339933?logo=node.js&logoColor=white)](https://nodejs.org)
4
+ [![npm](https://img.shields.io/npm/v/@newtype-ai/nit?color=cb0000)](https://www.npmjs.com/package/@newtype-ai/nit)
5
+
3
6
  Git for agent identity.
4
7
 
8
+ ```
9
+ _ _ _____
10
+ | \ |"| ___ |_ " _|
11
+ <| \| |> |_"_| | |
12
+ U| |\ |u | | /| |\
13
+ |_| \_| U/| |\u u |_|U
14
+ || \\,-.-,_|___|_,-._// \\_
15
+ (_") (_/ \_)-' '-(_/(__) (__)
16
+ ```
17
+
5
18
  **One identity. Any apps.**
6
19
 
7
20
  - **Self-sovereign** — your keys, your identity. No authority assigns or revokes it
@@ -58,9 +71,12 @@ One keypair, multiple chains. No seed phrases, no extra key management.
58
71
 
59
72
  - **Solana** — your Ed25519 public key *is* your Solana address
60
73
  - **EVM** (Ethereum, BSC, Polygon, Arbitrum, etc.) — deterministic secp256k1 derivation from your Ed25519 seed
74
+ - **Sign & broadcast** — sign transactions and send them to any RPC endpoint
61
75
 
62
76
  ```bash
63
77
  nit status # shows your wallet addresses
78
+ nit sign-tx --chain evm <hash> # sign a transaction
79
+ nit broadcast --chain evm <tx> # broadcast to RPC
64
80
  ```
65
81
 
66
82
  ### Skill resolution
@@ -103,6 +119,10 @@ Pure Node.js builtins. No bloat.
103
119
  | `nit remote` | Show remote URL and credential status |
104
120
  | `nit remote add <name> <url>` | Add a new remote |
105
121
  | `nit remote set-url <name> <url>` | Change a remote's URL |
122
+ | `nit sign-tx --chain <c> <data>` | Sign transaction data (EVM: 32-byte hash, Solana: message bytes) |
123
+ | `nit broadcast --chain <c> <tx>` | Broadcast signed transaction to configured RPC endpoint |
124
+ | `nit rpc` | Show configured RPC endpoints |
125
+ | `nit rpc set-url <chain> <url>` | Set RPC endpoint for a chain |
106
126
 
107
127
  ## How It Works
108
128
 
@@ -164,7 +184,10 @@ your-project/
164
184
  ## Programmatic API
165
185
 
166
186
  ```typescript
167
- import { init, commit, checkout, branch, push, status, sign, loginPayload, loadRawKeyPair, getWalletAddresses } from '@newtype-ai/nit';
187
+ import {
188
+ init, commit, checkout, branch, push, status, sign, loginPayload,
189
+ loadRawKeyPair, getWalletAddresses, signTx, broadcast, rpcSetUrl,
190
+ } from '@newtype-ai/nit';
168
191
 
169
192
  await init();
170
193
 
@@ -183,6 +206,13 @@ const keypair = await loadRawKeyPair('/path/to/.nit');
183
206
  // Get blockchain wallet addresses (derived from your identity)
184
207
  const addresses = await getWalletAddresses('/path/to/.nit');
185
208
  // → { solana: "C54kvW3...", ethereum: "0x2317..." }
209
+
210
+ // Sign and broadcast transactions
211
+ await rpcSetUrl('evm', 'https://eth.llamarpc.com');
212
+ const sig = await signTx('evm', '0x<32-byte-keccak256-hash>');
213
+ // → { chain: 'evm', signature: '0x...', recovery: 0, address: '0x...' }
214
+ await broadcast('evm', '0x<signed-tx-hex>');
215
+ // → { chain: 'evm', txHash: '0x...', rpcUrl: 'https://...' }
186
216
  ```
187
217
 
188
218
  ## License