@nockbox/iris-wasm 0.1.2 → 0.2.0-alpha.1

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,802 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
- /**
4
- * Hash a noun (jam as input)
5
- */
6
- export function hashNoun(noun: Uint8Array): string;
7
3
  /**
8
4
  * Verify a signature with a public key
9
5
  */
10
6
  export function verifySignature(public_key_bytes: Uint8Array, signature: Signature, message: string): boolean;
11
- /**
12
- * Hash a public key to get its digest (for use in PKH)
13
- */
14
- export function hashPublicKey(public_key_bytes: Uint8Array): string;
15
7
  /**
16
8
  * Derive master key from seed bytes
17
9
  */
18
10
  export function deriveMasterKey(seed: Uint8Array): ExtendedKey;
19
11
  /**
20
- * Sign a message string with a private key
12
+ * Hash a u64 value
21
13
  */
22
- export function signMessage(private_key_bytes: Uint8Array, message: string): Signature;
14
+ export function hashU64(value: bigint): string;
23
15
  /**
24
16
  * Derive master key from BIP39 mnemonic phrase
25
17
  */
26
18
  export function deriveMasterKeyFromMnemonic(mnemonic: string, passphrase?: string | null): ExtendedKey;
27
19
  /**
28
- * Hash a u64 value
20
+ * Hash a public key to get its digest (for use in PKH)
29
21
  */
30
- export function hashU64(value: bigint): string;
22
+ export function hashPublicKey(public_key_bytes: Uint8Array): string;
23
+ /**
24
+ * Sign a message string with a private key
25
+ */
26
+ export function signMessage(private_key_bytes: Uint8Array, message: string): Signature;
27
+ /**
28
+ * Hash a noun (jam as input)
29
+ */
30
+ export function hashNoun(noun: Uint8Array): string;
31
+ export function cue(jam: Uint8Array): Noun;
32
+ export function jam(noun: Noun): Uint8Array;
33
+ export function hex_to_digest(s: string): Digest;
34
+ export function note_hash(note: Note): Digest;
35
+ export function note_to_protobuf(note: Note): PbCom2Note;
36
+ export function digest_to_hex(d: Digest): string;
37
+ 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;
38
+ export function digest_from_protobuf(value: PbCom1Hash): Digest;
39
+ export function digest_to_protobuf(d: Digest): PbCom1Hash;
40
+ export function note_from_protobuf(value: PbCom2Note): Note;
41
+ export function create_note_v1(version: Version, origin_page: number, name: Name, note_data: NoteData, assets: Nicks): Note;
31
42
  /**
32
43
  * The `ReadableStreamType` enum.
33
44
  *
34
45
  * *This API requires the following crate features to be activated: `ReadableStreamType`*
35
46
  */
36
47
  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;
48
+ export interface TxNotes {
49
+ notes: Note[];
50
+ spend_conditions: SpendCondition[];
51
+ }
52
+
53
+ export interface PbCom1TimeLockIntent {
54
+ value: PbCom1TimeLockIntentValue | undefined;
55
+ }
56
+
57
+ export interface PbCom1Input {
58
+ note: PbCom1Note | undefined;
59
+ spend: PbCom1Spend | undefined;
60
+ }
61
+
62
+ export interface PbCom1BlockHeightDelta {
63
+ value: string;
64
+ }
65
+
66
+ export interface PbCom1NamedInput {
67
+ name: PbCom1Name | undefined;
68
+ input: PbCom1Input | undefined;
69
+ }
70
+
71
+ /**
72
+ * pub struct Belt(pub u64);
73
+ */
74
+ export interface PbCom1Belt {
75
+ value: string;
76
+ }
77
+
78
+ export interface PbCom1PageResponse {
79
+ /**
80
+ * Opaque cursor for fetching the next page. Empty when there are no more
81
+ * results.
82
+ */
83
+ next_page_token: string;
84
+ }
85
+
86
+ export interface PbCom1SignatureEntry {
87
+ /**
88
+ * serialized pubkey corresponding to the signer
89
+ */
90
+ schnorr_pubkey: PbCom1SchnorrPubkey | undefined;
91
+ signature: PbCom1SchnorrSignature | undefined;
92
+ }
93
+
94
+ /**
95
+ * Use this when you want to force the output to not have a timelock
96
+ */
97
+ export interface PbCom1TimeLockRangeNeither {}
98
+
99
+ export interface PbCom1Base58Pubkey {
100
+ key: string;
101
+ }
102
+
103
+ /**
104
+ * pub chal: \\[Belt; 8\\],
105
+ * pub sig: \\[Belt; 8\\],
106
+ */
107
+ export interface PbCom1EightBelt {
108
+ belt_1: PbCom1Belt | undefined;
109
+ belt_2: PbCom1Belt | undefined;
110
+ belt_3: PbCom1Belt | undefined;
111
+ belt_4: PbCom1Belt | undefined;
112
+ belt_5: PbCom1Belt | undefined;
113
+ belt_6: PbCom1Belt | undefined;
114
+ belt_7: PbCom1Belt | undefined;
115
+ belt_8: PbCom1Belt | undefined;
116
+ }
117
+
118
+ export interface PbCom1BalanceEntry {
119
+ name: PbCom1Name | undefined;
120
+ note: PbCom1Note | undefined;
121
+ }
122
+
123
+ export interface PbCom1Source {
124
+ hash: string;
125
+ coinbase: boolean;
126
+ }
127
+
128
+ export interface PbCom1Signature {
129
+ entries: PbCom1SignatureEntry[];
130
+ }
131
+
132
+ /**
133
+ * Note: prefer using raw numeric fields in messages
134
+ * instead of these wrappers to simplify conversions.
135
+ * These remain defined for potential future use.
136
+ */
137
+ export interface PbCom1NoteVersion {
138
+ value: string;
139
+ }
140
+
141
+ export interface PbCom1Note {
142
+ /**
143
+ * page-number when added to balance
144
+ */
145
+ origin_page: PbCom1BlockHeight | undefined;
146
+ /**
147
+ * enforced timelock
148
+ */
149
+ timelock: PbCom1TimeLockIntent | undefined;
150
+ /**
151
+ * nname (human/name label)
152
+ */
153
+ name: PbCom1Name | undefined;
154
+ /**
155
+ * spending condition
156
+ */
157
+ lock: PbCom1Lock | undefined;
158
+ /**
159
+ * provenance commitment
160
+ */
161
+ source: PbCom1Source | undefined;
162
+ /**
163
+ * coin amount (nicks)
164
+ */
165
+ assets: PbCom1Nicks | undefined;
166
+ /**
167
+ * note version (currently 0)
168
+ */
169
+ version: PbCom1NoteVersion | undefined;
170
+ }
171
+
172
+ export interface PbCom1SchnorrSignature {
173
+ chal: PbCom1EightBelt | undefined;
174
+ sig: PbCom1EightBelt | undefined;
175
+ }
176
+
177
+ /**
178
+ * min and max are relative to the note\'s creation page
179
+ */
180
+ export interface PbCom1TimeLockRangeRelative {
181
+ min: PbCom1BlockHeightDelta | undefined;
182
+ max: PbCom1BlockHeightDelta | undefined;
183
+ }
184
+
185
+ export interface PbCom1WireTag {
186
+ value: PbCom1WireTagValue | undefined;
187
+ }
188
+
189
+ export interface PbCom1TimeLockRangeAbsoluteAndRelative {
190
+ absolute: PbCom1TimeLockRangeAbsolute | undefined;
191
+ relative: PbCom1TimeLockRangeRelative | undefined;
192
+ }
193
+
194
+ export interface PbCom1Lock {
195
+ /**
196
+ * threshold of keys required to spend the note
197
+ */
198
+ keys_required: number;
199
+ /**
200
+ * DEPRECATED: repeated string schnorr_pubkeys_b58 = 2;
201
+ *
202
+ * schnorr pubkeys (curve: cheetah)
203
+ */
204
+ schnorr_pubkeys: PbCom1SchnorrPubkey[];
205
+ }
206
+
207
+ export interface PbCom1BlockHeight {
208
+ value: string;
209
+ }
210
+
211
+ export interface PbCom1ErrorStatus {
212
+ code: number;
213
+ message: string;
214
+ /**
215
+ * additional error context
216
+ */
217
+ details: string | undefined;
218
+ }
219
+
220
+ /**
221
+ * min and max are absolute origin page numbers
222
+ */
223
+ export interface PbCom1TimeLockRangeAbsolute {
224
+ min: PbCom1BlockHeight | undefined;
225
+ max: PbCom1BlockHeight | undefined;
226
+ }
227
+
228
+ /**
229
+ * Generic pagination parameters for list-style RPCs.
230
+ * These types are intended to be reused across public APIs.
231
+ *
232
+ * Contract:
233
+ * - The server may return fewer items than requested (client_page_items_limit is a hint).
234
+ * - page_token is an opaque cursor produced by the server; clients must treat
235
+ * it as a black box. Servers may encode snapshot identity and last-key.
236
+ * - For consistent pagination, clients should include the returned page_token
237
+ * in the next request without modification.
238
+ * - Servers may enforce a maximum client_page_items_limit and/or byte budget regardless of
239
+ * client hints.
240
+ */
241
+ export interface PbCom1PageRequest {
242
+ /**
243
+ * Maximum number of items to return. The server may return fewer items
244
+ * than requested. Clients should not rely on receiving exactly this count.
245
+ */
246
+ client_page_items_limit: number;
247
+ /**
248
+ * Opaque cursor returned by a previous call. When set, the server resumes
249
+ * the listing from the position described by the token.
250
+ * An empty token indicates the first page.
251
+ */
252
+ page_token: string;
253
+ /**
254
+ * Optional soft limit on the uncompressed bytes to return in a single page.
255
+ * The server may ignore or cap this value according to policy. This refers
256
+ * to the gRPC payload size after protobuf encoding and decompression.
257
+ */
258
+ max_bytes: number;
259
+ }
260
+
261
+ export interface PbCom1WalletBalanceData {
262
+ /**
263
+ * Page of full UTXO entries for the requested wallet. Entries are ordered
264
+ * by (Name.first, Name.last) to support consistent pagination.
265
+ *
266
+ * note name -> amount
267
+ */
268
+ notes: PbCom1BalanceEntry[];
269
+ /**
270
+ * Snapshot metadata where this page was computed. Clients should include
271
+ * the returned page token to continue paging against the same snapshot.
272
+ *
273
+ * block height where balance was computed
274
+ */
275
+ height: PbCom1BlockHeight | undefined;
276
+ /**
277
+ * block where balance was computed
278
+ */
279
+ block_id: PbCom1Hash | undefined;
280
+ /**
281
+ * Pagination cursor for fetching the next page in a paginated view.
282
+ * When empty, there are no further results for this snapshot.
283
+ */
284
+ page: PbCom1PageResponse | undefined;
285
+ }
286
+
287
+ export interface PbCom1Wire {
288
+ /**
289
+ * e.g., \"http\", \"file\", \"wallet\", \"grpc\
290
+ */
291
+ source: string;
292
+ /**
293
+ * wire format version
294
+ */
295
+ version: number;
296
+ /**
297
+ * operation-specific tags
298
+ */
299
+ tags: PbCom1WireTag[];
300
+ }
301
+
302
+ /**
303
+ * pub struct F6lt(pub \\[Belt; 6\\]);
304
+ */
305
+ export interface PbCom1SixBelt {
306
+ belt_1: PbCom1Belt | undefined;
307
+ belt_2: PbCom1Belt | undefined;
308
+ belt_3: PbCom1Belt | undefined;
309
+ belt_4: PbCom1Belt | undefined;
310
+ belt_5: PbCom1Belt | undefined;
311
+ belt_6: PbCom1Belt | undefined;
312
+ }
313
+
314
+ export interface PbCom1OutputSource {
315
+ source: PbCom1Source | undefined;
316
+ }
317
+
318
+ export interface PbCom1Acknowledged {}
319
+
320
+ /**
321
+ * pub struct SchnorrPubkey(pub CheetahPoint);
322
+ */
323
+ export interface PbCom1SchnorrPubkey {
324
+ value: PbCom1CheetahPoint | undefined;
325
+ }
326
+
327
+ export interface PbCom1Base58Hash {
328
+ hash: string;
329
+ }
330
+
331
+ /**
332
+ * pub struct CheetahPoint {
333
+ * pub x: F6lt,
334
+ * pub y: F6lt,
335
+ * pub inf: bool,
336
+ * }
337
+ */
338
+ export interface PbCom1CheetahPoint {
339
+ x: PbCom1SixBelt | undefined;
340
+ y: PbCom1SixBelt | undefined;
341
+ inf: boolean;
342
+ }
343
+
344
+ /**
345
+ * pub struct Hash(pub \\[Belt; 5\\]);
346
+ * Use fixed fields to avoid variable-length vectors.
347
+ */
348
+ export interface PbCom1Hash {
349
+ belt_1: PbCom1Belt | undefined;
350
+ belt_2: PbCom1Belt | undefined;
351
+ belt_3: PbCom1Belt | undefined;
352
+ belt_4: PbCom1Belt | undefined;
353
+ belt_5: PbCom1Belt | undefined;
354
+ }
355
+
356
+ export interface PbCom1Name {
357
+ /**
358
+ * First is the hash of whether the note has a timelock and the lock
359
+ */
360
+ first: string;
361
+ /**
362
+ * Last is the hash of the actual timelock and the source
363
+ */
364
+ last: string;
365
+ }
366
+
367
+ export interface PbCom1Seed {
368
+ output_source: PbCom1OutputSource | undefined;
369
+ recipient: PbCom1Lock | undefined;
370
+ timelock_intent: PbCom1TimeLockIntent | undefined;
371
+ gift: PbCom1Nicks | undefined;
372
+ parent_hash: string;
373
+ }
374
+
375
+ export interface PbCom1Nicks {
376
+ value: string;
377
+ }
378
+
379
+ export interface PbCom1Spend {
380
+ signature: PbCom1Signature | undefined;
381
+ seeds: PbCom1Seed[];
382
+ miner_fee_nicks: PbCom1Nicks | undefined;
383
+ }
384
+
385
+ export type PbCom1ErrorCode = "Unspecified" | "InvalidRequest" | "PeekFailed" | "PeekReturnedNoData" | "PokeFailed" | "NackappError" | "Timeout" | "InternalError" | "NotFound" | "PermissionDenied" | "InvalidWire" | "KernelError";
386
+
387
+ /**
388
+ * the string key is the name of the input
389
+ * message RawTransaction { map<Name, Input> inputs = 1; }
390
+ */
391
+ export interface PbCom1RawTransaction {
392
+ named_inputs: PbCom1NamedInput[];
393
+ timelock_range: PbCom1TimeLockRangeAbsolute | undefined;
394
+ total_fees: PbCom1Nicks | undefined;
395
+ id: string;
396
+ }
397
+
398
+ export interface PbCom2SpendCondition {
399
+ primitives: PbCom2LockPrimitive[];
400
+ }
401
+
402
+ export interface PbCom2Seed {
403
+ /**
404
+ * Absent when the seed originates from a coinbase output.
405
+ */
406
+ output_source: PbCom1Source | undefined;
407
+ lock_root: string;
408
+ note_data: PbCom2NoteData | undefined;
409
+ gift: PbCom1Nicks | undefined;
410
+ parent_hash: string;
411
+ }
412
+
413
+ export interface PbCom2MerkleProof {
414
+ root: string;
415
+ path: string[];
416
+ }
417
+
418
+ export interface PbCom2PkhSignatureEntry {
419
+ hash: string;
420
+ pubkey: PbCom1SchnorrPubkey | undefined;
421
+ signature: PbCom1SchnorrSignature | undefined;
422
+ }
423
+
424
+ export interface PbCom2SpendEntry {
425
+ name: PbCom1Name | undefined;
426
+ spend: PbCom2Spend | undefined;
427
+ }
428
+
429
+ export interface PbCom2BalanceEntry {
430
+ name: PbCom1Name | undefined;
431
+ note: PbCom2Note | undefined;
432
+ }
433
+
434
+ export interface PbCom2LockMerkleProof {
435
+ spend_condition: PbCom2SpendCondition | undefined;
436
+ axis: number;
437
+ proof: PbCom2MerkleProof | undefined;
438
+ }
439
+
440
+ export interface PbCom2WitnessSpend {
441
+ witness: PbCom2Witness | undefined;
442
+ seeds: PbCom2Seed[];
443
+ fee: PbCom1Nicks | undefined;
444
+ }
445
+
446
+ export interface PbCom2Spend {
447
+ spend_kind: PbCom2SpendSpendKind | undefined;
448
+ }
449
+
450
+ export interface PbCom2NoteDataEntry {
451
+ key: string;
452
+ /**
453
+ * jammed noun bytes
454
+ */
455
+ blob: number[];
456
+ }
457
+
458
+ export interface PbCom2LockTim {
459
+ rel: PbCom1TimeLockRangeRelative | undefined;
460
+ abs: PbCom1TimeLockRangeAbsolute | undefined;
461
+ }
462
+
463
+ export interface PbCom2HaxLock {
464
+ hashes: PbCom1Hash[];
465
+ }
466
+
467
+ export interface PbCom2HaxPreimage {
468
+ hash: PbCom1Hash | undefined;
469
+ /**
470
+ * jammed noun bytes
471
+ */
472
+ value: number[];
473
+ }
474
+
475
+ export interface PbCom2BurnLock {}
476
+
477
+ export interface PbCom2PkhSignature {
478
+ entries: PbCom2PkhSignatureEntry[];
479
+ }
480
+
481
+ export interface PbCom2RawTransaction {
482
+ version: PbCom1NoteVersion | undefined;
483
+ id: string;
484
+ spends: PbCom2SpendEntry[];
485
+ }
486
+
487
+ export interface PbCom2Note {
488
+ note_version: PbCom2NoteNoteVersion | undefined;
489
+ }
490
+
491
+ export interface PbCom2NoteV1 {
492
+ version: PbCom1NoteVersion | undefined;
493
+ origin_page: PbCom1BlockHeight | undefined;
494
+ name: PbCom1Name | undefined;
495
+ note_data: PbCom2NoteData | undefined;
496
+ assets: PbCom1Nicks | undefined;
497
+ }
498
+
499
+ export interface PbCom2Balance {
500
+ notes: PbCom2BalanceEntry[];
501
+ height: PbCom1BlockHeight | undefined;
502
+ block_id: string;
503
+ page: PbCom1PageResponse | undefined;
504
+ }
505
+
506
+ export interface PbCom2NoteData {
507
+ entries: PbCom2NoteDataEntry[];
508
+ }
509
+
510
+ export interface PbCom2Witness {
511
+ lock_merkle_proof: PbCom2LockMerkleProof | undefined;
512
+ pkh_signature: PbCom2PkhSignature | undefined;
513
+ /**
514
+ * uint64 tim = 4; // reserved field, currently 0
515
+ */
516
+ hax: PbCom2HaxPreimage[];
517
+ }
518
+
519
+ export interface PbCom2PkhLock {
520
+ m: number;
521
+ hashes: string[];
522
+ }
523
+
524
+ export interface PbCom2LegacySpend {
525
+ signature: PbCom1Signature | undefined;
526
+ seeds: PbCom2Seed[];
527
+ fee: PbCom1Nicks | undefined;
528
+ }
529
+
530
+ export interface PbCom2LockPrimitive {
531
+ primitive: PbCom2LockPrimitivePrimitive | undefined;
532
+ }
533
+
534
+ export type PbPub2WalletGetBalanceRequestSelector = { Address: PbCom1Base58Pubkey } | { FirstName: PbCom1Base58Hash };
535
+
536
+ export type PbCom1TimeLockIntentValue = { Absolute: PbCom1TimeLockRangeAbsolute } | { Relative: PbCom1TimeLockRangeRelative } | { AbsoluteAndRelative: PbCom1TimeLockRangeAbsoluteAndRelative } | { Neither: PbCom1TimeLockRangeNeither };
537
+
538
+ export type PbCom2LockPrimitivePrimitive = { Pkh: PbCom2PkhLock } | { Tim: PbCom2LockTim } | { Hax: PbCom2HaxLock } | { Burn: PbCom2BurnLock };
539
+
540
+ export type PbCom2SpendSpendKind = { Legacy: PbCom2LegacySpend } | { Witness: PbCom2WitnessSpend };
541
+
542
+ export type PbCom2NoteNoteVersion = { Legacy: PbCom1Note } | { V1: PbCom2NoteV1 };
543
+
544
+ export type PbCom1WireTagValue = { Text: string } | { Number: number };
545
+
546
+ export interface PbPub2WalletGetBalanceResponse {
547
+ result: PbPub2WalletGetBalanceResponseResult | undefined;
548
+ }
549
+
550
+ export interface PbPub2TransactionAcceptedResponse {
551
+ result: PbPub2TransactionAcceptedResponseResult | undefined;
552
+ }
553
+
554
+ export interface PbPub2TransactionAcceptedRequest {
555
+ tx_id: PbCom1Base58Hash | undefined;
556
+ }
557
+
558
+ export interface PbPub2WalletSendTransactionResponse {
559
+ result: PbPub2WalletSendTransactionResponseResult | undefined;
560
+ }
561
+
562
+ export interface PbPub2WalletSendTransactionRequest {
563
+ tx_id: PbCom1Hash | undefined;
564
+ raw_tx: PbCom2RawTransaction | undefined;
565
+ }
566
+
567
+ export interface PbPub2WalletGetBalanceRequest {
568
+ page: PbCom1PageRequest | undefined;
569
+ selector: PbPub2WalletGetBalanceRequestSelector | undefined;
570
+ }
571
+
572
+ export type PbPub2TransactionAcceptedResponseResult = { Accepted: boolean } | { Error: PbCom1ErrorStatus };
573
+
574
+ export type PbPub2WalletGetBalanceResponseResult = { Balance: PbCom2Balance } | { Error: PbCom1ErrorStatus };
575
+
576
+ export type PbPub2WalletSendTransactionResponseResult = { Ack: PbCom1Acknowledged } | { Error: PbCom1ErrorStatus };
577
+
578
+ export type NoteData = ZMap<string, Noun>;
579
+
580
+ export type Hax = ZSet<Digest>;
581
+
582
+ export type SpendsV1 = ZMap<Name, SpendV1>;
583
+
584
+ export type SpendCondition = LockPrimitive[];
585
+
586
+ export interface Pkh {
587
+ m: number;
588
+ hashes: ZSet<Digest>;
589
+ }
590
+
591
+ export interface Witness {
592
+ lock_merkle_proof: LockMerkleProof;
593
+ pkh_signature: PkhSignature;
594
+ hax_map: ZMap<Digest, Noun>;
595
+ tim: undefined;
596
+ }
597
+
598
+ export interface LockMetadata {
599
+ lock: SpendCondition;
600
+ include_data: boolean;
601
+ }
602
+
603
+ export interface Spend0V1 {
604
+ signature: LegacySignature;
605
+ seeds: SeedsV1;
606
+ fee: Nicks;
607
+ }
608
+
609
+ export interface WitnessData {
610
+ data: ZMap<Name, Witness>;
611
+ }
612
+
613
+ export type LockPrimitive = { Pkh: Pkh } | { Tim: LockTim } | { Hax: Hax } | "Brn";
614
+
615
+ export interface LockMerkleProof {
616
+ spend_condition: SpendCondition;
617
+ axis: number;
618
+ proof: MerkleProof;
44
619
  }
620
+
621
+ export interface Spend1V1 {
622
+ witness: Witness;
623
+ seeds: SeedsV1;
624
+ fee: Nicks;
625
+ }
626
+
627
+ export interface NockchainTx {
628
+ version: Version;
629
+ id: TxId;
630
+ spends: SpendsV1;
631
+ display: TransactionDisplay;
632
+ witness_data: WitnessData;
633
+ }
634
+
635
+ export type LockRoot = { Hash: Digest } | { Lock: SpendCondition };
636
+
637
+ export type SeedsV1 = ZSet<SeedV1>;
638
+
639
+ export interface MerkleProof {
640
+ root: Digest;
641
+ path: Digest[];
642
+ }
643
+
644
+ export type PkhSignature = ZMap<Digest, [PublicKey, Signature]>;
645
+
646
+ export interface NoteV1 {
647
+ version: Version;
648
+ origin_page: BlockHeight;
649
+ name: Name;
650
+ note_data: NoteData;
651
+ assets: Nicks;
652
+ }
653
+
654
+ export interface RawTxV1 {
655
+ version: 1;
656
+ id: TxId;
657
+ spends: SpendsV1;
658
+ }
659
+
660
+ export type SpendV1 = { version: 0; spend: Spend0V1 } | { version: 1; spend: Spend1V1 };
661
+
662
+ export type InputDisplay = { version: 0; p: ZMap<Name, Sig> } | { version: 1; p: ZMap<Name, SpendCondition> };
663
+
664
+ export interface SeedV1 {
665
+ output_source: Source | undefined;
666
+ lock_root: LockRoot;
667
+ note_data: NoteData;
668
+ gift: Nicks;
669
+ parent_hash: Digest;
670
+ }
671
+
672
+ export interface TransactionDisplay {
673
+ inputs: InputDisplay;
674
+ outputs: ZMap<Digest, LockMetadata>;
675
+ }
676
+
677
+ export type MissingUnlocks = { Pkh: { num_sigs: number; sig_of: Digest[] } } | { Hax: { preimages_for: Digest[] } } | "Brn" | { Sig: { num_sigs: number; sig_of: PublicKey[] } };
678
+
679
+ export type Balance = [Name, Note][];
680
+
681
+ export interface BalanceUpdate {
682
+ height: BlockHeight;
683
+ block_id: Digest;
684
+ notes: Balance;
685
+ }
686
+
687
+ export type Version = 0 | 1 | 2;
688
+
689
+ /**
690
+ * Timelock range (for both absolute and relative constraints)
691
+ */
692
+ export interface TimelockRange {
693
+ min: BlockHeight | undefined;
694
+ max: BlockHeight | undefined;
695
+ }
696
+
697
+ /**
698
+ * 64-bit unsigned integer representing the number of assets.
699
+ */
700
+ export type Nicks = string;
701
+
702
+ export interface Source {
703
+ hash: Digest;
704
+ is_coinbase: boolean;
705
+ }
706
+
707
+ export interface Name {
708
+ first: Digest;
709
+ last: Digest;
710
+ _sig: number;
711
+ }
712
+
713
+ export type Note = NoteV0 | NoteV1;
714
+
715
+ export interface Sig {
716
+ m: number;
717
+ pubkeys: ZSet<PublicKey>;
718
+ }
719
+
720
+ export interface RawTxV0 {
721
+ id: TxId;
722
+ inputs: Inputs;
723
+ timelock_range: TimelockRange;
724
+ total_fees: Nicks;
725
+ }
726
+
727
+ export interface Timelock {
728
+ rel: TimelockRange;
729
+ abs: TimelockRange;
730
+ }
731
+
732
+ export type Inputs = ZMap<Name, Input>;
733
+
734
+ export type SeedsV0 = ZSet<SeedV0>;
735
+
736
+ export interface NoteV0 {
737
+ inner: NoteInner;
738
+ name: Name;
739
+ sig: Sig;
740
+ source: Source;
741
+ assets: Nicks;
742
+ }
743
+
744
+ export interface SeedV0 {
745
+ output_source: Source | undefined;
746
+ recipient: Sig;
747
+ timelock_intent: TimelockIntent;
748
+ gift: Nicks;
749
+ parent_hash: Digest;
750
+ }
751
+
752
+ export interface Input {
753
+ note: NoteV0;
754
+ spend: SpendV0;
755
+ }
756
+
757
+ export interface SpendV0 {
758
+ signature: LegacySignature | undefined;
759
+ seeds: SeedsV0;
760
+ fee: Nicks;
761
+ }
762
+
763
+ export interface NoteInner {
764
+ version: Version;
765
+ origin_page: BlockHeight;
766
+ timelock: TimelockIntent;
767
+ }
768
+
769
+ export type LegacySignature = ZMap<PublicKey, Signature>;
770
+
771
+ export interface TimelockIntent {
772
+ tim: Timelock | undefined;
773
+ }
774
+
775
+ export type RawTx = RawTxV0 | RawTxV1;
776
+
777
+ export interface Signature {
778
+ c: Uint8Array;
779
+ s: Uint8Array;
780
+ }
781
+
782
+ export type PublicKey = CheetahPoint;
783
+
784
+ export type Noun = string | [Noun];
785
+
786
+ export type CheetahPoint = string;
787
+
788
+ export type Digest = string;
789
+
790
+ export type ZBase<E> = E[];
791
+
792
+ export type ZMap<K, V> = ZBase<ZMapEntry<K, V>>;
793
+
794
+ export type ZMapEntry<K, V> = [K, V];
795
+
796
+ export type ZSet<T> = ZBase<ZSetEntry<T>>;
797
+
798
+ export type ZSetEntry<T> = T;
799
+
45
800
  export class ExtendedKey {
46
801
  private constructor();
47
802
  free(): void;
@@ -60,7 +815,7 @@ export class GrpcClient {
60
815
  /**
61
816
  * Send a transaction
62
817
  */
63
- sendTransaction(raw_tx: any): Promise<any>;
818
+ sendTransaction(raw_tx: PbCom2RawTransaction): Promise<string>;
64
819
  /**
65
820
  * Check if a transaction was accepted
66
821
  */
@@ -68,19 +823,13 @@ export class GrpcClient {
68
823
  /**
69
824
  * Get balance for a wallet address
70
825
  */
71
- getBalanceByAddress(address: string): Promise<any>;
826
+ getBalanceByAddress(address: string): Promise<PbCom2Balance>;
72
827
  /**
73
828
  * Get balance for a first name
74
829
  */
75
- getBalanceByFirstName(first_name: string): Promise<any>;
830
+ getBalanceByFirstName(first_name: string): Promise<PbCom2Balance>;
76
831
  constructor(endpoint: string);
77
832
  }
78
- export class Hax {
79
- free(): void;
80
- [Symbol.dispose](): void;
81
- constructor(digests: Digest[]);
82
- readonly digests: Digest[];
83
- }
84
833
  export class IntoUnderlyingByteSource {
85
834
  private constructor();
86
835
  free(): void;
@@ -106,538 +855,110 @@ export class IntoUnderlyingSource {
106
855
  pull(controller: ReadableStreamDefaultController): Promise<any>;
107
856
  cancel(): void;
108
857
  }
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
- constructor(version: Version, origin_page: bigint, name: Name, note_data: NoteData, assets: bigint);
176
- hash(): Digest;
177
- readonly originPage: bigint;
178
- readonly name: Name;
179
- readonly assets: bigint;
180
- readonly version: Version;
181
- readonly noteData: NoteData;
182
- }
183
- export class NoteData {
184
- free(): void;
185
- [Symbol.dispose](): void;
186
- toProtobuf(): any;
187
- static fromProtobuf(value: any): NoteData;
188
- constructor(entries: NoteDataEntry[]);
189
- static empty(): NoteData;
190
- static fromPkh(pkh: Pkh): NoteData;
191
- readonly entries: NoteDataEntry[];
192
- }
193
- export class NoteDataEntry {
194
- free(): void;
195
- [Symbol.dispose](): void;
196
- toProtobuf(): any;
197
- static fromProtobuf(value: any): NoteDataEntry;
198
- constructor(key: string, blob: Uint8Array);
199
- readonly key: string;
200
- readonly blob: Uint8Array;
201
- }
202
- export class Noun {
203
- private constructor();
204
- free(): void;
205
- [Symbol.dispose](): void;
206
- static cue(jam: Uint8Array): Noun;
207
- jam(): Uint8Array;
208
- static fromJs(value: any): Noun;
209
- toJs(): any;
210
- }
211
- export class Pkh {
212
- free(): void;
213
- [Symbol.dispose](): void;
214
- toProtobuf(): any;
215
- static fromProtobuf(value: any): Pkh;
216
- constructor(m: bigint, hashes: string[]);
217
- static single(hash: string): Pkh;
218
- readonly m: bigint;
219
- readonly hashes: string[];
220
- }
221
- export class RawTx {
222
- private constructor();
223
- free(): void;
224
- [Symbol.dispose](): void;
225
- /**
226
- * Convert to protobuf RawTransaction for sending via gRPC
227
- */
228
- toProtobuf(): any;
229
- static fromProtobuf(value: any): RawTx;
230
- toNockchainTx(): NockchainTx;
231
- /**
232
- * Convert to jammed transaction file for inspecting through CLI
233
- */
234
- toJam(): Uint8Array;
235
- /**
236
- * Calculate output notes from the transaction spends.
237
- */
238
- outputs(): Note[];
239
- static fromJam(jam: Uint8Array): RawTx;
240
- readonly id: Digest;
241
- readonly name: string;
242
- readonly version: Version;
243
- }
244
- export class Seed {
245
- free(): void;
246
- [Symbol.dispose](): void;
247
- static newSinglePkh(pkh: Digest, gift: bigint, parent_hash: Digest, include_lock_data: boolean): Seed;
248
- constructor(output_source: Source | null | undefined, lock_root: LockRoot, gift: bigint, note_data: NoteData, parent_hash: Digest);
249
- parentHash: Digest;
250
- get outputSource(): Source | undefined;
251
- set outputSource(value: Source | null | undefined);
252
- lockRoot: LockRoot;
253
- noteData: NoteData;
254
- gift: bigint;
255
- }
256
- export class Signature {
257
- free(): void;
258
- [Symbol.dispose](): void;
259
- constructor(c: Uint8Array, s: Uint8Array);
260
- readonly c: Uint8Array;
261
- readonly s: Uint8Array;
262
- }
263
- export class Source {
264
- private constructor();
265
- free(): void;
266
- [Symbol.dispose](): void;
267
- readonly isCoinbase: boolean;
268
- readonly hash: Digest;
269
- }
270
858
  export class SpendBuilder {
271
859
  free(): void;
272
860
  [Symbol.dispose](): void;
273
- /**
274
- * Get current refund
275
- */
276
- curRefund(): Seed | undefined;
277
- /**
278
- * Checks whether note.assets = seeds + fee
279
- *
280
- * This function needs to return true for `TxBuilder::validate` to pass
281
- */
861
+ curRefund(): SeedV1 | undefined;
282
862
  isBalanced(): boolean;
283
- /**
284
- * Attatch a preimage to this spend
285
- */
286
863
  addPreimage(preimage_jam: Uint8Array): Digest | undefined;
287
- /**
288
- * Compute refund from any spare assets, given `refund_lock` was passed
289
- */
290
864
  computeRefund(include_lock_data: boolean): void;
291
- /**
292
- * Manually invalidate signatures
293
- *
294
- * Each spend's fee+seeds are bound to one or more signatures. If they get changed, the
295
- * signature becomes invalid. This builder automatically invalidates signatures upon relevant
296
- * modifications, but this functionality is provided nonetheless.
297
- */
298
865
  invalidateSigs(): void;
299
- /**
300
- * Get the list of missing "unlocks"
301
- *
302
- * An unlock is a spend condition to be satisfied. For instance, for a `Pkh` spend condition,
303
- * if the transaction is unsigned, this function will return a Pkh type missing unlock, with
304
- * the list of valid PKH's and number of signatures needed. This will not return PKHs that are
305
- * already attatched to the spend (relevant for multisigs). For `Hax` spend condition, this
306
- * will return any missing preimages. This function will return a list of not-yet-validated
307
- * spend conditions.
308
- */
309
- missingUnlocks(): any[];
310
- /**
311
- * Set the fee of this spend
312
- */
313
- fee(fee: bigint): void;
866
+ missingUnlocks(): MissingUnlocks[];
867
+ fee(fee: Nicks): void;
314
868
  /**
315
869
  * Create a new `SpendBuilder` with a given note and spend condition
316
870
  */
317
- constructor(note: Note, spend_condition: SpendCondition, refund_lock?: SpendCondition | null);
318
- /**
319
- * Add seed to this spend
320
- *
321
- * Seed is an output with a recipient (as defined by the spend condition).
322
- *
323
- * Nockchain transaction engine will take all seeds with matching lock from all spends in the
324
- * transaction, and merge them into one output note.
325
- */
326
- seed(seed: Seed): void;
327
- /**
328
- * Sign the transaction with a given private key
329
- */
871
+ constructor(note: Note, spend_condition?: SpendCondition | null, refund_lock?: SpendCondition | null);
872
+ seed(seed: SeedV1): void;
330
873
  sign(signing_key_bytes: Uint8Array): boolean;
331
874
  }
332
- export class SpendCondition {
333
- free(): void;
334
- [Symbol.dispose](): void;
335
- firstName(): Digest;
336
- toProtobuf(): any;
337
- static fromProtobuf(value: any): SpendCondition;
338
- constructor(primitives: LockPrimitive[]);
339
- hash(): Digest;
340
- static newPkh(pkh: Pkh): SpendCondition;
341
- }
342
- export class TimelockRange {
343
- free(): void;
344
- [Symbol.dispose](): void;
345
- constructor(min?: bigint | null, max?: bigint | null);
346
- readonly max: bigint | undefined;
347
- readonly min: bigint | undefined;
348
- }
349
875
  export class TxBuilder {
350
876
  free(): void;
351
877
  [Symbol.dispose](): void;
352
878
  allSpends(): SpendBuilder[];
353
- /**
354
- * Appends `preimage_jam` to all spend conditions that expect this preimage.
355
- */
356
879
  addPreimage(preimage_jam: Uint8Array): Digest | undefined;
357
- /**
358
- * Perform a simple-spend on this builder.
359
- *
360
- * It is HIGHLY recommended to not mix `simpleSpend` with other types of spends.
361
- *
362
- * This performs a fairly complex set of operations, in order to mimic behavior of nockchain
363
- * CLI wallet's create-tx option. Note that we do not do 1-1 mapping of that functionality,
364
- * most notably - if `recipient` is the same as `refund_pkh`, we will create 1 seed, while the
365
- * CLI wallet will create 2.
366
- *
367
- * Another difference is that you should call `sign` and `validate` after calling this method.
368
- *
369
- * Internally, the transaction builder takes ALL of the `notes` provided, and stores them for
370
- * fee adjustments. If there are multiple notes being used, our fee setup also differs from
371
- * the CLI, because we first greedily spend the notes out, and then take fees from any
372
- * remaining refunds.
373
- *
374
- * This function prioritizes using the least number of notes possible, because that lowers the
375
- * fee used.
376
- *
377
- * You may choose to override the fee with `fee_override`, but do note that `validate` will
378
- * fail, in case this fee is too small.
379
- *
380
- * `include_lock_data` can be used to include `%lock` key in note-data, with the
381
- * `SpendCondition` used. However, note-data costs 1 << 15 nicks, which means, it can get
382
- * expensive.
383
- *
384
- * Optional parameter `remove_unused_notes`, if set to false, will keep the notes in the
385
- * transaction builder. This is meant to be used whenever additional operations are performed
386
- * on the builder, such as additional spends, or `addPreimage` calls. All of these increase
387
- * the required fee (which can be checked with `calcFee`), and unused notes can then be used
388
- * to adjust fees with `setFeeAndBalanceRefund` or `recalcAndSetFee`. Once all operations are
389
- * done, one should call `removeUnusedNotes` to ensure these notes are not used within the
390
- * transaction.
391
- */
392
- simpleSpend(notes: Note[], spend_conditions: SpendCondition[], recipient: Digest, gift: bigint, fee_override: bigint | null | undefined, refund_pkh: Digest, include_lock_data: boolean): void;
393
- /**
394
- * Recalculate fee and set it, balancing things out with refunds
395
- */
880
+ simpleSpend(notes: Note[], spend_conditions: SpendCondition[], recipient: Digest, gift: Nicks, fee_override: Nicks | null | undefined, refund_pkh: Digest, include_lock_data: boolean): void;
396
881
  recalcAndSetFee(include_lock_data: boolean): void;
397
- /**
398
- * Distributes `fee` across builder's spends, and balances refunds out
399
- *
400
- * `adjust_fee` parameter allows the fee to be slightly tweaked, whenever notes are added or
401
- * removed to/from the builder's fee note pool. This is because using more or less notes
402
- * impacts the exact fee being required. If the caller estimates fee and sets it, adding more
403
- * notes will change the exact fee needed, and setting this parameter to true will allow one
404
- * to not have to call this function multiple times.
405
- */
406
- setFeeAndBalanceRefund(fee: bigint, adjust_fee: boolean, include_lock_data: boolean): void;
882
+ setFeeAndBalanceRefund(fee: Nicks, adjust_fee: boolean, include_lock_data: boolean): void;
407
883
  /**
408
884
  * Create an empty transaction builder
409
885
  */
410
- constructor(fee_per_word: bigint);
411
- /**
412
- * Sign the transaction with a private key.
413
- *
414
- * This will sign all spends that are still missing signature from
415
- */
886
+ constructor(fee_per_word: Nicks);
416
887
  sign(signing_key_bytes: Uint8Array): void;
417
888
  build(): NockchainTx;
418
889
  /**
419
890
  * Append a `SpendBuilder` to this transaction
420
891
  */
421
892
  spend(spend: SpendBuilder): SpendBuilder | undefined;
422
- /**
423
- * Gets the current fee set on all spends.
424
- */
425
- curFee(): bigint;
893
+ curFee(): Nicks;
426
894
  /**
427
895
  * Reconstruct a builder from raw transaction and its input notes.
428
- *
429
- * To get the builder back, you must pass the notes and their corresponding spend conditions.
430
- * If serializing the builder, call `WasmTxBuilder::all_notes`.
431
896
  */
432
897
  static fromTx(tx: RawTx, notes: Note[], spend_conditions: SpendCondition[]): TxBuilder;
433
- /**
434
- * Calculates the fee needed for the transaction.
435
- *
436
- * NOTE: if the transaction is unsigned, this function will estimate the fee needed, supposing
437
- * all signatures are added. However, this heuristic is only accurate for one signature. In
438
- * addition, this fee calculation does not estimate the size of missing preimages.
439
- *
440
- * So, first, add missing preimages, and only then calc the fee. If you're building a multisig
441
- * transaction, this value might be incorrect.
442
- */
443
- calcFee(): bigint;
444
- /**
445
- * Validate the transaction.
446
- */
898
+ calcFee(): Nicks;
447
899
  validate(): void;
448
900
  allNotes(): TxNotes;
449
901
  }
450
- export class TxNotes {
451
- private constructor();
452
- free(): void;
453
- [Symbol.dispose](): void;
454
- readonly spendConditions: SpendCondition[];
455
- readonly notes: Note[];
456
- }
457
- export class Version {
458
- free(): void;
459
- [Symbol.dispose](): void;
460
- static V0(): Version;
461
- static V1(): Version;
462
- static V2(): Version;
463
- constructor(version: number);
464
- }
465
902
 
466
903
  export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
467
904
 
468
905
  export interface InitOutput {
469
906
  readonly memory: WebAssembly.Memory;
470
- readonly __wbg_digest_free: (a: number, b: number) => void;
471
- readonly __wbg_hax_free: (a: number, b: number) => void;
472
- readonly __wbg_lockprimitive_free: (a: number, b: number) => void;
473
- readonly __wbg_lockroot_free: (a: number, b: number) => void;
474
- readonly __wbg_locktim_free: (a: number, b: number) => void;
475
- readonly __wbg_name_free: (a: number, b: number) => void;
476
- readonly __wbg_nockchaintx_free: (a: number, b: number) => void;
477
- readonly __wbg_note_free: (a: number, b: number) => void;
478
- readonly __wbg_notedata_free: (a: number, b: number) => void;
479
- readonly __wbg_notedataentry_free: (a: number, b: number) => void;
480
- readonly __wbg_pkh_free: (a: number, b: number) => void;
481
- readonly __wbg_rawtx_free: (a: number, b: number) => void;
482
- readonly __wbg_seed_free: (a: number, b: number) => void;
483
- readonly __wbg_source_free: (a: number, b: number) => void;
907
+ readonly __wbg_extendedkey_free: (a: number, b: number) => void;
908
+ readonly __wbg_grpcclient_free: (a: number, b: number) => void;
909
+ readonly deriveMasterKey: (a: number, b: number) => number;
910
+ readonly deriveMasterKeyFromMnemonic: (a: number, b: number, c: number, d: number) => [number, number, number];
911
+ readonly extendedkey_chainCode: (a: number) => [number, number];
912
+ readonly extendedkey_deriveChild: (a: number, b: number) => [number, number, number];
913
+ readonly extendedkey_privateKey: (a: number) => [number, number];
914
+ readonly extendedkey_publicKey: (a: number) => [number, number];
915
+ readonly grpcclient_getBalanceByAddress: (a: number, b: number, c: number) => any;
916
+ readonly grpcclient_getBalanceByFirstName: (a: number, b: number, c: number) => any;
917
+ readonly grpcclient_new: (a: number, b: number) => number;
918
+ readonly grpcclient_sendTransaction: (a: number, b: any) => any;
919
+ readonly grpcclient_transactionAccepted: (a: number, b: number, c: number) => any;
920
+ readonly hashNoun: (a: number, b: number) => [number, number, number, number];
921
+ readonly hashPublicKey: (a: number, b: number) => [number, number, number, number];
922
+ readonly hashU64: (a: bigint) => [number, number];
923
+ readonly signMessage: (a: number, b: number, c: number, d: number) => [number, number, number];
924
+ readonly verifySignature: (a: number, b: number, c: any, d: number, e: number) => [number, number, number];
925
+ readonly cue: (a: number, b: number) => [number, number, number];
926
+ readonly jam: (a: any) => [number, number, number, number];
484
927
  readonly __wbg_spendbuilder_free: (a: number, b: number) => void;
485
- readonly __wbg_spendcondition_free: (a: number, b: number) => void;
486
- readonly __wbg_timelockrange_free: (a: number, b: number) => void;
487
928
  readonly __wbg_txbuilder_free: (a: number, b: number) => void;
488
- readonly __wbg_txnotes_free: (a: number, b: number) => void;
489
- readonly __wbg_version_free: (a: number, b: number) => void;
490
- readonly digest_fromProtobuf: (a: any) => [number, number, number];
491
- readonly digest_new: (a: number, b: number) => number;
492
- readonly digest_toProtobuf: (a: number) => [number, number, number];
493
- readonly digest_value: (a: number) => [number, number];
494
- readonly hax_digests: (a: number) => [number, number];
495
- readonly hax_new: (a: number, b: number) => number;
496
- readonly lockprimitive_fromProtobuf: (a: any) => [number, number, number];
497
- readonly lockprimitive_newBrn: () => number;
498
- readonly lockprimitive_newHax: (a: number) => number;
499
- readonly lockprimitive_newPkh: (a: number) => number;
500
- readonly lockprimitive_newTim: (a: number) => number;
501
- readonly lockprimitive_toProtobuf: (a: number) => [number, number, number];
502
- readonly lockroot_fromHash: (a: number) => [number, number, number];
503
- readonly lockroot_fromSpendCondition: (a: number) => [number, number, number];
504
- readonly lockroot_hash: (a: number) => number;
505
- readonly lockroot_lock: (a: number) => number;
506
- readonly locktim_abs: (a: number) => number;
507
- readonly locktim_coinbase: () => number;
508
- readonly locktim_fromProtobuf: (a: any) => [number, number, number];
509
- readonly locktim_new: (a: number, b: number) => number;
510
- readonly locktim_rel: (a: number) => number;
511
- readonly locktim_toProtobuf: (a: number) => [number, number, number];
512
- readonly name_first: (a: number) => [number, number];
513
- readonly name_fromProtobuf: (a: any) => [number, number, number];
514
- readonly name_last: (a: number) => [number, number];
515
- readonly name_new: (a: number, b: number, c: number, d: number) => [number, number, number];
516
- readonly name_toProtobuf: (a: number) => [number, number, number];
517
- readonly nockchaintx_fromJam: (a: number, b: number) => [number, number, number];
518
- readonly nockchaintx_id: (a: number) => number;
519
- readonly nockchaintx_name: (a: number) => [number, number];
520
- readonly nockchaintx_outputs: (a: number) => [number, number];
521
- readonly nockchaintx_toJam: (a: number) => any;
522
- readonly nockchaintx_toRawTx: (a: number) => number;
523
- readonly nockchaintx_version: (a: number) => number;
524
- readonly note_assets: (a: number) => bigint;
525
- readonly note_fromProtobuf: (a: any) => [number, number, number];
526
- readonly note_hash: (a: number) => [number, number, number];
527
- readonly note_name: (a: number) => number;
528
- readonly note_new: (a: number, b: bigint, c: number, d: number, e: bigint) => number;
529
- readonly note_noteData: (a: number) => number;
530
- readonly note_originPage: (a: number) => bigint;
531
- readonly note_toProtobuf: (a: number) => [number, number, number];
532
- readonly note_version: (a: number) => number;
533
- readonly notedata_empty: () => number;
534
- readonly notedata_entries: (a: number) => [number, number];
535
- readonly notedata_fromPkh: (a: number) => [number, number, number];
536
- readonly notedata_fromProtobuf: (a: any) => [number, number, number];
537
- readonly notedata_new: (a: number, b: number) => number;
538
- readonly notedata_toProtobuf: (a: number) => [number, number, number];
539
- readonly notedataentry_blob: (a: number) => [number, number];
540
- readonly notedataentry_fromProtobuf: (a: any) => [number, number, number];
541
- readonly notedataentry_key: (a: number) => [number, number];
542
- readonly notedataentry_new: (a: number, b: number, c: number, d: number) => number;
543
- readonly notedataentry_toProtobuf: (a: number) => [number, number, number];
544
- readonly pkh_fromProtobuf: (a: any) => [number, number, number];
545
- readonly pkh_hashes: (a: number) => [number, number];
546
- readonly pkh_m: (a: number) => bigint;
547
- readonly pkh_new: (a: bigint, b: number, c: number) => number;
548
- readonly pkh_single: (a: number, b: number) => number;
549
- readonly pkh_toProtobuf: (a: number) => [number, number, number];
550
- readonly rawtx_fromJam: (a: number, b: number) => [number, number, number];
551
- readonly rawtx_fromProtobuf: (a: any) => [number, number, number];
552
- readonly rawtx_id: (a: number) => number;
553
- readonly rawtx_name: (a: number) => [number, number];
554
- readonly rawtx_outputs: (a: number) => [number, number];
555
- readonly rawtx_toJam: (a: number) => any;
556
- readonly rawtx_toNockchainTx: (a: number) => number;
557
- readonly rawtx_toProtobuf: (a: number) => [number, number, number];
558
- readonly rawtx_version: (a: number) => number;
559
- readonly seed_gift: (a: number) => bigint;
560
- readonly seed_lockRoot: (a: number) => number;
561
- readonly seed_new: (a: number, b: number, c: bigint, d: number, e: number) => number;
562
- readonly seed_newSinglePkh: (a: number, b: bigint, c: number, d: number) => [number, number, number];
563
- readonly seed_noteData: (a: number) => number;
564
- readonly seed_outputSource: (a: number) => number;
565
- readonly seed_parentHash: (a: number) => number;
566
- readonly seed_set_gift: (a: number, b: bigint) => void;
567
- readonly seed_set_lockRoot: (a: number, b: number) => void;
568
- readonly seed_set_noteData: (a: number, b: number) => void;
569
- readonly seed_set_outputSource: (a: number, b: number) => void;
570
- readonly seed_set_parentHash: (a: number, b: number) => void;
571
- readonly source_hash: (a: number) => number;
572
- readonly source_isCoinbase: (a: number) => number;
929
+ readonly create_note_v0: (a: number, b: bigint, c: number, d: number, e: any, f: number, g: number, h: any) => [number, number, number];
930
+ readonly create_note_v1: (a: any, b: number, c: any, d: any, e: any) => [number, number, number];
931
+ readonly digest_from_protobuf: (a: any) => [number, number, number];
932
+ readonly digest_to_hex: (a: any) => [number, number];
933
+ readonly digest_to_protobuf: (a: any) => any;
934
+ readonly hex_to_digest: (a: number, b: number) => [number, number, number];
935
+ readonly note_from_protobuf: (a: any) => [number, number, number];
936
+ readonly note_hash: (a: any) => any;
937
+ readonly note_to_protobuf: (a: any) => any;
573
938
  readonly spendbuilder_addPreimage: (a: number, b: number, c: number) => [number, number, number];
574
939
  readonly spendbuilder_computeRefund: (a: number, b: number) => void;
575
- readonly spendbuilder_curRefund: (a: number) => number;
576
- readonly spendbuilder_fee: (a: number, b: bigint) => void;
940
+ readonly spendbuilder_curRefund: (a: number) => any;
941
+ readonly spendbuilder_fee: (a: number, b: any) => void;
577
942
  readonly spendbuilder_invalidateSigs: (a: number) => void;
578
943
  readonly spendbuilder_isBalanced: (a: number) => number;
579
944
  readonly spendbuilder_missingUnlocks: (a: number) => [number, number, number, number];
580
- readonly spendbuilder_new: (a: number, b: number, c: number) => [number, number, number];
581
- readonly spendbuilder_seed: (a: number, b: number) => [number, number];
945
+ readonly spendbuilder_new: (a: any, b: number, c: number) => [number, number, number];
946
+ readonly spendbuilder_seed: (a: number, b: any) => [number, number];
582
947
  readonly spendbuilder_sign: (a: number, b: number, c: number) => [number, number, number];
583
- readonly spendcondition_firstName: (a: number) => [number, number, number];
584
- readonly spendcondition_fromProtobuf: (a: any) => [number, number, number];
585
- readonly spendcondition_hash: (a: number) => [number, number, number];
586
- readonly spendcondition_new: (a: number, b: number) => number;
587
- readonly spendcondition_newPkh: (a: number) => number;
588
- readonly spendcondition_toProtobuf: (a: number) => [number, number, number];
589
- readonly timelockrange_max: (a: number) => [number, bigint];
590
- readonly timelockrange_min: (a: number) => [number, bigint];
591
- readonly timelockrange_new: (a: number, b: bigint, c: number, d: bigint) => number;
592
948
  readonly txbuilder_addPreimage: (a: number, b: number, c: number) => [number, number, number];
593
- readonly txbuilder_allNotes: (a: number) => number;
949
+ readonly txbuilder_allNotes: (a: number) => [number, number, number];
594
950
  readonly txbuilder_allSpends: (a: number) => [number, number];
595
951
  readonly txbuilder_build: (a: number) => [number, number, number];
596
- readonly txbuilder_calcFee: (a: number) => bigint;
597
- readonly txbuilder_curFee: (a: number) => bigint;
598
- readonly txbuilder_fromTx: (a: number, b: number, c: number, d: number, e: number) => [number, number, number];
599
- readonly txbuilder_new: (a: bigint) => number;
952
+ readonly txbuilder_calcFee: (a: number) => any;
953
+ readonly txbuilder_curFee: (a: number) => any;
954
+ readonly txbuilder_fromTx: (a: any, b: number, c: number, d: number, e: number) => [number, number, number];
955
+ readonly txbuilder_new: (a: any) => number;
600
956
  readonly txbuilder_recalcAndSetFee: (a: number, b: number) => [number, number];
601
- readonly txbuilder_setFeeAndBalanceRefund: (a: number, b: bigint, c: number, d: number) => [number, number];
957
+ readonly txbuilder_setFeeAndBalanceRefund: (a: number, b: any, c: number, d: number) => [number, number];
602
958
  readonly txbuilder_sign: (a: number, b: number, c: number) => [number, number];
603
- 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];
959
+ 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];
604
960
  readonly txbuilder_spend: (a: number, b: number) => number;
605
961
  readonly txbuilder_validate: (a: number) => [number, number];
606
- readonly txnotes_notes: (a: number) => [number, number];
607
- readonly txnotes_spendConditions: (a: number) => [number, number];
608
- readonly version_V0: () => number;
609
- readonly version_V1: () => number;
610
- readonly version_V2: () => number;
611
- readonly wasmseed_fromProtobuf: (a: any) => [number, number, number];
612
- readonly wasmseed_toProtobuf: (a: number) => [number, number, number];
613
- readonly version_new: (a: number) => number;
614
- readonly __wbg_grpcclient_free: (a: number, b: number) => void;
615
- readonly __wbg_noun_free: (a: number, b: number) => void;
616
- readonly grpcclient_getBalanceByAddress: (a: number, b: number, c: number) => any;
617
- readonly grpcclient_getBalanceByFirstName: (a: number, b: number, c: number) => any;
618
- readonly grpcclient_new: (a: number, b: number) => number;
619
- readonly grpcclient_sendTransaction: (a: number, b: any) => any;
620
- readonly grpcclient_transactionAccepted: (a: number, b: number, c: number) => any;
621
- readonly noun_cue: (a: number, b: number) => [number, number, number];
622
- readonly noun_fromJs: (a: any) => [number, number, number];
623
- readonly noun_jam: (a: number) => [number, number, number, number];
624
- readonly noun_toJs: (a: number) => [number, number, number];
625
- readonly __wbg_extendedkey_free: (a: number, b: number) => void;
626
- readonly __wbg_signature_free: (a: number, b: number) => void;
627
- readonly deriveMasterKey: (a: number, b: number) => number;
628
- readonly deriveMasterKeyFromMnemonic: (a: number, b: number, c: number, d: number) => [number, number, number];
629
- readonly extendedkey_chainCode: (a: number) => [number, number];
630
- readonly extendedkey_deriveChild: (a: number, b: number) => [number, number, number];
631
- readonly extendedkey_privateKey: (a: number) => [number, number];
632
- readonly extendedkey_publicKey: (a: number) => [number, number];
633
- readonly hashNoun: (a: number, b: number) => [number, number, number, number];
634
- readonly hashPublicKey: (a: number, b: number) => [number, number, number, number];
635
- readonly hashU64: (a: bigint) => [number, number];
636
- readonly signMessage: (a: number, b: number, c: number, d: number) => [number, number, number];
637
- readonly signature_c: (a: number) => [number, number];
638
- readonly signature_new: (a: number, b: number, c: number, d: number) => number;
639
- readonly signature_s: (a: number) => [number, number];
640
- readonly verifySignature: (a: number, b: number, c: number, d: number, e: number) => [number, number, number];
641
962
  readonly __wbg_intounderlyingsource_free: (a: number, b: number) => void;
642
963
  readonly intounderlyingsource_cancel: (a: number) => void;
643
964
  readonly intounderlyingsource_pull: (a: number, b: any) => any;
@@ -659,8 +980,8 @@ export interface InitOutput {
659
980
  readonly __wbindgen_exn_store: (a: number) => void;
660
981
  readonly __externref_table_alloc: () => number;
661
982
  readonly __wbindgen_externrefs: WebAssembly.Table;
662
- readonly __externref_table_dealloc: (a: number) => void;
663
983
  readonly __wbindgen_free: (a: number, b: number, c: number) => void;
984
+ readonly __externref_table_dealloc: (a: number) => void;
664
985
  readonly __externref_drop_slice: (a: number, b: number) => void;
665
986
  readonly __wbindgen_start: () => void;
666
987
  }
@@ -685,3 +1006,7 @@ export function initSync(module: { module: SyncInitInput } | SyncInitInput): Ini
685
1006
  * @returns {Promise<InitOutput>}
686
1007
  */
687
1008
  export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
1009
+
1010
+ export type TxId = string;
1011
+ export type BlockHeight = number;
1012
+ export type LockTim = Timelock;