@nockbox/iris-wasm 0.2.0-alpha.1 → 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,17 +1,30 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
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;
3
24
  /**
4
- * Verify a signature with a public key
5
- */
6
- export function verifySignature(public_key_bytes: Uint8Array, signature: Signature, message: string): boolean;
7
- /**
8
- * Derive master key from seed bytes
9
- */
10
- export function deriveMasterKey(seed: Uint8Array): ExtendedKey;
11
- /**
12
- * Hash a u64 value
25
+ * Sign a message string with a private key
13
26
  */
14
- export function hashU64(value: bigint): string;
27
+ export function signMessage(private_key_bytes: Uint8Array, message: string): Signature;
15
28
  /**
16
29
  * Derive master key from BIP39 mnemonic phrase
17
30
  */
@@ -21,24 +34,136 @@ export function deriveMasterKeyFromMnemonic(mnemonic: string, passphrase?: strin
21
34
  */
22
35
  export function hashPublicKey(public_key_bytes: Uint8Array): string;
23
36
  /**
24
- * Sign a message string with a private key
37
+ * Verify a signature with a public key
25
38
  */
26
- export function signMessage(private_key_bytes: Uint8Array, message: string): Signature;
39
+ export function verifySignature(public_key_bytes: Uint8Array, signature: Signature, message: string): boolean;
40
+ /**
41
+ * Hash a u64 value
42
+ */
43
+ export function hashU64(value: bigint): string;
44
+ /**
45
+ * Derive master key from seed bytes
46
+ */
47
+ export function deriveMasterKey(seed: Uint8Array): ExtendedKey;
27
48
  /**
28
49
  * Hash a noun (jam as input)
29
50
  */
30
51
  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;
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;
42
167
  /**
43
168
  * The `ReadableStreamType` enum.
44
169
  *
@@ -50,8 +175,17 @@ export interface TxNotes {
50
175
  spend_conditions: SpendCondition[];
51
176
  }
52
177
 
53
- export interface PbCom1TimeLockIntent {
54
- value: PbCom1TimeLockIntentValue | undefined;
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;
55
189
  }
56
190
 
57
191
  export interface PbCom1Input {
@@ -59,170 +193,121 @@ export interface PbCom1Input {
59
193
  spend: PbCom1Spend | undefined;
60
194
  }
61
195
 
62
- export interface PbCom1BlockHeightDelta {
63
- value: string;
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[];
64
209
  }
65
210
 
66
- export interface PbCom1NamedInput {
67
- name: PbCom1Name | undefined;
68
- input: PbCom1Input | undefined;
211
+ export interface PbCom1Signature {
212
+ entries: PbCom1SignatureEntry[];
69
213
  }
70
214
 
71
- /**
72
- * pub struct Belt(pub u64);
73
- */
74
- export interface PbCom1Belt {
75
- value: string;
215
+ export interface PbCom1TimeLockRangeAbsoluteAndRelative {
216
+ absolute: PbCom1TimeLockRangeAbsolute | undefined;
217
+ relative: PbCom1TimeLockRangeRelative | undefined;
76
218
  }
77
219
 
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
- }
220
+ export interface PbCom1Acknowledged {}
85
221
 
86
- export interface PbCom1SignatureEntry {
87
- /**
88
- * serialized pubkey corresponding to the signer
89
- */
90
- schnorr_pubkey: PbCom1SchnorrPubkey | undefined;
91
- signature: PbCom1SchnorrSignature | undefined;
222
+ export interface PbCom1WireTag {
223
+ value: PbCom1WireTagValue | undefined;
92
224
  }
93
225
 
94
- /**
95
- * Use this when you want to force the output to not have a timelock
96
- */
97
- export interface PbCom1TimeLockRangeNeither {}
226
+ export interface PbCom1BlockHeightDelta {
227
+ value: string;
228
+ }
98
229
 
99
- export interface PbCom1Base58Pubkey {
100
- key: string;
230
+ export interface PbCom1NamedInput {
231
+ name: PbCom1Name | undefined;
232
+ input: PbCom1Input | undefined;
101
233
  }
102
234
 
103
235
  /**
104
- * pub chal: \\[Belt; 8\\],
105
- * pub sig: \\[Belt; 8\\],
236
+ * pub struct Hash(pub \\[Belt; 5\\]);
237
+ * Use fixed fields to avoid variable-length vectors.
106
238
  */
107
- export interface PbCom1EightBelt {
239
+ export interface PbCom1Hash {
108
240
  belt_1: PbCom1Belt | undefined;
109
241
  belt_2: PbCom1Belt | undefined;
110
242
  belt_3: PbCom1Belt | undefined;
111
243
  belt_4: PbCom1Belt | undefined;
112
244
  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
245
  }
127
246
 
128
- export interface PbCom1Signature {
129
- entries: PbCom1SignatureEntry[];
247
+ export interface PbCom1TimeLockIntent {
248
+ value: PbCom1TimeLockIntentValue | undefined;
130
249
  }
131
250
 
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;
251
+ export interface PbCom1Spend {
252
+ signature: PbCom1Signature | undefined;
253
+ seeds: PbCom1Seed[];
254
+ miner_fee_nicks: PbCom1Nicks | undefined;
139
255
  }
140
256
 
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;
257
+ export interface PbCom1WalletBalanceData {
154
258
  /**
155
- * spending condition
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
156
263
  */
157
- lock: PbCom1Lock | undefined;
264
+ notes: PbCom1BalanceEntry[];
158
265
  /**
159
- * provenance commitment
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
160
270
  */
161
- source: PbCom1Source | undefined;
271
+ height: PbCom1BlockHeight | undefined;
162
272
  /**
163
- * coin amount (nicks)
273
+ * block where balance was computed
164
274
  */
165
- assets: PbCom1Nicks | undefined;
275
+ block_id: PbCom1Hash | undefined;
166
276
  /**
167
- * note version (currently 0)
277
+ * Pagination cursor for fetching the next page in a paginated view.
278
+ * When empty, there are no further results for this snapshot.
168
279
  */
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;
280
+ page: PbCom1PageResponse | undefined;
187
281
  }
188
282
 
189
- export interface PbCom1TimeLockRangeAbsoluteAndRelative {
190
- absolute: PbCom1TimeLockRangeAbsolute | undefined;
191
- relative: PbCom1TimeLockRangeRelative | undefined;
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;
192
289
  }
193
290
 
194
- export interface PbCom1Lock {
291
+ export interface PbCom1Name {
195
292
  /**
196
- * threshold of keys required to spend the note
293
+ * First is the hash of whether the note has a timelock and the lock
197
294
  */
198
- keys_required: number;
295
+ first: string;
199
296
  /**
200
- * DEPRECATED: repeated string schnorr_pubkeys_b58 = 2;
201
- *
202
- * schnorr pubkeys (curve: cheetah)
297
+ * Last is the hash of the actual timelock and the source
203
298
  */
204
- schnorr_pubkeys: PbCom1SchnorrPubkey[];
299
+ last: string;
205
300
  }
206
301
 
207
302
  export interface PbCom1BlockHeight {
208
303
  value: string;
209
304
  }
210
305
 
211
- export interface PbCom1ErrorStatus {
212
- code: number;
213
- message: string;
214
- /**
215
- * additional error context
216
- */
217
- details: string | undefined;
218
- }
219
-
220
306
  /**
221
- * min and max are absolute origin page numbers
307
+ * pub struct SchnorrPubkey(pub CheetahPoint);
222
308
  */
223
- export interface PbCom1TimeLockRangeAbsolute {
224
- min: PbCom1BlockHeight | undefined;
225
- max: PbCom1BlockHeight | undefined;
309
+ export interface PbCom1SchnorrPubkey {
310
+ value: PbCom1CheetahPoint | undefined;
226
311
  }
227
312
 
228
313
  /**
@@ -258,46 +343,11 @@ export interface PbCom1PageRequest {
258
343
  max_bytes: number;
259
344
  }
260
345
 
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;
346
+ export interface PbCom1Base58Pubkey {
347
+ key: string;
285
348
  }
286
349
 
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
- }
350
+ export type PbCom1ErrorCode = "Unspecified" | "InvalidRequest" | "PeekFailed" | "PeekReturnedNoData" | "PokeFailed" | "NackappError" | "Timeout" | "InternalError" | "NotFound" | "PermissionDenied" | "InvalidWire" | "KernelError";
301
351
 
302
352
  /**
303
353
  * pub struct F6lt(pub \\[Belt; 6\\]);
@@ -311,78 +361,107 @@ export interface PbCom1SixBelt {
311
361
  belt_6: PbCom1Belt | undefined;
312
362
  }
313
363
 
314
- export interface PbCom1OutputSource {
315
- source: PbCom1Source | undefined;
364
+ export interface PbCom1SchnorrSignature {
365
+ chal: PbCom1EightBelt | undefined;
366
+ sig: PbCom1EightBelt | undefined;
316
367
  }
317
368
 
318
- export interface PbCom1Acknowledged {}
319
-
320
- /**
321
- * pub struct SchnorrPubkey(pub CheetahPoint);
322
- */
323
- export interface PbCom1SchnorrPubkey {
324
- value: PbCom1CheetahPoint | undefined;
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[];
325
380
  }
326
381
 
327
- export interface PbCom1Base58Hash {
382
+ export interface PbCom1Source {
328
383
  hash: string;
384
+ coinbase: boolean;
329
385
  }
330
386
 
331
387
  /**
332
- * pub struct CheetahPoint {
333
- * pub x: F6lt,
334
- * pub y: F6lt,
335
- * pub inf: bool,
336
- * }
388
+ * Use this when you want to force the output to not have a timelock
337
389
  */
338
- export interface PbCom1CheetahPoint {
339
- x: PbCom1SixBelt | undefined;
340
- y: PbCom1SixBelt | undefined;
341
- inf: boolean;
342
- }
390
+ export interface PbCom1TimeLockRangeNeither {}
343
391
 
344
392
  /**
345
- * pub struct Hash(pub \\[Belt; 5\\]);
346
- * Use fixed fields to avoid variable-length vectors.
393
+ * pub chal: \\[Belt; 8\\],
394
+ * pub sig: \\[Belt; 8\\],
347
395
  */
348
- export interface PbCom1Hash {
396
+ export interface PbCom1EightBelt {
349
397
  belt_1: PbCom1Belt | undefined;
350
398
  belt_2: PbCom1Belt | undefined;
351
399
  belt_3: PbCom1Belt | undefined;
352
400
  belt_4: PbCom1Belt | undefined;
353
401
  belt_5: PbCom1Belt | undefined;
402
+ belt_6: PbCom1Belt | undefined;
403
+ belt_7: PbCom1Belt | undefined;
404
+ belt_8: PbCom1Belt | undefined;
354
405
  }
355
406
 
356
- export interface PbCom1Name {
357
- /**
358
- * First is the hash of whether the note has a timelock and the lock
359
- */
360
- first: string;
407
+ export interface PbCom1PageResponse {
361
408
  /**
362
- * Last is the hash of the actual timelock and the source
409
+ * Opaque cursor for fetching the next page. Empty when there are no more
410
+ * results.
363
411
  */
364
- last: string;
412
+ next_page_token: string;
365
413
  }
366
414
 
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;
415
+ export interface PbCom1OutputSource {
416
+ source: PbCom1Source | undefined;
373
417
  }
374
418
 
375
- export interface PbCom1Nicks {
376
- value: string;
419
+ export interface PbCom1ErrorStatus {
420
+ code: number;
421
+ message: string;
422
+ /**
423
+ * additional error context
424
+ */
425
+ details: string | undefined;
377
426
  }
378
427
 
379
- export interface PbCom1Spend {
380
- signature: PbCom1Signature | undefined;
381
- seeds: PbCom1Seed[];
382
- miner_fee_nicks: PbCom1Nicks | undefined;
428
+ /**
429
+ * pub struct Belt(pub u64);
430
+ */
431
+ export interface PbCom1Belt {
432
+ value: string;
383
433
  }
384
434
 
385
- export type PbCom1ErrorCode = "Unspecified" | "InvalidRequest" | "PeekFailed" | "PeekReturnedNoData" | "PokeFailed" | "NackappError" | "Timeout" | "InternalError" | "NotFound" | "PermissionDenied" | "InvalidWire" | "KernelError";
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
+ }
386
465
 
387
466
  /**
388
467
  * the string key is the name of the input
@@ -395,40 +474,58 @@ export interface PbCom1RawTransaction {
395
474
  id: string;
396
475
  }
397
476
 
398
- export interface PbCom2SpendCondition {
399
- primitives: PbCom2LockPrimitive[];
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;
400
483
  }
401
484
 
402
- export interface PbCom2Seed {
485
+ export interface PbCom1Nicks {
486
+ value: string;
487
+ }
488
+
489
+ export interface PbCom1SignatureEntry {
403
490
  /**
404
- * Absent when the seed originates from a coinbase output.
491
+ * serialized pubkey corresponding to the signer
405
492
  */
406
- output_source: PbCom1Source | undefined;
407
- lock_root: string;
408
- note_data: PbCom2NoteData | undefined;
409
- gift: PbCom1Nicks | undefined;
410
- parent_hash: string;
493
+ schnorr_pubkey: PbCom1SchnorrPubkey | undefined;
494
+ signature: PbCom1SchnorrSignature | undefined;
411
495
  }
412
496
 
413
- export interface PbCom2MerkleProof {
414
- root: string;
415
- path: string[];
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;
416
504
  }
417
505
 
418
- export interface PbCom2PkhSignatureEntry {
506
+ export interface PbCom1Base58Hash {
419
507
  hash: string;
420
- pubkey: PbCom1SchnorrPubkey | undefined;
421
- signature: PbCom1SchnorrSignature | undefined;
422
508
  }
423
509
 
424
- export interface PbCom2SpendEntry {
425
- name: PbCom1Name | undefined;
426
- spend: PbCom2Spend | undefined;
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;
427
521
  }
428
522
 
429
- export interface PbCom2BalanceEntry {
523
+ export interface PbCom2NoteV1 {
524
+ version: PbCom1NoteVersion | undefined;
525
+ origin_page: PbCom1BlockHeight | undefined;
430
526
  name: PbCom1Name | undefined;
431
- note: PbCom2Note | undefined;
527
+ note_data: PbCom2NoteData | undefined;
528
+ assets: PbCom1Nicks | undefined;
432
529
  }
433
530
 
434
531
  export interface PbCom2LockMerkleProof {
@@ -437,22 +534,18 @@ export interface PbCom2LockMerkleProof {
437
534
  proof: PbCom2MerkleProof | undefined;
438
535
  }
439
536
 
440
- export interface PbCom2WitnessSpend {
441
- witness: PbCom2Witness | undefined;
442
- seeds: PbCom2Seed[];
443
- fee: PbCom1Nicks | undefined;
537
+ export interface PbCom2Note {
538
+ note_version: PbCom2NoteNoteVersion | undefined;
444
539
  }
445
540
 
446
541
  export interface PbCom2Spend {
447
542
  spend_kind: PbCom2SpendSpendKind | undefined;
448
543
  }
449
544
 
450
- export interface PbCom2NoteDataEntry {
451
- key: string;
452
- /**
453
- * jammed noun bytes
454
- */
455
- blob: number[];
545
+ export interface PbCom2RawTransaction {
546
+ version: PbCom1NoteVersion | undefined;
547
+ id: string;
548
+ spends: PbCom2SpendEntry[];
456
549
  }
457
550
 
458
551
  export interface PbCom2LockTim {
@@ -460,51 +553,51 @@ export interface PbCom2LockTim {
460
553
  abs: PbCom1TimeLockRangeAbsolute | undefined;
461
554
  }
462
555
 
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[];
556
+ export interface PbCom2WitnessSpend {
557
+ witness: PbCom2Witness | undefined;
558
+ seeds: PbCom2Seed[];
559
+ fee: PbCom1Nicks | undefined;
473
560
  }
474
561
 
475
- export interface PbCom2BurnLock {}
476
-
477
- export interface PbCom2PkhSignature {
478
- entries: PbCom2PkhSignatureEntry[];
562
+ export interface PbCom2NoteData {
563
+ entries: PbCom2NoteDataEntry[];
479
564
  }
480
565
 
481
- export interface PbCom2RawTransaction {
482
- version: PbCom1NoteVersion | undefined;
483
- id: string;
484
- spends: PbCom2SpendEntry[];
566
+ export interface PbCom2LegacySpend {
567
+ signature: PbCom1Signature | undefined;
568
+ seeds: PbCom2Seed[];
569
+ fee: PbCom1Nicks | undefined;
485
570
  }
486
571
 
487
- export interface PbCom2Note {
488
- note_version: PbCom2NoteNoteVersion | undefined;
572
+ export interface PbCom2PkhLock {
573
+ m: number;
574
+ hashes: string[];
489
575
  }
490
576
 
491
- export interface PbCom2NoteV1 {
492
- version: PbCom1NoteVersion | undefined;
493
- origin_page: PbCom1BlockHeight | undefined;
494
- name: PbCom1Name | undefined;
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;
495
583
  note_data: PbCom2NoteData | undefined;
496
- assets: PbCom1Nicks | undefined;
584
+ gift: PbCom1Nicks | undefined;
585
+ parent_hash: string;
497
586
  }
498
587
 
499
- export interface PbCom2Balance {
500
- notes: PbCom2BalanceEntry[];
501
- height: PbCom1BlockHeight | undefined;
502
- block_id: string;
503
- page: PbCom1PageResponse | undefined;
588
+ export interface PbCom2BurnLock {}
589
+
590
+ export interface PbCom2MerkleProof {
591
+ root: string;
592
+ path: string[];
504
593
  }
505
594
 
506
- export interface PbCom2NoteData {
507
- entries: PbCom2NoteDataEntry[];
595
+ export interface PbCom2HaxPreimage {
596
+ hash: PbCom1Hash | undefined;
597
+ /**
598
+ * jammed noun bytes
599
+ */
600
+ value: number[];
508
601
  }
509
602
 
510
603
  export interface PbCom2Witness {
@@ -516,37 +609,73 @@ export interface PbCom2Witness {
516
609
  hax: PbCom2HaxPreimage[];
517
610
  }
518
611
 
519
- export interface PbCom2PkhLock {
520
- m: number;
521
- hashes: string[];
612
+ export interface PbCom2SpendCondition {
613
+ primitives: PbCom2LockPrimitive[];
522
614
  }
523
615
 
524
- export interface PbCom2LegacySpend {
525
- signature: PbCom1Signature | undefined;
526
- seeds: PbCom2Seed[];
527
- fee: PbCom1Nicks | undefined;
616
+ export interface PbCom2PkhSignatureEntry {
617
+ hash: string;
618
+ pubkey: PbCom1SchnorrPubkey | undefined;
619
+ signature: PbCom1SchnorrSignature | undefined;
528
620
  }
529
621
 
530
- export interface PbCom2LockPrimitive {
531
- primitive: PbCom2LockPrimitivePrimitive | undefined;
622
+ export interface PbCom2BalanceEntry {
623
+ name: PbCom1Name | undefined;
624
+ note: PbCom2Note | undefined;
532
625
  }
533
626
 
534
- export type PbPub2WalletGetBalanceRequestSelector = { Address: PbCom1Base58Pubkey } | { FirstName: PbCom1Base58Hash };
627
+ export interface PbCom2SpendEntry {
628
+ name: PbCom1Name | undefined;
629
+ spend: PbCom2Spend | undefined;
630
+ }
535
631
 
536
- export type PbCom1TimeLockIntentValue = { Absolute: PbCom1TimeLockRangeAbsolute } | { Relative: PbCom1TimeLockRangeRelative } | { AbsoluteAndRelative: PbCom1TimeLockRangeAbsoluteAndRelative } | { Neither: PbCom1TimeLockRangeNeither };
632
+ export interface PbCom2HaxLock {
633
+ hashes: PbCom1Hash[];
634
+ }
537
635
 
538
- export type PbCom2LockPrimitivePrimitive = { Pkh: PbCom2PkhLock } | { Tim: PbCom2LockTim } | { Hax: PbCom2HaxLock } | { Burn: PbCom2BurnLock };
636
+ export interface PbCom2NoteDataEntry {
637
+ key: string;
638
+ /**
639
+ * jammed noun bytes
640
+ */
641
+ blob: number[];
642
+ }
539
643
 
540
- export type PbCom2SpendSpendKind = { Legacy: PbCom2LegacySpend } | { Witness: PbCom2WitnessSpend };
644
+ export interface PbCom2LockPrimitive {
645
+ primitive: PbCom2LockPrimitivePrimitive | undefined;
646
+ }
541
647
 
542
- export type PbCom2NoteNoteVersion = { Legacy: PbCom1Note } | { V1: PbCom2NoteV1 };
648
+ export interface PbCom2PkhSignature {
649
+ entries: PbCom2PkhSignatureEntry[];
650
+ }
543
651
 
544
- export type PbCom1WireTagValue = { Text: string } | { Number: number };
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
+ }
545
665
 
546
666
  export interface PbPub2WalletGetBalanceResponse {
547
667
  result: PbPub2WalletGetBalanceResponseResult | undefined;
548
668
  }
549
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
+
550
679
  export interface PbPub2TransactionAcceptedResponse {
551
680
  result: PbPub2TransactionAcceptedResponseResult | undefined;
552
681
  }
@@ -555,38 +684,61 @@ export interface PbPub2TransactionAcceptedRequest {
555
684
  tx_id: PbCom1Base58Hash | undefined;
556
685
  }
557
686
 
558
- export interface PbPub2WalletSendTransactionResponse {
559
- result: PbPub2WalletSendTransactionResponseResult | undefined;
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;
560
695
  }
561
696
 
562
- export interface PbPub2WalletSendTransactionRequest {
563
- tx_id: PbCom1Hash | undefined;
564
- raw_tx: PbCom2RawTransaction | undefined;
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[];
565
710
  }
566
711
 
567
- export interface PbPub2WalletGetBalanceRequest {
568
- page: PbCom1PageRequest | undefined;
569
- selector: PbPub2WalletGetBalanceRequestSelector | undefined;
712
+ export interface PbPri1PokeResponse {
713
+ result: PbPri1PokeResponseResult | undefined;
570
714
  }
571
715
 
572
- export type PbPub2TransactionAcceptedResponseResult = { Accepted: boolean } | { Error: PbCom1ErrorStatus };
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
+ }
573
726
 
574
- export type PbPub2WalletGetBalanceResponseResult = { Balance: PbCom2Balance } | { Error: PbCom1ErrorStatus };
727
+ export type PbCom2NoteNoteVersion = { Legacy: PbCom1Note } | { V1: PbCom2NoteV1 };
728
+
729
+ export type PbCom1TimeLockIntentValue = { Absolute: PbCom1TimeLockRangeAbsolute } | { Relative: PbCom1TimeLockRangeRelative } | { AbsoluteAndRelative: PbCom1TimeLockRangeAbsoluteAndRelative } | { Neither: PbCom1TimeLockRangeNeither };
575
730
 
576
- export type PbPub2WalletSendTransactionResponseResult = { Ack: PbCom1Acknowledged } | { Error: PbCom1ErrorStatus };
731
+ export type PbCom1WireTagValue = { Text: string } | { Number: number };
577
732
 
578
- export type NoteData = ZMap<string, Noun>;
733
+ export type PbCom2LockPrimitivePrimitive = { Pkh: PbCom2PkhLock } | { Tim: PbCom2LockTim } | { Hax: PbCom2HaxLock } | { Burn: PbCom2BurnLock };
579
734
 
580
- export type Hax = ZSet<Digest>;
735
+ export type PbPub2WalletGetBalanceResponseResult = { Balance: PbCom2Balance } | { Error: PbCom1ErrorStatus };
581
736
 
582
- export type SpendsV1 = ZMap<Name, SpendV1>;
737
+ export type PbCom2SpendSpendKind = { Legacy: PbCom2LegacySpend } | { Witness: PbCom2WitnessSpend };
583
738
 
584
- export type SpendCondition = LockPrimitive[];
739
+ export type PbPub2WalletSendTransactionResponseResult = { Ack: PbCom1Acknowledged } | { Error: PbCom1ErrorStatus };
585
740
 
586
- export interface Pkh {
587
- m: number;
588
- hashes: ZSet<Digest>;
589
- }
741
+ export type LockPrimitive = { Pkh: Pkh } | { Tim: LockTim } | { Hax: Hax } | "Brn";
590
742
 
591
743
  export interface Witness {
592
744
  lock_merkle_proof: LockMerkleProof;
@@ -595,9 +747,20 @@ export interface Witness {
595
747
  tim: undefined;
596
748
  }
597
749
 
598
- export interface LockMetadata {
599
- lock: SpendCondition;
600
- include_data: boolean;
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;
601
764
  }
602
765
 
603
766
  export interface Spend0V1 {
@@ -606,11 +769,9 @@ export interface Spend0V1 {
606
769
  fee: Nicks;
607
770
  }
608
771
 
609
- export interface WitnessData {
610
- data: ZMap<Name, Witness>;
611
- }
772
+ export type NoteData = ZMap<string, Noun>;
612
773
 
613
- export type LockPrimitive = { Pkh: Pkh } | { Tim: LockTim } | { Hax: Hax } | "Brn";
774
+ export type LockRoot = { Hash: Digest } | { Lock: SpendCondition };
614
775
 
615
776
  export interface LockMerkleProof {
616
777
  spend_condition: SpendCondition;
@@ -618,12 +779,13 @@ export interface LockMerkleProof {
618
779
  proof: MerkleProof;
619
780
  }
620
781
 
621
- export interface Spend1V1 {
622
- witness: Witness;
623
- seeds: SeedsV1;
624
- fee: Nicks;
782
+ export interface Pkh {
783
+ m: number;
784
+ hashes: ZSet<Digest>;
625
785
  }
626
786
 
787
+ export type SpendCondition = LockPrimitive[];
788
+
627
789
  export interface NockchainTx {
628
790
  version: Version;
629
791
  id: TxId;
@@ -632,23 +794,10 @@ export interface NockchainTx {
632
794
  witness_data: WitnessData;
633
795
  }
634
796
 
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;
797
+ export interface Spend1V1 {
798
+ witness: Witness;
799
+ seeds: SeedsV1;
800
+ fee: Nicks;
652
801
  }
653
802
 
654
803
  export interface RawTxV1 {
@@ -657,81 +806,46 @@ export interface RawTxV1 {
657
806
  spends: SpendsV1;
658
807
  }
659
808
 
660
- export type SpendV1 = { version: 0; spend: Spend0V1 } | { version: 1; spend: Spend1V1 };
661
-
662
809
  export type InputDisplay = { version: 0; p: ZMap<Name, Sig> } | { version: 1; p: ZMap<Name, SpendCondition> };
663
810
 
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][];
811
+ export type SeedsV1 = ZSet<SeedV1>;
680
812
 
681
- export interface BalanceUpdate {
682
- height: BlockHeight;
683
- block_id: Digest;
684
- notes: Balance;
813
+ export interface LockMetadata {
814
+ lock: SpendCondition;
815
+ include_data: boolean;
685
816
  }
686
817
 
687
- export type Version = 0 | 1 | 2;
818
+ export type SpendV1 = { version: 0; spend: Spend0V1 } | { version: 1; spend: Spend1V1 };
688
819
 
689
- /**
690
- * Timelock range (for both absolute and relative constraints)
691
- */
692
- export interface TimelockRange {
693
- min: BlockHeight | undefined;
694
- max: BlockHeight | undefined;
820
+ export interface WitnessData {
821
+ data: ZMap<Name, Witness>;
695
822
  }
696
823
 
697
- /**
698
- * 64-bit unsigned integer representing the number of assets.
699
- */
700
- export type Nicks = string;
824
+ export type SpendsV1 = ZMap<Name, SpendV1>;
701
825
 
702
- export interface Source {
703
- hash: Digest;
704
- is_coinbase: boolean;
705
- }
826
+ export type PkhSignature = ZMap<Digest, [PublicKey, Signature]>;
706
827
 
707
- export interface Name {
708
- first: Digest;
709
- last: Digest;
710
- _sig: number;
828
+ export interface TransactionDisplay {
829
+ inputs: InputDisplay;
830
+ outputs: ZMap<Digest, LockMetadata>;
711
831
  }
712
832
 
713
- export type Note = NoteV0 | NoteV1;
714
-
715
- export interface Sig {
716
- m: number;
717
- pubkeys: ZSet<PublicKey>;
718
- }
833
+ export type Hax = ZSet<Digest>;
719
834
 
720
- export interface RawTxV0 {
721
- id: TxId;
722
- inputs: Inputs;
723
- timelock_range: TimelockRange;
724
- total_fees: Nicks;
835
+ export interface MerkleProof {
836
+ root: Digest;
837
+ path: Digest[];
725
838
  }
726
839
 
727
- export interface Timelock {
728
- rel: TimelockRange;
729
- abs: TimelockRange;
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;
730
846
  }
731
847
 
732
- export type Inputs = ZMap<Name, Input>;
733
-
734
- export type SeedsV0 = ZSet<SeedV0>;
848
+ export type RawTx = RawTxV0 | RawTxV1;
735
849
 
736
850
  export interface NoteV0 {
737
851
  inner: NoteInner;
@@ -741,6 +855,18 @@ export interface NoteV0 {
741
855
  assets: Nicks;
742
856
  }
743
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
+
744
870
  export interface SeedV0 {
745
871
  output_source: Source | undefined;
746
872
  recipient: Sig;
@@ -749,9 +875,21 @@ export interface SeedV0 {
749
875
  parent_hash: Digest;
750
876
  }
751
877
 
752
- export interface Input {
753
- note: NoteV0;
754
- spend: SpendV0;
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;
755
893
  }
756
894
 
757
895
  export interface SpendV0 {
@@ -760,19 +898,52 @@ export interface SpendV0 {
760
898
  fee: Nicks;
761
899
  }
762
900
 
763
- export interface NoteInner {
764
- version: Version;
765
- origin_page: BlockHeight;
766
- timelock: TimelockIntent;
901
+ export interface Sig {
902
+ m: number;
903
+ pubkeys: ZSet<PublicKey>;
767
904
  }
768
905
 
769
- export type LegacySignature = ZMap<PublicKey, Signature>;
906
+ export type SeedsV0 = ZSet<SeedV0>;
770
907
 
771
- export interface TimelockIntent {
772
- tim: Timelock | undefined;
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;
773
919
  }
774
920
 
775
- export type RawTx = RawTxV0 | RawTxV1;
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[] } };
776
947
 
777
948
  export interface Signature {
778
949
  c: Uint8Array;
@@ -787,12 +958,12 @@ export type CheetahPoint = string;
787
958
 
788
959
  export type Digest = string;
789
960
 
790
- export type ZBase<E> = E[];
791
-
792
961
  export type ZMap<K, V> = ZBase<ZMapEntry<K, V>>;
793
962
 
794
963
  export type ZMapEntry<K, V> = [K, V];
795
964
 
965
+ export type ZBase<E> = E[];
966
+
796
967
  export type ZSet<T> = ZBase<ZSetEntry<T>>;
797
968
 
798
969
  export type ZSetEntry<T> = T;
@@ -829,6 +1000,14 @@ export class GrpcClient {
829
1000
  */
830
1001
  getBalanceByFirstName(first_name: string): Promise<PbCom2Balance>;
831
1002
  constructor(endpoint: string);
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>;
832
1011
  }
833
1012
  export class IntoUnderlyingByteSource {
834
1013
  private constructor();
@@ -883,7 +1062,7 @@ export class TxBuilder {
883
1062
  /**
884
1063
  * Create an empty transaction builder
885
1064
  */
886
- constructor(fee_per_word: Nicks);
1065
+ constructor(settings: TxEngineSettings);
887
1066
  sign(signing_key_bytes: Uint8Array): void;
888
1067
  build(): NockchainTx;
889
1068
  /**
@@ -894,7 +1073,7 @@ export class TxBuilder {
894
1073
  /**
895
1074
  * Reconstruct a builder from raw transaction and its input notes.
896
1075
  */
897
- static fromTx(tx: RawTx, notes: Note[], spend_conditions: SpendCondition[]): TxBuilder;
1076
+ static fromTx(tx: RawTx, notes: Note[], spend_conditions: SpendCondition[], settings: TxEngineSettings): TxBuilder;
898
1077
  calcFee(): Nicks;
899
1078
  validate(): void;
900
1079
  allNotes(): TxNotes;
@@ -904,26 +1083,21 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
904
1083
 
905
1084
  export interface InitOutput {
906
1085
  readonly memory: WebAssembly.Memory;
907
- readonly __wbg_extendedkey_free: (a: number, b: number) => void;
908
1086
  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];
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];
915
1090
  readonly grpcclient_getBalanceByAddress: (a: number, b: number, c: number) => any;
916
1091
  readonly grpcclient_getBalanceByFirstName: (a: number, b: number, c: number) => any;
917
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;
918
1095
  readonly grpcclient_sendTransaction: (a: number, b: any) => any;
919
1096
  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
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];
927
1101
  readonly __wbg_spendbuilder_free: (a: number, b: number) => void;
928
1102
  readonly __wbg_txbuilder_free: (a: number, b: number) => void;
929
1103
  readonly create_note_v0: (a: number, b: bigint, c: number, d: number, e: any, f: number, g: number, h: any) => [number, number, number];
@@ -932,9 +1106,14 @@ export interface InitOutput {
932
1106
  readonly digest_to_hex: (a: any) => [number, number];
933
1107
  readonly digest_to_protobuf: (a: any) => any;
934
1108
  readonly hex_to_digest: (a: number, b: number) => [number, number, number];
1109
+ readonly nockchainTxToRaw: (a: any) => any;
935
1110
  readonly note_from_protobuf: (a: any) => [number, number, number];
936
1111
  readonly note_hash: (a: any) => any;
937
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;
938
1117
  readonly spendbuilder_addPreimage: (a: number, b: number, c: number) => [number, number, number];
939
1118
  readonly spendbuilder_computeRefund: (a: number, b: number) => void;
940
1119
  readonly spendbuilder_curRefund: (a: number) => any;
@@ -951,7 +1130,7 @@ export interface InitOutput {
951
1130
  readonly txbuilder_build: (a: number) => [number, number, number];
952
1131
  readonly txbuilder_calcFee: (a: number) => any;
953
1132
  readonly txbuilder_curFee: (a: number) => any;
954
- readonly txbuilder_fromTx: (a: any, b: number, c: number, d: number, e: number) => [number, number, number];
1133
+ readonly txbuilder_fromTx: (a: any, b: number, c: number, d: number, e: number, f: any) => [number, number, number];
955
1134
  readonly txbuilder_new: (a: any) => number;
956
1135
  readonly txbuilder_recalcAndSetFee: (a: number, b: number) => [number, number];
957
1136
  readonly txbuilder_setFeeAndBalanceRefund: (a: number, b: any, c: number, d: number) => [number, number];
@@ -959,6 +1138,18 @@ export interface InitOutput {
959
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];
960
1139
  readonly txbuilder_spend: (a: number, b: number) => number;
961
1140
  readonly txbuilder_validate: (a: number) => [number, number];
1141
+ readonly __wbg_extendedkey_free: (a: number, b: number) => void;
1142
+ readonly deriveMasterKey: (a: number, b: number) => number;
1143
+ readonly deriveMasterKeyFromMnemonic: (a: number, b: number, c: number, d: number) => [number, number, number];
1144
+ readonly extendedkey_chainCode: (a: number) => [number, number];
1145
+ readonly extendedkey_deriveChild: (a: number, b: number) => [number, number, number];
1146
+ readonly extendedkey_privateKey: (a: number) => [number, number];
1147
+ readonly extendedkey_publicKey: (a: number) => [number, number];
1148
+ readonly hashNoun: (a: number, b: number) => [number, number, number, number];
1149
+ readonly hashPublicKey: (a: number, b: number) => [number, number, number, number];
1150
+ readonly hashU64: (a: bigint) => [number, number];
1151
+ readonly signMessage: (a: number, b: number, c: number, d: number) => [number, number, number];
1152
+ readonly verifySignature: (a: number, b: number, c: any, d: number, e: number) => [number, number, number];
962
1153
  readonly __wbg_intounderlyingsource_free: (a: number, b: number) => void;
963
1154
  readonly intounderlyingsource_cancel: (a: number) => void;
964
1155
  readonly intounderlyingsource_pull: (a: number, b: any) => any;
@@ -972,6 +1163,121 @@ export interface InitOutput {
972
1163
  readonly intounderlyingsink_abort: (a: number, b: any) => any;
973
1164
  readonly intounderlyingsink_close: (a: number) => any;
974
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;
975
1281
  readonly wasm_bindgen__convert__closures_____invoke__hbf186e27576c509b: (a: number, b: number, c: any) => void;
976
1282
  readonly wasm_bindgen__closure__destroy__h20e54f17b0de8c43: (a: number, b: number) => void;
977
1283
  readonly wasm_bindgen__convert__closures_____invoke__h2bc9de53710866b6: (a: number, b: number, c: any, d: any) => void;
@@ -980,8 +1286,8 @@ export interface InitOutput {
980
1286
  readonly __wbindgen_exn_store: (a: number) => void;
981
1287
  readonly __externref_table_alloc: () => number;
982
1288
  readonly __wbindgen_externrefs: WebAssembly.Table;
983
- readonly __wbindgen_free: (a: number, b: number, c: number) => void;
984
1289
  readonly __externref_table_dealloc: (a: number) => void;
1290
+ readonly __wbindgen_free: (a: number, b: number, c: number) => void;
985
1291
  readonly __externref_drop_slice: (a: number, b: number) => void;
986
1292
  readonly __wbindgen_start: () => void;
987
1293
  }