@hula-privacy/mixer 0.1.0 → 0.3.0
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 +11 -11
- package/dist/index.d.mts +933 -0
- package/dist/index.d.ts +933 -0
- package/dist/index.js +2587 -0
- package/dist/index.mjs +2480 -0
- package/package.json +1 -8
- package/src/api.ts +5 -1
- package/src/crypto.ts +32 -12
- package/src/idl.ts +838 -0
- package/src/merkle.ts +3 -1
- package/src/transaction.ts +3 -4
- package/src/types.ts +2 -0
- package/src/utxo.ts +26 -11
- package/src/wallet.ts +238 -36
package/README.md
CHANGED
|
@@ -5,15 +5,15 @@ Complete toolkit for privacy transactions on Solana using ZK proofs and UTXOs.
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npm install @hula/
|
|
8
|
+
npm install @hula-privacy/mixer
|
|
9
9
|
# or
|
|
10
|
-
bun add @hula/
|
|
10
|
+
bun add @hula-privacy/mixer
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
## Quick Start
|
|
14
14
|
|
|
15
15
|
```typescript
|
|
16
|
-
import { HulaWallet, initHulaSDK, getKeyDerivationMessage } from '@hula/
|
|
16
|
+
import { HulaWallet, initHulaSDK, getKeyDerivationMessage } from '@hula-privacy/mixer';
|
|
17
17
|
|
|
18
18
|
// Initialize SDK (loads Poseidon hasher)
|
|
19
19
|
await initHulaSDK();
|
|
@@ -100,7 +100,7 @@ For more control, use the low-level functions directly:
|
|
|
100
100
|
### Key Derivation
|
|
101
101
|
|
|
102
102
|
```typescript
|
|
103
|
-
import { generateSpendingKey, deriveKeys, initPoseidon } from '@hula/
|
|
103
|
+
import { generateSpendingKey, deriveKeys, initPoseidon } from '@hula-privacy/mixer';
|
|
104
104
|
|
|
105
105
|
await initPoseidon();
|
|
106
106
|
|
|
@@ -115,7 +115,7 @@ console.log('Encryption pubkey:', Buffer.from(keys.encryptionKeyPair.publicKey).
|
|
|
115
115
|
### UTXO Management
|
|
116
116
|
|
|
117
117
|
```typescript
|
|
118
|
-
import { createUTXO, computeCommitment, computeNullifier } from '@hula/
|
|
118
|
+
import { createUTXO, computeCommitment, computeNullifier } from '@hula-privacy/mixer';
|
|
119
119
|
|
|
120
120
|
// Create a UTXO
|
|
121
121
|
const utxo = createUTXO(
|
|
@@ -150,7 +150,7 @@ import {
|
|
|
150
150
|
fetchMerkleRoot,
|
|
151
151
|
computeMerklePathFromLeaves,
|
|
152
152
|
getCurrentTreeIndex
|
|
153
|
-
} from '@hula/
|
|
153
|
+
} from '@hula-privacy/mixer';
|
|
154
154
|
|
|
155
155
|
// Get current tree index
|
|
156
156
|
const treeIndex = await getCurrentTreeIndex('http://localhost:3001');
|
|
@@ -169,7 +169,7 @@ const localPath = computeMerklePathFromLeaves(leafIndex, leaves);
|
|
|
169
169
|
### Relayer API
|
|
170
170
|
|
|
171
171
|
```typescript
|
|
172
|
-
import { RelayerClient, getRelayerClient } from '@hula/
|
|
172
|
+
import { RelayerClient, getRelayerClient } from '@hula-privacy/mixer';
|
|
173
173
|
|
|
174
174
|
const client = getRelayerClient('http://localhost:3001');
|
|
175
175
|
|
|
@@ -191,7 +191,7 @@ const notes = await client.getAllNotes();
|
|
|
191
191
|
### Proof Generation
|
|
192
192
|
|
|
193
193
|
```typescript
|
|
194
|
-
import { generateProof, setCircuitPaths } from '@hula/
|
|
194
|
+
import { generateProof, setCircuitPaths } from '@hula-privacy/mixer';
|
|
195
195
|
|
|
196
196
|
// Set circuit paths (if not in default locations)
|
|
197
197
|
setCircuitPaths(
|
|
@@ -216,7 +216,7 @@ The SDK looks for circuit files in these locations:
|
|
|
216
216
|
You can also set custom paths:
|
|
217
217
|
|
|
218
218
|
```typescript
|
|
219
|
-
import { setCircuitPaths } from '@hula/
|
|
219
|
+
import { setCircuitPaths } from '@hula-privacy/mixer';
|
|
220
220
|
|
|
221
221
|
setCircuitPaths('/custom/path/transaction.wasm', '/custom/path/transaction.zkey');
|
|
222
222
|
```
|
|
@@ -224,7 +224,7 @@ setCircuitPaths('/custom/path/transaction.wasm', '/custom/path/transaction.zkey'
|
|
|
224
224
|
### Default Relayer URL
|
|
225
225
|
|
|
226
226
|
```typescript
|
|
227
|
-
import { setDefaultRelayerUrl } from '@hula/
|
|
227
|
+
import { setDefaultRelayerUrl } from '@hula-privacy/mixer';
|
|
228
228
|
|
|
229
229
|
setDefaultRelayerUrl('https://relayer.hulaprivacy.io');
|
|
230
230
|
```
|
|
@@ -244,7 +244,7 @@ import type {
|
|
|
244
244
|
TransactionRequest,
|
|
245
245
|
BuiltTransaction,
|
|
246
246
|
HulaSDKConfig,
|
|
247
|
-
} from '@hula/
|
|
247
|
+
} from '@hula-privacy/mixer';
|
|
248
248
|
```
|
|
249
249
|
|
|
250
250
|
## Building
|