@nockbox/iris-wasm 0.2.0-alpha.0 → 0.2.0-alpha.2

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/iris_wasm.d.ts CHANGED
@@ -1,47 +1,973 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
- /**
4
- * Hash a noun (jam as input)
5
- */
6
- export function hashNoun(noun: Uint8Array): string;
3
+ export function jam(noun: Noun): Uint8Array;
4
+ export function untas(noun: Noun): string;
5
+ export function tas_belts(s: string): Noun;
6
+ export function belts_to_atom(noun: Noun): Noun;
7
+ export function cue(jam: Uint8Array): Noun;
8
+ export function atom_to_belts(atom: Noun): Noun;
9
+ export function tas(s: string): Noun;
10
+ export function digest_to_hex(d: Digest): string;
11
+ export function note_from_protobuf(value: PbCom2Note): Note;
12
+ export function rawTxToNockchainTx(tx: RawTxV1): NockchainTx;
13
+ export function rawTxOutputs(tx: RawTx): Note[];
14
+ export function rawTxFromProtobuf(tx: PbCom2RawTransaction): RawTx;
15
+ export function note_to_protobuf(note: Note): PbCom2Note;
16
+ export function create_note_v1(version: Version, origin_page: number, name: Name, note_data: NoteData, assets: Nicks): Note;
17
+ export function note_hash(note: Note): Digest;
18
+ export function hex_to_digest(s: string): Digest;
19
+ export function create_note_v0(origin_page: number, sig_m: bigint, sig_pubkeys: Uint8Array[], source_hash: Digest, is_coinbase: boolean, timelock: Timelock | null | undefined, assets: Nicks): Note;
20
+ export function rawTxToProtobuf(tx: RawTxV1): PbCom2RawTransaction;
21
+ export function digest_from_protobuf(value: PbCom1Hash): Digest;
22
+ export function digest_to_protobuf(d: Digest): PbCom1Hash;
23
+ export function nockchainTxToRaw(tx: NockchainTx): RawTx;
7
24
  /**
8
25
  * Sign a message string with a private key
9
26
  */
10
27
  export function signMessage(private_key_bytes: Uint8Array, message: string): Signature;
11
28
  /**
12
- * Hash a u64 value
29
+ * Derive master key from BIP39 mnemonic phrase
13
30
  */
14
- export function hashU64(value: bigint): string;
31
+ export function deriveMasterKeyFromMnemonic(mnemonic: string, passphrase?: string | null): ExtendedKey;
15
32
  /**
16
- * Derive master key from seed bytes
33
+ * Hash a public key to get its digest (for use in PKH)
17
34
  */
18
- export function deriveMasterKey(seed: Uint8Array): ExtendedKey;
35
+ export function hashPublicKey(public_key_bytes: Uint8Array): string;
19
36
  /**
20
37
  * Verify a signature with a public key
21
38
  */
22
39
  export function verifySignature(public_key_bytes: Uint8Array, signature: Signature, message: string): boolean;
23
40
  /**
24
- * Derive master key from BIP39 mnemonic phrase
41
+ * Hash a u64 value
25
42
  */
26
- export function deriveMasterKeyFromMnemonic(mnemonic: string, passphrase?: string | null): ExtendedKey;
43
+ export function hashU64(value: bigint): string;
27
44
  /**
28
- * Hash a public key to get its digest (for use in PKH)
45
+ * Derive master key from seed bytes
29
46
  */
30
- export function hashPublicKey(public_key_bytes: Uint8Array): string;
47
+ export function deriveMasterKey(seed: Uint8Array): ExtendedKey;
48
+ /**
49
+ * Hash a noun (jam as input)
50
+ */
51
+ export function hashNoun(noun: Uint8Array): string;
52
+ export function inputHash(v: Input): Digest;
53
+ export function inputFromNoun(noun: Noun): Input;
54
+ export function inputToNoun(v: Input): Noun;
55
+ export function inputsToNoun(v: Inputs): Noun;
56
+ export function inputsHash(v: Inputs): Digest;
57
+ export function inputsFromNoun(noun: Noun): Inputs;
58
+ export function seedsV0ToNoun(v: SeedsV0): Noun;
59
+ export function seedsV0FromNoun(noun: Noun): SeedsV0;
60
+ export function seedsV0Hash(v: SeedsV0): Digest;
61
+ export function spendV0FromNoun(noun: Noun): SpendV0;
62
+ export function spendV0ToNoun(v: SpendV0): Noun;
63
+ export function spendV0Hash(v: SpendV0): Digest;
64
+ export function noteInnerHash(v: NoteInner): Digest;
65
+ export function noteInnerFromNoun(noun: Noun): NoteInner;
66
+ export function noteInnerToNoun(v: NoteInner): Noun;
67
+ export function haxFromNoun(noun: Noun): Hax;
68
+ export function haxHash(v: Hax): Digest;
69
+ export function haxToNoun(v: Hax): Noun;
70
+ export function noteV1Hash(v: NoteV1): Digest;
71
+ export function noteV1ToNoun(v: NoteV1): Noun;
72
+ export function noteV1FromNoun(noun: Noun): NoteV1;
73
+ export function seedV1Hash(v: SeedV1): Digest;
74
+ export function seedV1FromNoun(noun: Noun): SeedV1;
75
+ export function seedV1ToNoun(v: SeedV1): Noun;
76
+ export function witnessHash(v: Witness): Digest;
77
+ export function witnessToNoun(v: Witness): Noun;
78
+ export function witnessFromNoun(noun: Noun): Witness;
79
+ export function seedsV1Hash(v: SeedsV1): Digest;
80
+ export function seedsV1ToNoun(v: SeedsV1): Noun;
81
+ export function seedsV1FromNoun(noun: Noun): SeedsV1;
82
+ export function spendV1Hash(v: SpendV1): Digest;
83
+ export function spendV1FromNoun(noun: Noun): SpendV1;
84
+ export function spendV1ToNoun(v: SpendV1): Noun;
85
+ export function lockRootToNoun(v: LockRoot): Noun;
86
+ export function lockRootHash(v: LockRoot): Digest;
87
+ export function lockRootFromNoun(noun: Noun): LockRoot;
88
+ export function noteDataHash(v: NoteData): Digest;
89
+ export function noteDataToNoun(v: NoteData): Noun;
90
+ export function noteDataFromNoun(noun: Noun): NoteData;
91
+ export function rawTxV1ToNoun(v: RawTxV1): Noun;
92
+ export function rawTxV1FromNoun(noun: Noun): RawTxV1;
93
+ export function spendsV1FromNoun(noun: Noun): SpendsV1;
94
+ export function spendsV1ToNoun(v: SpendsV1): Noun;
95
+ export function spendsV1Hash(v: SpendsV1): Digest;
96
+ export function nockchainTxToNoun(v: NockchainTx): Noun;
97
+ export function nockchainTxFromNoun(noun: Noun): NockchainTx;
98
+ export function pkhSignatureFromNoun(noun: Noun): PkhSignature;
99
+ export function pkhSignatureHash(v: PkhSignature): Digest;
100
+ export function pkhSignatureToNoun(v: PkhSignature): Noun;
101
+ export function noteToNoun(v: Note): Noun;
102
+ export function noteHash(v: Note): Digest;
103
+ export function noteFromNoun(noun: Noun): Note;
104
+ export function merkleProofHash(v: MerkleProof): Digest;
105
+ export function merkleProofFromNoun(noun: Noun): MerkleProof;
106
+ export function merkleProofToNoun(v: MerkleProof): Noun;
107
+ export function lockPrimitiveToNoun(v: LockPrimitive): Noun;
108
+ export function lockPrimitiveHash(v: LockPrimitive): Digest;
109
+ export function lockPrimitiveFromNoun(noun: Noun): LockPrimitive;
110
+ export function versionHash(v: Version): Digest;
111
+ export function versionToNoun(v: Version): Noun;
112
+ export function versionFromNoun(noun: Noun): Version;
113
+ export function sigFromNoun(noun: Noun): Sig;
114
+ export function sigToNoun(v: Sig): Noun;
115
+ export function sigHash(v: Sig): Digest;
116
+ export function timelockIntentHash(v: TimelockIntent): Digest;
117
+ export function timelockIntentFromNoun(noun: Noun): TimelockIntent;
118
+ export function timelockIntentToNoun(v: TimelockIntent): Noun;
119
+ export function legacySignatureFromNoun(noun: Noun): LegacySignature;
120
+ export function legacySignatureToNoun(v: LegacySignature): Noun;
121
+ export function legacySignatureHash(v: LegacySignature): Digest;
122
+ export function nameToNoun(v: Name): Noun;
123
+ export function nameHash(v: Name): Digest;
124
+ export function nameFromNoun(noun: Noun): Name;
125
+ export function sourceToNoun(v: Source): Noun;
126
+ export function sourceHash(v: Source): Digest;
127
+ export function sourceFromNoun(noun: Noun): Source;
128
+ export function noteV0Hash(v: NoteV0): Digest;
129
+ export function noteV0ToNoun(v: NoteV0): Noun;
130
+ export function noteV0FromNoun(noun: Noun): NoteV0;
131
+ export function pkhFromNoun(noun: Noun): Pkh;
132
+ export function pkhHash(v: Pkh): Digest;
133
+ export function pkhToNoun(v: Pkh): Noun;
134
+ export function witnessDataFromNoun(noun: Noun): WitnessData;
135
+ export function witnessDataToNoun(v: WitnessData): Noun;
136
+ export function lockMetadataToNoun(v: LockMetadata): Noun;
137
+ export function lockMetadataHash(v: LockMetadata): Digest;
138
+ export function lockMetadataFromNoun(noun: Noun): LockMetadata;
139
+ export function timelockRangeHash(v: TimelockRange): Digest;
140
+ export function timelockRangeToNoun(v: TimelockRange): Noun;
141
+ export function timelockRangeFromNoun(noun: Noun): TimelockRange;
142
+ export function seedV0Hash(v: SeedV0): Digest;
143
+ export function seedV0ToNoun(v: SeedV0): Noun;
144
+ export function seedV0FromNoun(noun: Noun): SeedV0;
145
+ export function timelockToNoun(v: Timelock): Noun;
146
+ export function timelockHash(v: Timelock): Digest;
147
+ export function timelockFromNoun(noun: Noun): Timelock;
148
+ export function rawTxV0FromNoun(noun: Noun): RawTxV0;
149
+ export function rawTxV0ToNoun(v: RawTxV0): Noun;
150
+ export function inputDisplayToNoun(v: InputDisplay): Noun;
151
+ export function inputDisplayFromNoun(noun: Noun): InputDisplay;
152
+ export function spendConditionFromNoun(noun: Noun): SpendCondition;
153
+ export function spendConditionHash(v: SpendCondition): Digest;
154
+ export function spendConditionToNoun(v: SpendCondition): Noun;
155
+ export function lockMerkleProofToNoun(v: LockMerkleProof): Noun;
156
+ export function lockMerkleProofHash(v: LockMerkleProof): Digest;
157
+ export function lockMerkleProofFromNoun(noun: Noun): LockMerkleProof;
158
+ export function transactionDisplayToNoun(v: TransactionDisplay): Noun;
159
+ export function transactionDisplayFromNoun(noun: Noun): TransactionDisplay;
160
+ export function balanceToNoun(v: Balance): Noun;
161
+ export function balanceFromNoun(noun: Noun): Balance;
162
+ export function balanceUpdateToNoun(v: BalanceUpdate): Noun;
163
+ export function balanceUpdateFromNoun(noun: Noun): BalanceUpdate;
164
+ export function digestToNoun(v: Digest): Noun;
165
+ export function digestHash(v: Digest): Digest;
166
+ export function digestFromNoun(noun: Noun): Digest;
31
167
  /**
32
168
  * The `ReadableStreamType` enum.
33
169
  *
34
170
  * *This API requires the following crate features to be activated: `ReadableStreamType`*
35
171
  */
36
172
  type ReadableStreamType = "bytes";
37
- export class Digest {
38
- free(): void;
39
- [Symbol.dispose](): void;
40
- toProtobuf(): any;
41
- static fromProtobuf(value: any): Digest;
42
- constructor(value: string);
43
- readonly value: string;
173
+ export interface TxNotes {
174
+ notes: Note[];
175
+ spend_conditions: SpendCondition[];
176
+ }
177
+
178
+ export interface PbCom1BalanceEntry {
179
+ name: PbCom1Name | undefined;
180
+ note: PbCom1Note | undefined;
181
+ }
182
+
183
+ /**
184
+ * min and max are absolute origin page numbers
185
+ */
186
+ export interface PbCom1TimeLockRangeAbsolute {
187
+ min: PbCom1BlockHeight | undefined;
188
+ max: PbCom1BlockHeight | undefined;
189
+ }
190
+
191
+ export interface PbCom1Input {
192
+ note: PbCom1Note | undefined;
193
+ spend: PbCom1Spend | undefined;
194
+ }
195
+
196
+ export interface PbCom1Wire {
197
+ /**
198
+ * e.g., \"http\", \"file\", \"wallet\", \"grpc\
199
+ */
200
+ source: string;
201
+ /**
202
+ * wire format version
203
+ */
204
+ version: number;
205
+ /**
206
+ * operation-specific tags
207
+ */
208
+ tags: PbCom1WireTag[];
209
+ }
210
+
211
+ export interface PbCom1Signature {
212
+ entries: PbCom1SignatureEntry[];
213
+ }
214
+
215
+ export interface PbCom1TimeLockRangeAbsoluteAndRelative {
216
+ absolute: PbCom1TimeLockRangeAbsolute | undefined;
217
+ relative: PbCom1TimeLockRangeRelative | undefined;
218
+ }
219
+
220
+ export interface PbCom1Acknowledged {}
221
+
222
+ export interface PbCom1WireTag {
223
+ value: PbCom1WireTagValue | undefined;
224
+ }
225
+
226
+ export interface PbCom1BlockHeightDelta {
227
+ value: string;
228
+ }
229
+
230
+ export interface PbCom1NamedInput {
231
+ name: PbCom1Name | undefined;
232
+ input: PbCom1Input | undefined;
233
+ }
234
+
235
+ /**
236
+ * pub struct Hash(pub \\[Belt; 5\\]);
237
+ * Use fixed fields to avoid variable-length vectors.
238
+ */
239
+ export interface PbCom1Hash {
240
+ belt_1: PbCom1Belt | undefined;
241
+ belt_2: PbCom1Belt | undefined;
242
+ belt_3: PbCom1Belt | undefined;
243
+ belt_4: PbCom1Belt | undefined;
244
+ belt_5: PbCom1Belt | undefined;
245
+ }
246
+
247
+ export interface PbCom1TimeLockIntent {
248
+ value: PbCom1TimeLockIntentValue | undefined;
249
+ }
250
+
251
+ export interface PbCom1Spend {
252
+ signature: PbCom1Signature | undefined;
253
+ seeds: PbCom1Seed[];
254
+ miner_fee_nicks: PbCom1Nicks | undefined;
255
+ }
256
+
257
+ export interface PbCom1WalletBalanceData {
258
+ /**
259
+ * Page of full UTXO entries for the requested wallet. Entries are ordered
260
+ * by (Name.first, Name.last) to support consistent pagination.
261
+ *
262
+ * note name -> amount
263
+ */
264
+ notes: PbCom1BalanceEntry[];
265
+ /**
266
+ * Snapshot metadata where this page was computed. Clients should include
267
+ * the returned page token to continue paging against the same snapshot.
268
+ *
269
+ * block height where balance was computed
270
+ */
271
+ height: PbCom1BlockHeight | undefined;
272
+ /**
273
+ * block where balance was computed
274
+ */
275
+ block_id: PbCom1Hash | undefined;
276
+ /**
277
+ * Pagination cursor for fetching the next page in a paginated view.
278
+ * When empty, there are no further results for this snapshot.
279
+ */
280
+ page: PbCom1PageResponse | undefined;
281
+ }
282
+
283
+ export interface PbCom1Seed {
284
+ output_source: PbCom1OutputSource | undefined;
285
+ recipient: PbCom1Lock | undefined;
286
+ timelock_intent: PbCom1TimeLockIntent | undefined;
287
+ gift: PbCom1Nicks | undefined;
288
+ parent_hash: string;
289
+ }
290
+
291
+ export interface PbCom1Name {
292
+ /**
293
+ * First is the hash of whether the note has a timelock and the lock
294
+ */
295
+ first: string;
296
+ /**
297
+ * Last is the hash of the actual timelock and the source
298
+ */
299
+ last: string;
300
+ }
301
+
302
+ export interface PbCom1BlockHeight {
303
+ value: string;
304
+ }
305
+
306
+ /**
307
+ * pub struct SchnorrPubkey(pub CheetahPoint);
308
+ */
309
+ export interface PbCom1SchnorrPubkey {
310
+ value: PbCom1CheetahPoint | undefined;
311
+ }
312
+
313
+ /**
314
+ * Generic pagination parameters for list-style RPCs.
315
+ * These types are intended to be reused across public APIs.
316
+ *
317
+ * Contract:
318
+ * - The server may return fewer items than requested (client_page_items_limit is a hint).
319
+ * - page_token is an opaque cursor produced by the server; clients must treat
320
+ * it as a black box. Servers may encode snapshot identity and last-key.
321
+ * - For consistent pagination, clients should include the returned page_token
322
+ * in the next request without modification.
323
+ * - Servers may enforce a maximum client_page_items_limit and/or byte budget regardless of
324
+ * client hints.
325
+ */
326
+ export interface PbCom1PageRequest {
327
+ /**
328
+ * Maximum number of items to return. The server may return fewer items
329
+ * than requested. Clients should not rely on receiving exactly this count.
330
+ */
331
+ client_page_items_limit: number;
332
+ /**
333
+ * Opaque cursor returned by a previous call. When set, the server resumes
334
+ * the listing from the position described by the token.
335
+ * An empty token indicates the first page.
336
+ */
337
+ page_token: string;
338
+ /**
339
+ * Optional soft limit on the uncompressed bytes to return in a single page.
340
+ * The server may ignore or cap this value according to policy. This refers
341
+ * to the gRPC payload size after protobuf encoding and decompression.
342
+ */
343
+ max_bytes: number;
344
+ }
345
+
346
+ export interface PbCom1Base58Pubkey {
347
+ key: string;
348
+ }
349
+
350
+ export type PbCom1ErrorCode = "Unspecified" | "InvalidRequest" | "PeekFailed" | "PeekReturnedNoData" | "PokeFailed" | "NackappError" | "Timeout" | "InternalError" | "NotFound" | "PermissionDenied" | "InvalidWire" | "KernelError";
351
+
352
+ /**
353
+ * pub struct F6lt(pub \\[Belt; 6\\]);
354
+ */
355
+ export interface PbCom1SixBelt {
356
+ belt_1: PbCom1Belt | undefined;
357
+ belt_2: PbCom1Belt | undefined;
358
+ belt_3: PbCom1Belt | undefined;
359
+ belt_4: PbCom1Belt | undefined;
360
+ belt_5: PbCom1Belt | undefined;
361
+ belt_6: PbCom1Belt | undefined;
362
+ }
363
+
364
+ export interface PbCom1SchnorrSignature {
365
+ chal: PbCom1EightBelt | undefined;
366
+ sig: PbCom1EightBelt | undefined;
367
+ }
368
+
369
+ export interface PbCom1Lock {
370
+ /**
371
+ * threshold of keys required to spend the note
372
+ */
373
+ keys_required: number;
374
+ /**
375
+ * DEPRECATED: repeated string schnorr_pubkeys_b58 = 2;
376
+ *
377
+ * schnorr pubkeys (curve: cheetah)
378
+ */
379
+ schnorr_pubkeys: PbCom1SchnorrPubkey[];
380
+ }
381
+
382
+ export interface PbCom1Source {
383
+ hash: string;
384
+ coinbase: boolean;
385
+ }
386
+
387
+ /**
388
+ * Use this when you want to force the output to not have a timelock
389
+ */
390
+ export interface PbCom1TimeLockRangeNeither {}
391
+
392
+ /**
393
+ * pub chal: \\[Belt; 8\\],
394
+ * pub sig: \\[Belt; 8\\],
395
+ */
396
+ export interface PbCom1EightBelt {
397
+ belt_1: PbCom1Belt | undefined;
398
+ belt_2: PbCom1Belt | undefined;
399
+ belt_3: PbCom1Belt | undefined;
400
+ belt_4: PbCom1Belt | undefined;
401
+ belt_5: PbCom1Belt | undefined;
402
+ belt_6: PbCom1Belt | undefined;
403
+ belt_7: PbCom1Belt | undefined;
404
+ belt_8: PbCom1Belt | undefined;
405
+ }
406
+
407
+ export interface PbCom1PageResponse {
408
+ /**
409
+ * Opaque cursor for fetching the next page. Empty when there are no more
410
+ * results.
411
+ */
412
+ next_page_token: string;
413
+ }
414
+
415
+ export interface PbCom1OutputSource {
416
+ source: PbCom1Source | undefined;
417
+ }
418
+
419
+ export interface PbCom1ErrorStatus {
420
+ code: number;
421
+ message: string;
422
+ /**
423
+ * additional error context
424
+ */
425
+ details: string | undefined;
426
+ }
427
+
428
+ /**
429
+ * pub struct Belt(pub u64);
430
+ */
431
+ export interface PbCom1Belt {
432
+ value: string;
433
+ }
434
+
435
+ export interface PbCom1Note {
436
+ /**
437
+ * page-number when added to balance
438
+ */
439
+ origin_page: PbCom1BlockHeight | undefined;
440
+ /**
441
+ * enforced timelock
442
+ */
443
+ timelock: PbCom1TimeLockIntent | undefined;
444
+ /**
445
+ * nname (human/name label)
446
+ */
447
+ name: PbCom1Name | undefined;
448
+ /**
449
+ * spending condition
450
+ */
451
+ lock: PbCom1Lock | undefined;
452
+ /**
453
+ * provenance commitment
454
+ */
455
+ source: PbCom1Source | undefined;
456
+ /**
457
+ * coin amount (nicks)
458
+ */
459
+ assets: PbCom1Nicks | undefined;
460
+ /**
461
+ * note version (currently 0)
462
+ */
463
+ version: PbCom1NoteVersion | undefined;
464
+ }
465
+
466
+ /**
467
+ * the string key is the name of the input
468
+ * message RawTransaction { map<Name, Input> inputs = 1; }
469
+ */
470
+ export interface PbCom1RawTransaction {
471
+ named_inputs: PbCom1NamedInput[];
472
+ timelock_range: PbCom1TimeLockRangeAbsolute | undefined;
473
+ total_fees: PbCom1Nicks | undefined;
474
+ id: string;
44
475
  }
476
+
477
+ /**
478
+ * min and max are relative to the note\'s creation page
479
+ */
480
+ export interface PbCom1TimeLockRangeRelative {
481
+ min: PbCom1BlockHeightDelta | undefined;
482
+ max: PbCom1BlockHeightDelta | undefined;
483
+ }
484
+
485
+ export interface PbCom1Nicks {
486
+ value: string;
487
+ }
488
+
489
+ export interface PbCom1SignatureEntry {
490
+ /**
491
+ * serialized pubkey corresponding to the signer
492
+ */
493
+ schnorr_pubkey: PbCom1SchnorrPubkey | undefined;
494
+ signature: PbCom1SchnorrSignature | undefined;
495
+ }
496
+
497
+ /**
498
+ * Note: prefer using raw numeric fields in messages
499
+ * instead of these wrappers to simplify conversions.
500
+ * These remain defined for potential future use.
501
+ */
502
+ export interface PbCom1NoteVersion {
503
+ value: string;
504
+ }
505
+
506
+ export interface PbCom1Base58Hash {
507
+ hash: string;
508
+ }
509
+
510
+ /**
511
+ * pub struct CheetahPoint {
512
+ * pub x: F6lt,
513
+ * pub y: F6lt,
514
+ * pub inf: bool,
515
+ * }
516
+ */
517
+ export interface PbCom1CheetahPoint {
518
+ x: PbCom1SixBelt | undefined;
519
+ y: PbCom1SixBelt | undefined;
520
+ inf: boolean;
521
+ }
522
+
523
+ export interface PbCom2NoteV1 {
524
+ version: PbCom1NoteVersion | undefined;
525
+ origin_page: PbCom1BlockHeight | undefined;
526
+ name: PbCom1Name | undefined;
527
+ note_data: PbCom2NoteData | undefined;
528
+ assets: PbCom1Nicks | undefined;
529
+ }
530
+
531
+ export interface PbCom2LockMerkleProof {
532
+ spend_condition: PbCom2SpendCondition | undefined;
533
+ axis: number;
534
+ proof: PbCom2MerkleProof | undefined;
535
+ }
536
+
537
+ export interface PbCom2Note {
538
+ note_version: PbCom2NoteNoteVersion | undefined;
539
+ }
540
+
541
+ export interface PbCom2Spend {
542
+ spend_kind: PbCom2SpendSpendKind | undefined;
543
+ }
544
+
545
+ export interface PbCom2RawTransaction {
546
+ version: PbCom1NoteVersion | undefined;
547
+ id: string;
548
+ spends: PbCom2SpendEntry[];
549
+ }
550
+
551
+ export interface PbCom2LockTim {
552
+ rel: PbCom1TimeLockRangeRelative | undefined;
553
+ abs: PbCom1TimeLockRangeAbsolute | undefined;
554
+ }
555
+
556
+ export interface PbCom2WitnessSpend {
557
+ witness: PbCom2Witness | undefined;
558
+ seeds: PbCom2Seed[];
559
+ fee: PbCom1Nicks | undefined;
560
+ }
561
+
562
+ export interface PbCom2NoteData {
563
+ entries: PbCom2NoteDataEntry[];
564
+ }
565
+
566
+ export interface PbCom2LegacySpend {
567
+ signature: PbCom1Signature | undefined;
568
+ seeds: PbCom2Seed[];
569
+ fee: PbCom1Nicks | undefined;
570
+ }
571
+
572
+ export interface PbCom2PkhLock {
573
+ m: number;
574
+ hashes: string[];
575
+ }
576
+
577
+ export interface PbCom2Seed {
578
+ /**
579
+ * Absent when the seed originates from a coinbase output.
580
+ */
581
+ output_source: PbCom1Source | undefined;
582
+ lock_root: string;
583
+ note_data: PbCom2NoteData | undefined;
584
+ gift: PbCom1Nicks | undefined;
585
+ parent_hash: string;
586
+ }
587
+
588
+ export interface PbCom2BurnLock {}
589
+
590
+ export interface PbCom2MerkleProof {
591
+ root: string;
592
+ path: string[];
593
+ }
594
+
595
+ export interface PbCom2HaxPreimage {
596
+ hash: PbCom1Hash | undefined;
597
+ /**
598
+ * jammed noun bytes
599
+ */
600
+ value: number[];
601
+ }
602
+
603
+ export interface PbCom2Witness {
604
+ lock_merkle_proof: PbCom2LockMerkleProof | undefined;
605
+ pkh_signature: PbCom2PkhSignature | undefined;
606
+ /**
607
+ * uint64 tim = 4; // reserved field, currently 0
608
+ */
609
+ hax: PbCom2HaxPreimage[];
610
+ }
611
+
612
+ export interface PbCom2SpendCondition {
613
+ primitives: PbCom2LockPrimitive[];
614
+ }
615
+
616
+ export interface PbCom2PkhSignatureEntry {
617
+ hash: string;
618
+ pubkey: PbCom1SchnorrPubkey | undefined;
619
+ signature: PbCom1SchnorrSignature | undefined;
620
+ }
621
+
622
+ export interface PbCom2BalanceEntry {
623
+ name: PbCom1Name | undefined;
624
+ note: PbCom2Note | undefined;
625
+ }
626
+
627
+ export interface PbCom2SpendEntry {
628
+ name: PbCom1Name | undefined;
629
+ spend: PbCom2Spend | undefined;
630
+ }
631
+
632
+ export interface PbCom2HaxLock {
633
+ hashes: PbCom1Hash[];
634
+ }
635
+
636
+ export interface PbCom2NoteDataEntry {
637
+ key: string;
638
+ /**
639
+ * jammed noun bytes
640
+ */
641
+ blob: number[];
642
+ }
643
+
644
+ export interface PbCom2LockPrimitive {
645
+ primitive: PbCom2LockPrimitivePrimitive | undefined;
646
+ }
647
+
648
+ export interface PbCom2PkhSignature {
649
+ entries: PbCom2PkhSignatureEntry[];
650
+ }
651
+
652
+ export interface PbCom2Balance {
653
+ notes: PbCom2BalanceEntry[];
654
+ height: PbCom1BlockHeight | undefined;
655
+ block_id: string;
656
+ page: PbCom1PageResponse | undefined;
657
+ }
658
+
659
+ export type PbPub2WalletGetBalanceRequestSelector = { Address: PbCom1Base58Pubkey } | { FirstName: PbCom1Base58Hash };
660
+
661
+ export interface PbPub2WalletSendTransactionRequest {
662
+ tx_id: PbCom1Hash | undefined;
663
+ raw_tx: PbCom2RawTransaction | undefined;
664
+ }
665
+
666
+ export interface PbPub2WalletGetBalanceResponse {
667
+ result: PbPub2WalletGetBalanceResponseResult | undefined;
668
+ }
669
+
670
+ export interface PbPub2WalletSendTransactionResponse {
671
+ result: PbPub2WalletSendTransactionResponseResult | undefined;
672
+ }
673
+
674
+ export interface PbPub2WalletGetBalanceRequest {
675
+ page: PbCom1PageRequest | undefined;
676
+ selector: PbPub2WalletGetBalanceRequestSelector | undefined;
677
+ }
678
+
679
+ export interface PbPub2TransactionAcceptedResponse {
680
+ result: PbPub2TransactionAcceptedResponseResult | undefined;
681
+ }
682
+
683
+ export interface PbPub2TransactionAcceptedRequest {
684
+ tx_id: PbCom1Base58Hash | undefined;
685
+ }
686
+
687
+ export type PbPub2TransactionAcceptedResponseResult = { Accepted: boolean } | { Error: PbCom1ErrorStatus };
688
+
689
+ export type PbPri1PokeResponseResult = { Acknowledged: boolean } | { Error: PbCom1ErrorStatus };
690
+
691
+ export type PbPri1PeekResponseResult = { Data: number[] } | { Error: PbCom1ErrorStatus };
692
+
693
+ export interface PbPri1PeekResponse {
694
+ result: PbPri1PeekResponseResult | undefined;
695
+ }
696
+
697
+ export interface PbPri1PokeRequest {
698
+ /**
699
+ * process ID for tracking
700
+ */
701
+ pid: number;
702
+ /**
703
+ * wire routing information
704
+ */
705
+ wire: PbCom1Wire | undefined;
706
+ /**
707
+ * JAM-encoded nock data
708
+ */
709
+ payload: number[];
710
+ }
711
+
712
+ export interface PbPri1PokeResponse {
713
+ result: PbPri1PokeResponseResult | undefined;
714
+ }
715
+
716
+ export interface PbPri1PeekRequest {
717
+ /**
718
+ * process ID for tracking
719
+ */
720
+ pid: number;
721
+ /**
722
+ * JAM-encoded nock peek path
723
+ */
724
+ path: number[];
725
+ }
726
+
727
+ export type PbCom2NoteNoteVersion = { Legacy: PbCom1Note } | { V1: PbCom2NoteV1 };
728
+
729
+ export type PbCom1TimeLockIntentValue = { Absolute: PbCom1TimeLockRangeAbsolute } | { Relative: PbCom1TimeLockRangeRelative } | { AbsoluteAndRelative: PbCom1TimeLockRangeAbsoluteAndRelative } | { Neither: PbCom1TimeLockRangeNeither };
730
+
731
+ export type PbCom1WireTagValue = { Text: string } | { Number: number };
732
+
733
+ export type PbCom2LockPrimitivePrimitive = { Pkh: PbCom2PkhLock } | { Tim: PbCom2LockTim } | { Hax: PbCom2HaxLock } | { Burn: PbCom2BurnLock };
734
+
735
+ export type PbPub2WalletGetBalanceResponseResult = { Balance: PbCom2Balance } | { Error: PbCom1ErrorStatus };
736
+
737
+ export type PbCom2SpendSpendKind = { Legacy: PbCom2LegacySpend } | { Witness: PbCom2WitnessSpend };
738
+
739
+ export type PbPub2WalletSendTransactionResponseResult = { Ack: PbCom1Acknowledged } | { Error: PbCom1ErrorStatus };
740
+
741
+ export type LockPrimitive = { Pkh: Pkh } | { Tim: LockTim } | { Hax: Hax } | "Brn";
742
+
743
+ export interface Witness {
744
+ lock_merkle_proof: LockMerkleProof;
745
+ pkh_signature: PkhSignature;
746
+ hax_map: ZMap<Digest, Noun>;
747
+ tim: undefined;
748
+ }
749
+
750
+ export interface SeedV1 {
751
+ output_source: Source | undefined;
752
+ lock_root: LockRoot;
753
+ note_data: NoteData;
754
+ gift: Nicks;
755
+ parent_hash: Digest;
756
+ }
757
+
758
+ export interface NoteV1 {
759
+ version: Version;
760
+ origin_page: BlockHeight;
761
+ name: Name;
762
+ note_data: NoteData;
763
+ assets: Nicks;
764
+ }
765
+
766
+ export interface Spend0V1 {
767
+ signature: LegacySignature;
768
+ seeds: SeedsV1;
769
+ fee: Nicks;
770
+ }
771
+
772
+ export type NoteData = ZMap<string, Noun>;
773
+
774
+ export type LockRoot = { Hash: Digest } | { Lock: SpendCondition };
775
+
776
+ export interface LockMerkleProof {
777
+ spend_condition: SpendCondition;
778
+ axis: number;
779
+ proof: MerkleProof;
780
+ }
781
+
782
+ export interface Pkh {
783
+ m: number;
784
+ hashes: ZSet<Digest>;
785
+ }
786
+
787
+ export type SpendCondition = LockPrimitive[];
788
+
789
+ export interface NockchainTx {
790
+ version: Version;
791
+ id: TxId;
792
+ spends: SpendsV1;
793
+ display: TransactionDisplay;
794
+ witness_data: WitnessData;
795
+ }
796
+
797
+ export interface Spend1V1 {
798
+ witness: Witness;
799
+ seeds: SeedsV1;
800
+ fee: Nicks;
801
+ }
802
+
803
+ export interface RawTxV1 {
804
+ version: 1;
805
+ id: TxId;
806
+ spends: SpendsV1;
807
+ }
808
+
809
+ export type InputDisplay = { version: 0; p: ZMap<Name, Sig> } | { version: 1; p: ZMap<Name, SpendCondition> };
810
+
811
+ export type SeedsV1 = ZSet<SeedV1>;
812
+
813
+ export interface LockMetadata {
814
+ lock: SpendCondition;
815
+ include_data: boolean;
816
+ }
817
+
818
+ export type SpendV1 = { version: 0; spend: Spend0V1 } | { version: 1; spend: Spend1V1 };
819
+
820
+ export interface WitnessData {
821
+ data: ZMap<Name, Witness>;
822
+ }
823
+
824
+ export type SpendsV1 = ZMap<Name, SpendV1>;
825
+
826
+ export type PkhSignature = ZMap<Digest, [PublicKey, Signature]>;
827
+
828
+ export interface TransactionDisplay {
829
+ inputs: InputDisplay;
830
+ outputs: ZMap<Digest, LockMetadata>;
831
+ }
832
+
833
+ export type Hax = ZSet<Digest>;
834
+
835
+ export interface MerkleProof {
836
+ root: Digest;
837
+ path: Digest[];
838
+ }
839
+
840
+ export interface TxEngineSettings {
841
+ tx_engine_version: Version;
842
+ tx_engine_patch: number;
843
+ min_fee: Nicks;
844
+ cost_per_word: Nicks;
845
+ witness_word_div: number;
846
+ }
847
+
848
+ export type RawTx = RawTxV0 | RawTxV1;
849
+
850
+ export interface NoteV0 {
851
+ inner: NoteInner;
852
+ name: Name;
853
+ sig: Sig;
854
+ source: Source;
855
+ assets: Nicks;
856
+ }
857
+
858
+ export interface Input {
859
+ note: NoteV0;
860
+ spend: SpendV0;
861
+ }
862
+
863
+ export interface RawTxV0 {
864
+ id: TxId;
865
+ inputs: Inputs;
866
+ timelock_range: TimelockRange;
867
+ total_fees: Nicks;
868
+ }
869
+
870
+ export interface SeedV0 {
871
+ output_source: Source | undefined;
872
+ recipient: Sig;
873
+ timelock_intent: TimelockIntent;
874
+ gift: Nicks;
875
+ parent_hash: Digest;
876
+ }
877
+
878
+ export type LegacySignature = ZMap<PublicKey, Signature>;
879
+
880
+ export interface NoteInner {
881
+ version: Version;
882
+ origin_page: BlockHeight;
883
+ timelock: TimelockIntent;
884
+ }
885
+
886
+ export interface Timelock {
887
+ rel: TimelockRange;
888
+ abs: TimelockRange;
889
+ }
890
+
891
+ export interface TimelockIntent {
892
+ tim: Timelock | undefined;
893
+ }
894
+
895
+ export interface SpendV0 {
896
+ signature: LegacySignature | undefined;
897
+ seeds: SeedsV0;
898
+ fee: Nicks;
899
+ }
900
+
901
+ export interface Sig {
902
+ m: number;
903
+ pubkeys: ZSet<PublicKey>;
904
+ }
905
+
906
+ export type SeedsV0 = ZSet<SeedV0>;
907
+
908
+ export type Inputs = ZMap<Name, Input>;
909
+
910
+ /**
911
+ * 64-bit unsigned integer representing the number of assets.
912
+ */
913
+ export type Nicks = string;
914
+
915
+ export interface Name {
916
+ first: Digest;
917
+ last: Digest;
918
+ _sig: number;
919
+ }
920
+
921
+ export type Version = 0 | 1 | 2;
922
+
923
+ export interface BalanceUpdate {
924
+ height: BlockHeight;
925
+ block_id: Digest;
926
+ notes: Balance;
927
+ }
928
+
929
+ /**
930
+ * Timelock range (for both absolute and relative constraints)
931
+ */
932
+ export interface TimelockRange {
933
+ min: BlockHeight | undefined;
934
+ max: BlockHeight | undefined;
935
+ }
936
+
937
+ export type Note = NoteV0 | NoteV1;
938
+
939
+ export type Balance = ZMap<Name, Note>;
940
+
941
+ export interface Source {
942
+ hash: Digest;
943
+ is_coinbase: boolean;
944
+ }
945
+
946
+ export type MissingUnlocks = { Pkh: { num_sigs: number; sig_of: Digest[] } } | { Hax: { preimages_for: Digest[] } } | "Brn" | { Sig: { num_sigs: number; sig_of: PublicKey[] } };
947
+
948
+ export interface Signature {
949
+ c: Uint8Array;
950
+ s: Uint8Array;
951
+ }
952
+
953
+ export type PublicKey = CheetahPoint;
954
+
955
+ export type Noun = string | [Noun];
956
+
957
+ export type CheetahPoint = string;
958
+
959
+ export type Digest = string;
960
+
961
+ export type ZMap<K, V> = ZBase<ZMapEntry<K, V>>;
962
+
963
+ export type ZMapEntry<K, V> = [K, V];
964
+
965
+ export type ZBase<E> = E[];
966
+
967
+ export type ZSet<T> = ZBase<ZSetEntry<T>>;
968
+
969
+ export type ZSetEntry<T> = T;
970
+
45
971
  export class ExtendedKey {
46
972
  private constructor();
47
973
  free(): void;
@@ -60,7 +986,7 @@ export class GrpcClient {
60
986
  /**
61
987
  * Send a transaction
62
988
  */
63
- sendTransaction(raw_tx: any): Promise<any>;
989
+ sendTransaction(raw_tx: PbCom2RawTransaction): Promise<string>;
64
990
  /**
65
991
  * Check if a transaction was accepted
66
992
  */
@@ -68,18 +994,20 @@ export class GrpcClient {
68
994
  /**
69
995
  * Get balance for a wallet address
70
996
  */
71
- getBalanceByAddress(address: string): Promise<any>;
997
+ getBalanceByAddress(address: string): Promise<PbCom2Balance>;
72
998
  /**
73
999
  * Get balance for a first name
74
1000
  */
75
- getBalanceByFirstName(first_name: string): Promise<any>;
1001
+ getBalanceByFirstName(first_name: string): Promise<PbCom2Balance>;
76
1002
  constructor(endpoint: string);
77
- }
78
- export class Hax {
79
- free(): void;
80
- [Symbol.dispose](): void;
81
- constructor(digests: Digest[]);
82
- readonly digests: Digest[];
1003
+ /**
1004
+ * Peek a value from a Nock application
1005
+ */
1006
+ peek(pid: number, path: Noun): Promise<Noun>;
1007
+ /**
1008
+ * Poke a Nock application
1009
+ */
1010
+ poke(pid: number, wire: PbCom1Wire, payload: Noun): Promise<void>;
83
1011
  }
84
1012
  export class IntoUnderlyingByteSource {
85
1013
  private constructor();
@@ -106,585 +1034,122 @@ export class IntoUnderlyingSource {
106
1034
  pull(controller: ReadableStreamDefaultController): Promise<any>;
107
1035
  cancel(): void;
108
1036
  }
109
- export class LockPrimitive {
110
- private constructor();
111
- free(): void;
112
- [Symbol.dispose](): void;
113
- toProtobuf(): any;
114
- static fromProtobuf(value: any): LockPrimitive;
115
- static newBrn(): LockPrimitive;
116
- static newHax(hax: Hax): LockPrimitive;
117
- static newPkh(pkh: Pkh): LockPrimitive;
118
- static newTim(tim: LockTim): LockPrimitive;
119
- }
120
- export class LockRoot {
121
- private constructor();
122
- free(): void;
123
- [Symbol.dispose](): void;
124
- static fromSpendCondition(cond: SpendCondition): LockRoot;
125
- static fromHash(hash: Digest): LockRoot;
126
- readonly hash: Digest;
127
- readonly lock: SpendCondition | undefined;
128
- }
129
- export class LockTim {
130
- free(): void;
131
- [Symbol.dispose](): void;
132
- toProtobuf(): any;
133
- static fromProtobuf(value: any): LockTim;
134
- constructor(rel: TimelockRange, abs: TimelockRange);
135
- static coinbase(): LockTim;
136
- readonly abs: TimelockRange;
137
- readonly rel: TimelockRange;
138
- }
139
- export class Name {
140
- free(): void;
141
- [Symbol.dispose](): void;
142
- toProtobuf(): any;
143
- static fromProtobuf(value: any): Name;
144
- constructor(first: string, last: string);
145
- readonly last: string;
146
- readonly first: string;
147
- }
148
- export class NockchainTx {
149
- private constructor();
150
- free(): void;
151
- [Symbol.dispose](): void;
152
- /**
153
- * Convert to jammed transaction file for inspecting through CLI
154
- */
155
- toJam(): Uint8Array;
156
- outputs(): Note[];
157
- /**
158
- * Convert from CLI-compatible jammed transaction file
159
- */
160
- static fromJam(jam: Uint8Array): NockchainTx;
161
- toRawTx(): RawTx;
162
- readonly id: Digest;
163
- readonly name: string;
164
- readonly version: Version;
165
- }
166
- export class Note {
167
- free(): void;
168
- [Symbol.dispose](): void;
169
- toProtobuf(): any;
170
- /**
171
- * Create a WasmNote from a protobuf Note object (from get_balance response)
172
- * Expects response.notes[i].note (handles version internally)
173
- */
174
- static fromProtobuf(pb_note: any): Note;
175
- /**
176
- * Create a new V1 note (the default for new notes)
177
- */
178
- constructor(version: Version, origin_page: bigint, name: Name, note_data: NoteData, assets: bigint);
179
- hash(): Digest;
180
- /**
181
- * Create a new V0 (legacy) note
182
- *
183
- * V0 notes are legacy notes that use public keys directly instead of spend conditions.
184
- * - `origin_page`: Block height where the note originated
185
- * - `sig_m`: Number of required signatures (m-of-n)
186
- * - `sig_pubkeys`: Public keys as 97-byte arrays (big-endian format)
187
- * - `source_hash`: Hash of the source (seeds that created this note)
188
- * - `is_coinbase`: Whether this is a coinbase note
189
- * - `timelock`: Optional timelock constraints (must have at least one constraint if provided)
190
- * - `assets`: Amount of nicks in this note
191
- */
192
- static newV0(origin_page: bigint, sig_m: bigint, sig_pubkeys: Uint8Array[], source_hash: Digest, is_coinbase: boolean, timelock: Timelock | null | undefined, assets: bigint): Note;
193
- readonly originPage: bigint;
194
- readonly name: Name;
195
- /**
196
- * Check if this is a V0 (legacy) note
197
- */
198
- readonly isV0: boolean;
199
- /**
200
- * Check if this is a V1 note
201
- */
202
- readonly isV1: boolean;
203
- readonly assets: bigint;
204
- readonly version: Version;
205
- /**
206
- * Returns note data. For V0 notes this returns empty NoteData since V0 doesn't have this field.
207
- */
208
- readonly noteData: NoteData;
209
- }
210
- export class NoteData {
211
- free(): void;
212
- [Symbol.dispose](): void;
213
- toProtobuf(): any;
214
- static fromProtobuf(value: any): NoteData;
215
- constructor(entries: NoteDataEntry[]);
216
- static empty(): NoteData;
217
- static fromPkh(pkh: Pkh): NoteData;
218
- readonly entries: NoteDataEntry[];
219
- }
220
- export class NoteDataEntry {
221
- free(): void;
222
- [Symbol.dispose](): void;
223
- toProtobuf(): any;
224
- static fromProtobuf(value: any): NoteDataEntry;
225
- constructor(key: string, blob: Uint8Array);
226
- readonly key: string;
227
- readonly blob: Uint8Array;
228
- }
229
- export class Noun {
230
- private constructor();
231
- free(): void;
232
- [Symbol.dispose](): void;
233
- static cue(jam: Uint8Array): Noun;
234
- jam(): Uint8Array;
235
- static fromJs(value: any): Noun;
236
- toJs(): any;
237
- }
238
- export class Pkh {
239
- free(): void;
240
- [Symbol.dispose](): void;
241
- toProtobuf(): any;
242
- static fromProtobuf(value: any): Pkh;
243
- constructor(m: bigint, hashes: string[]);
244
- static single(hash: string): Pkh;
245
- readonly m: bigint;
246
- readonly hashes: string[];
247
- }
248
- export class RawTx {
249
- private constructor();
250
- free(): void;
251
- [Symbol.dispose](): void;
252
- /**
253
- * Convert to protobuf RawTransaction for sending via gRPC
254
- */
255
- toProtobuf(): any;
256
- static fromProtobuf(value: any): RawTx;
257
- toNockchainTx(): NockchainTx;
258
- /**
259
- * Convert to jammed transaction file for inspecting through CLI
260
- */
261
- toJam(): Uint8Array;
262
- /**
263
- * Calculate output notes from the transaction spends.
264
- */
265
- outputs(): Note[];
266
- static fromJam(jam: Uint8Array): RawTx;
267
- readonly id: Digest;
268
- readonly name: string;
269
- readonly version: Version;
270
- }
271
- export class Seed {
272
- free(): void;
273
- [Symbol.dispose](): void;
274
- static newSinglePkh(pkh: Digest, gift: bigint, parent_hash: Digest, include_lock_data: boolean): Seed;
275
- constructor(output_source: Source | null | undefined, lock_root: LockRoot, gift: bigint, note_data: NoteData, parent_hash: Digest);
276
- parentHash: Digest;
277
- get outputSource(): Source | undefined;
278
- set outputSource(value: Source | null | undefined);
279
- lockRoot: LockRoot;
280
- noteData: NoteData;
281
- gift: bigint;
282
- }
283
- export class Signature {
284
- free(): void;
285
- [Symbol.dispose](): void;
286
- constructor(c: Uint8Array, s: Uint8Array);
287
- readonly c: Uint8Array;
288
- readonly s: Uint8Array;
289
- }
290
- export class Source {
291
- private constructor();
292
- free(): void;
293
- [Symbol.dispose](): void;
294
- readonly isCoinbase: boolean;
295
- readonly hash: Digest;
296
- }
297
1037
  export class SpendBuilder {
298
1038
  free(): void;
299
1039
  [Symbol.dispose](): void;
300
- /**
301
- * Get current refund
302
- */
303
- curRefund(): Seed | undefined;
304
- /**
305
- * Checks whether note.assets = seeds + fee
306
- *
307
- * This function needs to return true for `TxBuilder::validate` to pass
308
- */
1040
+ curRefund(): SeedV1 | undefined;
309
1041
  isBalanced(): boolean;
310
- /**
311
- * Attatch a preimage to this spend
312
- */
313
1042
  addPreimage(preimage_jam: Uint8Array): Digest | undefined;
314
- /**
315
- * Compute refund from any spare assets, given `refund_lock` was passed
316
- */
317
1043
  computeRefund(include_lock_data: boolean): void;
318
- /**
319
- * Manually invalidate signatures
320
- *
321
- * Each spend's fee+seeds are bound to one or more signatures. If they get changed, the
322
- * signature becomes invalid. This builder automatically invalidates signatures upon relevant
323
- * modifications, but this functionality is provided nonetheless.
324
- */
325
1044
  invalidateSigs(): void;
326
- /**
327
- * Get the list of missing "unlocks"
328
- *
329
- * An unlock is a spend condition to be satisfied. For instance, for a `Pkh` spend condition,
330
- * if the transaction is unsigned, this function will return a Pkh type missing unlock, with
331
- * the list of valid PKH's and number of signatures needed. This will not return PKHs that are
332
- * already attatched to the spend (relevant for multisigs). For `Hax` spend condition, this
333
- * will return any missing preimages. This function will return a list of not-yet-validated
334
- * spend conditions.
335
- */
336
- missingUnlocks(): any[];
337
- /**
338
- * Set the fee of this spend
339
- */
340
- fee(fee: bigint): void;
1045
+ missingUnlocks(): MissingUnlocks[];
1046
+ fee(fee: Nicks): void;
341
1047
  /**
342
1048
  * Create a new `SpendBuilder` with a given note and spend condition
343
1049
  */
344
1050
  constructor(note: Note, spend_condition?: SpendCondition | null, refund_lock?: SpendCondition | null);
345
- /**
346
- * Add seed to this spend
347
- *
348
- * Seed is an output with a recipient (as defined by the spend condition).
349
- *
350
- * Nockchain transaction engine will take all seeds with matching lock from all spends in the
351
- * transaction, and merge them into one output note.
352
- */
353
- seed(seed: Seed): void;
354
- /**
355
- * Sign the transaction with a given private key
356
- */
1051
+ seed(seed: SeedV1): void;
357
1052
  sign(signing_key_bytes: Uint8Array): boolean;
358
1053
  }
359
- export class SpendCondition {
360
- free(): void;
361
- [Symbol.dispose](): void;
362
- firstName(): Digest;
363
- toProtobuf(): any;
364
- static fromProtobuf(value: any): SpendCondition;
365
- constructor(primitives: LockPrimitive[]);
366
- hash(): Digest;
367
- static newPkh(pkh: Pkh): SpendCondition;
368
- }
369
- /**
370
- * Timelock for V0 (legacy) notes
371
- *
372
- * This is similar to LockTim but used for v0 notes' timelock constraints.
373
- * At least one constraint (min or max in either rel or abs) must be set.
374
- */
375
- export class Timelock {
376
- free(): void;
377
- [Symbol.dispose](): void;
378
- constructor(rel: TimelockRange, abs: TimelockRange);
379
- readonly abs: TimelockRange;
380
- readonly rel: TimelockRange;
381
- }
382
- export class TimelockRange {
383
- free(): void;
384
- [Symbol.dispose](): void;
385
- constructor(min?: bigint | null, max?: bigint | null);
386
- readonly max: bigint | undefined;
387
- readonly min: bigint | undefined;
388
- }
389
1054
  export class TxBuilder {
390
1055
  free(): void;
391
1056
  [Symbol.dispose](): void;
392
1057
  allSpends(): SpendBuilder[];
393
- /**
394
- * Appends `preimage_jam` to all spend conditions that expect this preimage.
395
- */
396
1058
  addPreimage(preimage_jam: Uint8Array): Digest | undefined;
397
- /**
398
- * Perform a simple-spend on this builder.
399
- *
400
- * It is HIGHLY recommended to not mix `simpleSpend` with other types of spends.
401
- *
402
- * This performs a fairly complex set of operations, in order to mimic behavior of nockchain
403
- * CLI wallet's create-tx option. Note that we do not do 1-1 mapping of that functionality,
404
- * most notably - if `recipient` is the same as `refund_pkh`, we will create 1 seed, while the
405
- * CLI wallet will create 2.
406
- *
407
- * Another difference is that you should call `sign` and `validate` after calling this method.
408
- *
409
- * Internally, the transaction builder takes ALL of the `notes` provided, and stores them for
410
- * fee adjustments. If there are multiple notes being used, our fee setup also differs from
411
- * the CLI, because we first greedily spend the notes out, and then take fees from any
412
- * remaining refunds.
413
- *
414
- * This function prioritizes using the least number of notes possible, because that lowers the
415
- * fee used.
416
- *
417
- * You may choose to override the fee with `fee_override`, but do note that `validate` will
418
- * fail, in case this fee is too small.
419
- *
420
- * `include_lock_data` can be used to include `%lock` key in note-data, with the
421
- * `SpendCondition` used. However, note-data costs 1 << 15 nicks, which means, it can get
422
- * expensive.
423
- *
424
- * Optional parameter `remove_unused_notes`, if set to false, will keep the notes in the
425
- * transaction builder. This is meant to be used whenever additional operations are performed
426
- * on the builder, such as additional spends, or `addPreimage` calls. All of these increase
427
- * the required fee (which can be checked with `calcFee`), and unused notes can then be used
428
- * to adjust fees with `setFeeAndBalanceRefund` or `recalcAndSetFee`. Once all operations are
429
- * done, one should call `removeUnusedNotes` to ensure these notes are not used within the
430
- * transaction.
431
- */
432
- simpleSpend(notes: Note[], spend_conditions: SpendCondition[], recipient: Digest, gift: bigint, fee_override: bigint | null | undefined, refund_pkh: Digest, include_lock_data: boolean): void;
433
- /**
434
- * Recalculate fee and set it, balancing things out with refunds
435
- */
1059
+ simpleSpend(notes: Note[], spend_conditions: SpendCondition[], recipient: Digest, gift: Nicks, fee_override: Nicks | null | undefined, refund_pkh: Digest, include_lock_data: boolean): void;
436
1060
  recalcAndSetFee(include_lock_data: boolean): void;
437
- /**
438
- * Distributes `fee` across builder's spends, and balances refunds out
439
- *
440
- * `adjust_fee` parameter allows the fee to be slightly tweaked, whenever notes are added or
441
- * removed to/from the builder's fee note pool. This is because using more or less notes
442
- * impacts the exact fee being required. If the caller estimates fee and sets it, adding more
443
- * notes will change the exact fee needed, and setting this parameter to true will allow one
444
- * to not have to call this function multiple times.
445
- */
446
- setFeeAndBalanceRefund(fee: bigint, adjust_fee: boolean, include_lock_data: boolean): void;
1061
+ setFeeAndBalanceRefund(fee: Nicks, adjust_fee: boolean, include_lock_data: boolean): void;
447
1062
  /**
448
1063
  * Create an empty transaction builder
449
1064
  */
450
- constructor(fee_per_word: bigint);
451
- /**
452
- * Sign the transaction with a private key.
453
- *
454
- * This will sign all spends that are still missing signature from
455
- */
1065
+ constructor(settings: TxEngineSettings);
456
1066
  sign(signing_key_bytes: Uint8Array): void;
457
1067
  build(): NockchainTx;
458
1068
  /**
459
1069
  * Append a `SpendBuilder` to this transaction
460
1070
  */
461
1071
  spend(spend: SpendBuilder): SpendBuilder | undefined;
462
- /**
463
- * Gets the current fee set on all spends.
464
- */
465
- curFee(): bigint;
1072
+ curFee(): Nicks;
466
1073
  /**
467
1074
  * Reconstruct a builder from raw transaction and its input notes.
468
- *
469
- * To get the builder back, you must pass the notes and their corresponding spend conditions.
470
- * If serializing the builder, call `WasmTxBuilder::all_notes`.
471
- */
472
- static fromTx(tx: RawTx, notes: Note[], spend_conditions: SpendCondition[]): TxBuilder;
473
- /**
474
- * Calculates the fee needed for the transaction.
475
- *
476
- * NOTE: if the transaction is unsigned, this function will estimate the fee needed, supposing
477
- * all signatures are added. However, this heuristic is only accurate for one signature. In
478
- * addition, this fee calculation does not estimate the size of missing preimages.
479
- *
480
- * So, first, add missing preimages, and only then calc the fee. If you're building a multisig
481
- * transaction, this value might be incorrect.
482
- */
483
- calcFee(): bigint;
484
- /**
485
- * Validate the transaction.
486
1075
  */
1076
+ static fromTx(tx: RawTx, notes: Note[], spend_conditions: SpendCondition[], settings: TxEngineSettings): TxBuilder;
1077
+ calcFee(): Nicks;
487
1078
  validate(): void;
488
1079
  allNotes(): TxNotes;
489
1080
  }
490
- export class TxNotes {
491
- private constructor();
492
- free(): void;
493
- [Symbol.dispose](): void;
494
- readonly spendConditions: SpendCondition[];
495
- readonly notes: Note[];
496
- }
497
- export class Version {
498
- free(): void;
499
- [Symbol.dispose](): void;
500
- static V0(): Version;
501
- static V1(): Version;
502
- static V2(): Version;
503
- constructor(version: number);
504
- }
505
1081
 
506
1082
  export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
507
1083
 
508
1084
  export interface InitOutput {
509
1085
  readonly memory: WebAssembly.Memory;
510
- readonly __wbg_digest_free: (a: number, b: number) => void;
511
- readonly __wbg_hax_free: (a: number, b: number) => void;
512
- readonly __wbg_lockprimitive_free: (a: number, b: number) => void;
513
- readonly __wbg_lockroot_free: (a: number, b: number) => void;
514
- readonly __wbg_locktim_free: (a: number, b: number) => void;
515
- readonly __wbg_name_free: (a: number, b: number) => void;
516
- readonly __wbg_nockchaintx_free: (a: number, b: number) => void;
517
- readonly __wbg_note_free: (a: number, b: number) => void;
518
- readonly __wbg_notedata_free: (a: number, b: number) => void;
519
- readonly __wbg_notedataentry_free: (a: number, b: number) => void;
520
- readonly __wbg_pkh_free: (a: number, b: number) => void;
521
- readonly __wbg_rawtx_free: (a: number, b: number) => void;
522
- readonly __wbg_seed_free: (a: number, b: number) => void;
523
- readonly __wbg_source_free: (a: number, b: number) => void;
1086
+ readonly __wbg_grpcclient_free: (a: number, b: number) => void;
1087
+ readonly atom_to_belts: (a: any) => [number, number, number];
1088
+ readonly belts_to_atom: (a: any) => [number, number, number];
1089
+ readonly cue: (a: number, b: number) => [number, number, number];
1090
+ readonly grpcclient_getBalanceByAddress: (a: number, b: number, c: number) => any;
1091
+ readonly grpcclient_getBalanceByFirstName: (a: number, b: number, c: number) => any;
1092
+ readonly grpcclient_new: (a: number, b: number) => number;
1093
+ readonly grpcclient_peek: (a: number, b: number, c: any) => any;
1094
+ readonly grpcclient_poke: (a: number, b: number, c: any, d: any) => any;
1095
+ readonly grpcclient_sendTransaction: (a: number, b: any) => any;
1096
+ readonly grpcclient_transactionAccepted: (a: number, b: number, c: number) => any;
1097
+ readonly jam: (a: any) => [number, number, number, number];
1098
+ readonly tas: (a: number, b: number) => any;
1099
+ readonly tas_belts: (a: number, b: number) => any;
1100
+ readonly untas: (a: any) => [number, number, number, number];
524
1101
  readonly __wbg_spendbuilder_free: (a: number, b: number) => void;
525
- readonly __wbg_spendcondition_free: (a: number, b: number) => void;
526
- readonly __wbg_timelock_free: (a: number, b: number) => void;
527
- readonly __wbg_timelockrange_free: (a: number, b: number) => void;
528
1102
  readonly __wbg_txbuilder_free: (a: number, b: number) => void;
529
- readonly __wbg_txnotes_free: (a: number, b: number) => void;
530
- readonly __wbg_version_free: (a: number, b: number) => void;
531
- readonly digest_fromProtobuf: (a: any) => [number, number, number];
532
- readonly digest_new: (a: number, b: number) => number;
533
- readonly digest_toProtobuf: (a: number) => [number, number, number];
534
- readonly digest_value: (a: number) => [number, number];
535
- readonly hax_digests: (a: number) => [number, number];
536
- readonly hax_new: (a: number, b: number) => number;
537
- readonly lockprimitive_fromProtobuf: (a: any) => [number, number, number];
538
- readonly lockprimitive_newBrn: () => number;
539
- readonly lockprimitive_newHax: (a: number) => number;
540
- readonly lockprimitive_newPkh: (a: number) => number;
541
- readonly lockprimitive_newTim: (a: number) => number;
542
- readonly lockprimitive_toProtobuf: (a: number) => [number, number, number];
543
- readonly lockroot_fromHash: (a: number) => [number, number, number];
544
- readonly lockroot_fromSpendCondition: (a: number) => [number, number, number];
545
- readonly lockroot_hash: (a: number) => number;
546
- readonly lockroot_lock: (a: number) => number;
547
- readonly locktim_abs: (a: number) => number;
548
- readonly locktim_coinbase: () => number;
549
- readonly locktim_fromProtobuf: (a: any) => [number, number, number];
550
- readonly locktim_new: (a: number, b: number) => number;
551
- readonly locktim_rel: (a: number) => number;
552
- readonly locktim_toProtobuf: (a: number) => [number, number, number];
553
- readonly name_first: (a: number) => [number, number];
554
- readonly name_fromProtobuf: (a: any) => [number, number, number];
555
- readonly name_last: (a: number) => [number, number];
556
- readonly name_new: (a: number, b: number, c: number, d: number) => [number, number, number];
557
- readonly name_toProtobuf: (a: number) => [number, number, number];
558
- readonly nockchaintx_fromJam: (a: number, b: number) => [number, number, number];
559
- readonly nockchaintx_id: (a: number) => number;
560
- readonly nockchaintx_name: (a: number) => [number, number];
561
- readonly nockchaintx_outputs: (a: number) => [number, number];
562
- readonly nockchaintx_toJam: (a: number) => any;
563
- readonly nockchaintx_toRawTx: (a: number) => number;
564
- readonly nockchaintx_version: (a: number) => number;
565
- readonly note_assets: (a: number) => bigint;
566
- readonly note_fromProtobuf: (a: any) => [number, number, number];
567
- readonly note_hash: (a: number) => number;
568
- readonly note_isV0: (a: number) => number;
569
- readonly note_isV1: (a: number) => number;
570
- readonly note_name: (a: number) => number;
571
- readonly note_new: (a: number, b: bigint, c: number, d: number, e: bigint) => [number, number, number];
572
- readonly note_newV0: (a: bigint, b: bigint, c: number, d: number, e: number, f: number, g: number, h: bigint) => [number, number, number];
573
- readonly note_noteData: (a: number) => number;
574
- readonly note_originPage: (a: number) => bigint;
575
- readonly note_toProtobuf: (a: number) => [number, number, number];
576
- readonly note_version: (a: number) => number;
577
- readonly notedata_empty: () => number;
578
- readonly notedata_entries: (a: number) => [number, number];
579
- readonly notedata_fromPkh: (a: number) => [number, number, number];
580
- readonly notedata_fromProtobuf: (a: any) => [number, number, number];
581
- readonly notedata_new: (a: number, b: number) => number;
582
- readonly notedata_toProtobuf: (a: number) => [number, number, number];
583
- readonly notedataentry_blob: (a: number) => [number, number];
584
- readonly notedataentry_fromProtobuf: (a: any) => [number, number, number];
585
- readonly notedataentry_key: (a: number) => [number, number];
586
- readonly notedataentry_new: (a: number, b: number, c: number, d: number) => number;
587
- readonly notedataentry_toProtobuf: (a: number) => [number, number, number];
588
- readonly pkh_fromProtobuf: (a: any) => [number, number, number];
589
- readonly pkh_hashes: (a: number) => [number, number];
590
- readonly pkh_m: (a: number) => bigint;
591
- readonly pkh_new: (a: bigint, b: number, c: number) => number;
592
- readonly pkh_single: (a: number, b: number) => number;
593
- readonly pkh_toProtobuf: (a: number) => [number, number, number];
594
- readonly rawtx_fromJam: (a: number, b: number) => [number, number, number];
595
- readonly rawtx_fromProtobuf: (a: any) => [number, number, number];
596
- readonly rawtx_id: (a: number) => number;
597
- readonly rawtx_name: (a: number) => [number, number];
598
- readonly rawtx_outputs: (a: number) => [number, number];
599
- readonly rawtx_toJam: (a: number) => any;
600
- readonly rawtx_toNockchainTx: (a: number) => [number, number, number];
601
- readonly rawtx_toProtobuf: (a: number) => [number, number, number];
602
- readonly rawtx_version: (a: number) => number;
603
- readonly seed_gift: (a: number) => bigint;
604
- readonly seed_lockRoot: (a: number) => number;
605
- readonly seed_new: (a: number, b: number, c: bigint, d: number, e: number) => number;
606
- readonly seed_newSinglePkh: (a: number, b: bigint, c: number, d: number) => [number, number, number];
607
- readonly seed_noteData: (a: number) => number;
608
- readonly seed_outputSource: (a: number) => number;
609
- readonly seed_parentHash: (a: number) => number;
610
- readonly seed_set_gift: (a: number, b: bigint) => void;
611
- readonly seed_set_lockRoot: (a: number, b: number) => void;
612
- readonly seed_set_noteData: (a: number, b: number) => void;
613
- readonly seed_set_outputSource: (a: number, b: number) => void;
614
- readonly seed_set_parentHash: (a: number, b: number) => void;
615
- readonly source_hash: (a: number) => number;
616
- readonly source_isCoinbase: (a: number) => number;
1103
+ readonly create_note_v0: (a: number, b: bigint, c: number, d: number, e: any, f: number, g: number, h: any) => [number, number, number];
1104
+ readonly create_note_v1: (a: any, b: number, c: any, d: any, e: any) => [number, number, number];
1105
+ readonly digest_from_protobuf: (a: any) => [number, number, number];
1106
+ readonly digest_to_hex: (a: any) => [number, number];
1107
+ readonly digest_to_protobuf: (a: any) => any;
1108
+ readonly hex_to_digest: (a: number, b: number) => [number, number, number];
1109
+ readonly nockchainTxToRaw: (a: any) => any;
1110
+ readonly note_from_protobuf: (a: any) => [number, number, number];
1111
+ readonly note_hash: (a: any) => any;
1112
+ readonly note_to_protobuf: (a: any) => any;
1113
+ readonly rawTxFromProtobuf: (a: any) => [number, number, number];
1114
+ readonly rawTxOutputs: (a: any) => [number, number];
1115
+ readonly rawTxToNockchainTx: (a: any) => any;
1116
+ readonly rawTxToProtobuf: (a: any) => any;
617
1117
  readonly spendbuilder_addPreimage: (a: number, b: number, c: number) => [number, number, number];
618
1118
  readonly spendbuilder_computeRefund: (a: number, b: number) => void;
619
- readonly spendbuilder_curRefund: (a: number) => number;
620
- readonly spendbuilder_fee: (a: number, b: bigint) => void;
1119
+ readonly spendbuilder_curRefund: (a: number) => any;
1120
+ readonly spendbuilder_fee: (a: number, b: any) => void;
621
1121
  readonly spendbuilder_invalidateSigs: (a: number) => void;
622
1122
  readonly spendbuilder_isBalanced: (a: number) => number;
623
1123
  readonly spendbuilder_missingUnlocks: (a: number) => [number, number, number, number];
624
- readonly spendbuilder_new: (a: number, b: number, c: number) => [number, number, number];
625
- readonly spendbuilder_seed: (a: number, b: number) => [number, number];
1124
+ readonly spendbuilder_new: (a: any, b: number, c: number) => [number, number, number];
1125
+ readonly spendbuilder_seed: (a: number, b: any) => [number, number];
626
1126
  readonly spendbuilder_sign: (a: number, b: number, c: number) => [number, number, number];
627
- readonly spendcondition_firstName: (a: number) => [number, number, number];
628
- readonly spendcondition_fromProtobuf: (a: any) => [number, number, number];
629
- readonly spendcondition_hash: (a: number) => [number, number, number];
630
- readonly spendcondition_new: (a: number, b: number) => number;
631
- readonly spendcondition_newPkh: (a: number) => number;
632
- readonly spendcondition_toProtobuf: (a: number) => [number, number, number];
633
- readonly timelock_new: (a: number, b: number) => [number, number, number];
634
- readonly timelockrange_max: (a: number) => [number, bigint];
635
- readonly timelockrange_min: (a: number) => [number, bigint];
636
- readonly timelockrange_new: (a: number, b: bigint, c: number, d: bigint) => number;
637
1127
  readonly txbuilder_addPreimage: (a: number, b: number, c: number) => [number, number, number];
638
1128
  readonly txbuilder_allNotes: (a: number) => [number, number, number];
639
1129
  readonly txbuilder_allSpends: (a: number) => [number, number];
640
1130
  readonly txbuilder_build: (a: number) => [number, number, number];
641
- readonly txbuilder_calcFee: (a: number) => bigint;
642
- readonly txbuilder_curFee: (a: number) => bigint;
643
- readonly txbuilder_fromTx: (a: number, b: number, c: number, d: number, e: number) => [number, number, number];
644
- readonly txbuilder_new: (a: bigint) => number;
1131
+ readonly txbuilder_calcFee: (a: number) => any;
1132
+ readonly txbuilder_curFee: (a: number) => any;
1133
+ readonly txbuilder_fromTx: (a: any, b: number, c: number, d: number, e: number, f: any) => [number, number, number];
1134
+ readonly txbuilder_new: (a: any) => number;
645
1135
  readonly txbuilder_recalcAndSetFee: (a: number, b: number) => [number, number];
646
- readonly txbuilder_setFeeAndBalanceRefund: (a: number, b: bigint, c: number, d: number) => [number, number];
1136
+ readonly txbuilder_setFeeAndBalanceRefund: (a: number, b: any, c: number, d: number) => [number, number];
647
1137
  readonly txbuilder_sign: (a: number, b: number, c: number) => [number, number];
648
- readonly txbuilder_simpleSpend: (a: number, b: number, c: number, d: number, e: number, f: number, g: bigint, h: number, i: bigint, j: number, k: number) => [number, number];
1138
+ readonly txbuilder_simpleSpend: (a: number, b: number, c: number, d: number, e: number, f: any, g: any, h: number, i: any, j: number) => [number, number];
649
1139
  readonly txbuilder_spend: (a: number, b: number) => number;
650
1140
  readonly txbuilder_validate: (a: number) => [number, number];
651
- readonly txnotes_notes: (a: number) => [number, number];
652
- readonly txnotes_spendConditions: (a: number) => [number, number];
653
- readonly version_V0: () => number;
654
- readonly version_V1: () => number;
655
- readonly version_V2: () => number;
656
- readonly wasmseed_fromProtobuf: (a: any) => [number, number, number];
657
- readonly wasmseed_toProtobuf: (a: number) => [number, number, number];
658
- readonly version_new: (a: number) => number;
659
- readonly timelock_abs: (a: number) => number;
660
- readonly timelock_rel: (a: number) => number;
661
1141
  readonly __wbg_extendedkey_free: (a: number, b: number) => void;
662
- readonly __wbg_grpcclient_free: (a: number, b: number) => void;
663
- readonly __wbg_noun_free: (a: number, b: number) => void;
664
- readonly __wbg_signature_free: (a: number, b: number) => void;
665
1142
  readonly deriveMasterKey: (a: number, b: number) => number;
666
1143
  readonly deriveMasterKeyFromMnemonic: (a: number, b: number, c: number, d: number) => [number, number, number];
667
1144
  readonly extendedkey_chainCode: (a: number) => [number, number];
668
1145
  readonly extendedkey_deriveChild: (a: number, b: number) => [number, number, number];
669
1146
  readonly extendedkey_privateKey: (a: number) => [number, number];
670
1147
  readonly extendedkey_publicKey: (a: number) => [number, number];
671
- readonly grpcclient_getBalanceByAddress: (a: number, b: number, c: number) => any;
672
- readonly grpcclient_getBalanceByFirstName: (a: number, b: number, c: number) => any;
673
- readonly grpcclient_new: (a: number, b: number) => number;
674
- readonly grpcclient_sendTransaction: (a: number, b: any) => any;
675
- readonly grpcclient_transactionAccepted: (a: number, b: number, c: number) => any;
676
1148
  readonly hashNoun: (a: number, b: number) => [number, number, number, number];
677
1149
  readonly hashPublicKey: (a: number, b: number) => [number, number, number, number];
678
1150
  readonly hashU64: (a: bigint) => [number, number];
679
- readonly noun_cue: (a: number, b: number) => [number, number, number];
680
- readonly noun_fromJs: (a: any) => [number, number, number];
681
- readonly noun_jam: (a: number) => [number, number, number, number];
682
- readonly noun_toJs: (a: number) => [number, number, number];
683
1151
  readonly signMessage: (a: number, b: number, c: number, d: number) => [number, number, number];
684
- readonly signature_c: (a: number) => [number, number];
685
- readonly signature_new: (a: number, b: number, c: number, d: number) => number;
686
- readonly signature_s: (a: number) => [number, number];
687
- readonly verifySignature: (a: number, b: number, c: number, d: number, e: number) => [number, number, number];
1152
+ readonly verifySignature: (a: number, b: number, c: any, d: number, e: number) => [number, number, number];
688
1153
  readonly __wbg_intounderlyingsource_free: (a: number, b: number) => void;
689
1154
  readonly intounderlyingsource_cancel: (a: number) => void;
690
1155
  readonly intounderlyingsource_pull: (a: number, b: any) => any;
@@ -698,6 +1163,121 @@ export interface InitOutput {
698
1163
  readonly intounderlyingsink_abort: (a: number, b: any) => any;
699
1164
  readonly intounderlyingsink_close: (a: number) => any;
700
1165
  readonly intounderlyingsink_write: (a: number, b: any) => any;
1166
+ readonly haxFromNoun: (a: any) => [number, number, number];
1167
+ readonly haxHash: (a: any) => any;
1168
+ readonly haxToNoun: (a: any) => any;
1169
+ readonly inputFromNoun: (a: any) => [number, number, number];
1170
+ readonly inputHash: (a: any) => any;
1171
+ readonly inputToNoun: (a: any) => any;
1172
+ readonly inputsFromNoun: (a: any) => [number, number, number];
1173
+ readonly inputsHash: (a: any) => any;
1174
+ readonly inputsToNoun: (a: any) => any;
1175
+ readonly lockRootFromNoun: (a: any) => [number, number, number];
1176
+ readonly lockRootHash: (a: any) => any;
1177
+ readonly lockRootToNoun: (a: any) => any;
1178
+ readonly nockchainTxFromNoun: (a: any) => [number, number, number];
1179
+ readonly nockchainTxToNoun: (a: any) => any;
1180
+ readonly noteDataFromNoun: (a: any) => [number, number, number];
1181
+ readonly noteDataHash: (a: any) => any;
1182
+ readonly noteDataToNoun: (a: any) => any;
1183
+ readonly noteFromNoun: (a: any) => [number, number, number];
1184
+ readonly noteHash: (a: any) => any;
1185
+ readonly noteInnerFromNoun: (a: any) => [number, number, number];
1186
+ readonly noteInnerHash: (a: any) => any;
1187
+ readonly noteInnerToNoun: (a: any) => any;
1188
+ readonly noteToNoun: (a: any) => any;
1189
+ readonly noteV1FromNoun: (a: any) => [number, number, number];
1190
+ readonly noteV1Hash: (a: any) => any;
1191
+ readonly noteV1ToNoun: (a: any) => any;
1192
+ readonly pkhSignatureFromNoun: (a: any) => [number, number, number];
1193
+ readonly pkhSignatureHash: (a: any) => any;
1194
+ readonly pkhSignatureToNoun: (a: any) => any;
1195
+ readonly rawTxV1FromNoun: (a: any) => [number, number, number];
1196
+ readonly rawTxV1ToNoun: (a: any) => any;
1197
+ readonly seedV1FromNoun: (a: any) => [number, number, number];
1198
+ readonly seedV1Hash: (a: any) => any;
1199
+ readonly seedV1ToNoun: (a: any) => any;
1200
+ readonly seedsV0FromNoun: (a: any) => [number, number, number];
1201
+ readonly seedsV0Hash: (a: any) => any;
1202
+ readonly seedsV0ToNoun: (a: any) => any;
1203
+ readonly seedsV1FromNoun: (a: any) => [number, number, number];
1204
+ readonly seedsV1Hash: (a: any) => any;
1205
+ readonly seedsV1ToNoun: (a: any) => any;
1206
+ readonly spendV0FromNoun: (a: any) => [number, number, number];
1207
+ readonly spendV0Hash: (a: any) => any;
1208
+ readonly spendV0ToNoun: (a: any) => any;
1209
+ readonly spendV1FromNoun: (a: any) => [number, number, number];
1210
+ readonly spendV1Hash: (a: any) => any;
1211
+ readonly spendV1ToNoun: (a: any) => any;
1212
+ readonly spendsV1FromNoun: (a: any) => [number, number, number];
1213
+ readonly spendsV1Hash: (a: any) => any;
1214
+ readonly spendsV1ToNoun: (a: any) => any;
1215
+ readonly witnessFromNoun: (a: any) => [number, number, number];
1216
+ readonly witnessHash: (a: any) => any;
1217
+ readonly witnessToNoun: (a: any) => any;
1218
+ readonly lockPrimitiveFromNoun: (a: any) => [number, number, number];
1219
+ readonly lockPrimitiveHash: (a: any) => any;
1220
+ readonly lockPrimitiveToNoun: (a: any) => any;
1221
+ readonly merkleProofFromNoun: (a: any) => [number, number, number];
1222
+ readonly merkleProofHash: (a: any) => any;
1223
+ readonly merkleProofToNoun: (a: any) => any;
1224
+ readonly versionFromNoun: (a: any) => [number, number, number];
1225
+ readonly versionHash: (a: any) => any;
1226
+ readonly versionToNoun: (a: any) => any;
1227
+ readonly sigFromNoun: (a: any) => [number, number, number];
1228
+ readonly sigHash: (a: any) => any;
1229
+ readonly sigToNoun: (a: any) => any;
1230
+ readonly timelockIntentFromNoun: (a: any) => [number, number, number];
1231
+ readonly timelockIntentHash: (a: any) => any;
1232
+ readonly timelockIntentToNoun: (a: any) => any;
1233
+ readonly legacySignatureFromNoun: (a: any) => [number, number, number];
1234
+ readonly legacySignatureHash: (a: any) => any;
1235
+ readonly legacySignatureToNoun: (a: any) => any;
1236
+ readonly nameFromNoun: (a: any) => [number, number, number];
1237
+ readonly nameHash: (a: any) => any;
1238
+ readonly nameToNoun: (a: any) => any;
1239
+ readonly sourceFromNoun: (a: any) => [number, number, number];
1240
+ readonly sourceHash: (a: any) => any;
1241
+ readonly sourceToNoun: (a: any) => any;
1242
+ readonly lockMetadataFromNoun: (a: any) => [number, number, number];
1243
+ readonly lockMetadataHash: (a: any) => any;
1244
+ readonly lockMetadataToNoun: (a: any) => any;
1245
+ readonly noteV0FromNoun: (a: any) => [number, number, number];
1246
+ readonly noteV0Hash: (a: any) => any;
1247
+ readonly noteV0ToNoun: (a: any) => any;
1248
+ readonly pkhFromNoun: (a: any) => [number, number, number];
1249
+ readonly pkhHash: (a: any) => any;
1250
+ readonly pkhToNoun: (a: any) => any;
1251
+ readonly timelockRangeFromNoun: (a: any) => [number, number, number];
1252
+ readonly timelockRangeHash: (a: any) => any;
1253
+ readonly timelockRangeToNoun: (a: any) => any;
1254
+ readonly witnessDataFromNoun: (a: any) => [number, number, number];
1255
+ readonly witnessDataToNoun: (a: any) => any;
1256
+ readonly balanceFromNoun: (a: any) => [number, number, number];
1257
+ readonly balanceToNoun: (a: any) => any;
1258
+ readonly balanceUpdateFromNoun: (a: any) => [number, number, number];
1259
+ readonly balanceUpdateToNoun: (a: any) => any;
1260
+ readonly inputDisplayFromNoun: (a: any) => [number, number, number];
1261
+ readonly inputDisplayToNoun: (a: any) => any;
1262
+ readonly lockMerkleProofFromNoun: (a: any) => [number, number, number];
1263
+ readonly lockMerkleProofHash: (a: any) => any;
1264
+ readonly lockMerkleProofToNoun: (a: any) => any;
1265
+ readonly rawTxV0FromNoun: (a: any) => [number, number, number];
1266
+ readonly rawTxV0ToNoun: (a: any) => any;
1267
+ readonly seedV0FromNoun: (a: any) => [number, number, number];
1268
+ readonly seedV0Hash: (a: any) => any;
1269
+ readonly seedV0ToNoun: (a: any) => any;
1270
+ readonly spendConditionFromNoun: (a: any) => [number, number, number];
1271
+ readonly spendConditionHash: (a: any) => any;
1272
+ readonly spendConditionToNoun: (a: any) => any;
1273
+ readonly timelockFromNoun: (a: any) => [number, number, number];
1274
+ readonly timelockHash: (a: any) => any;
1275
+ readonly timelockToNoun: (a: any) => any;
1276
+ readonly transactionDisplayFromNoun: (a: any) => [number, number, number];
1277
+ readonly transactionDisplayToNoun: (a: any) => any;
1278
+ readonly digestFromNoun: (a: any) => [number, number, number];
1279
+ readonly digestHash: (a: any) => any;
1280
+ readonly digestToNoun: (a: any) => any;
701
1281
  readonly wasm_bindgen__convert__closures_____invoke__hbf186e27576c509b: (a: number, b: number, c: any) => void;
702
1282
  readonly wasm_bindgen__closure__destroy__h20e54f17b0de8c43: (a: number, b: number) => void;
703
1283
  readonly wasm_bindgen__convert__closures_____invoke__h2bc9de53710866b6: (a: number, b: number, c: any, d: any) => void;
@@ -732,3 +1312,7 @@ export function initSync(module: { module: SyncInitInput } | SyncInitInput): Ini
732
1312
  * @returns {Promise<InitOutput>}
733
1313
  */
734
1314
  export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
1315
+
1316
+ export type TxId = string;
1317
+ export type BlockHeight = number;
1318
+ export type LockTim = Timelock;