@tari-project/ootle 0.12.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +48 -0
- package/dist/index.js +297 -263
- package/package.json +2 -1
package/dist/index.d.ts
CHANGED
|
@@ -473,6 +473,54 @@ export declare class EncryptedData {
|
|
|
473
473
|
|
|
474
474
|
export { ExecuteResult }
|
|
475
475
|
|
|
476
|
+
/**
|
|
477
|
+
* A {@link Signer} whose key is held externally. Each `signTransaction` hashes the transaction
|
|
478
|
+
* against the supplied seal public key, asks `sign` for a signature over the hash, and verifies it
|
|
479
|
+
* before returning, so a wrong key or scheme fails here with a {@link SignerError}. An error thrown
|
|
480
|
+
* by `sign` itself (a vault rejection or timeout) is also rethrown as a {@link SignerError}, with the
|
|
481
|
+
* original as its `cause`.
|
|
482
|
+
*
|
|
483
|
+
* @example
|
|
484
|
+
* ```ts
|
|
485
|
+
* const signer = new ExternalKeySigner({
|
|
486
|
+
* publicKey,
|
|
487
|
+
* viewPublicKey,
|
|
488
|
+
* network: Network.Esmeralda,
|
|
489
|
+
* sign: (hash) => vault.sign(keyId, hash),
|
|
490
|
+
* });
|
|
491
|
+
* const signed = await signTransaction([signer], unsignedTx);
|
|
492
|
+
* ```
|
|
493
|
+
*/
|
|
494
|
+
export declare class ExternalKeySigner implements Signer {
|
|
495
|
+
private readonly publicKey;
|
|
496
|
+
private readonly sign;
|
|
497
|
+
readonly address: string;
|
|
498
|
+
constructor(options: ExternalKeySignerOptions);
|
|
499
|
+
getAddress(): Promise<string>;
|
|
500
|
+
getPublicKey(): Promise<Uint8Array>;
|
|
501
|
+
signTransaction(unsignedTx: UnsignedTransactionV1, sealPublicKey: Uint8Array): Promise<TransactionSignature[]>;
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
export declare interface ExternalKeySignerOptions {
|
|
505
|
+
/** The 32-byte public key of the external key. */
|
|
506
|
+
publicKey: Uint8Array;
|
|
507
|
+
/** The 32-byte view-only public key; with `publicKey` it forms the Ootle address. */
|
|
508
|
+
viewPublicKey: Uint8Array;
|
|
509
|
+
network: Network;
|
|
510
|
+
/** Signs the authorization hash (`hashUnsignedTransaction`). */
|
|
511
|
+
sign: ExternalSignFn;
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
/**
|
|
515
|
+
* Signs a 64-byte transaction hash with a key held outside this process (an HSM, an MPC vault, a
|
|
516
|
+
* hardware wallet) and returns the raw 64-byte signature.
|
|
517
|
+
*
|
|
518
|
+
* The signature must be a standard sr25519 (schnorrkel) signature over `message` exactly as given,
|
|
519
|
+
* under the default `substrate` signing context, with the sr25519 marker bit set in its last byte.
|
|
520
|
+
* A signer that hashes, prefixes or wraps the message produces a signature that fails verification.
|
|
521
|
+
*/
|
|
522
|
+
export declare type ExternalSignFn = (message: Uint8Array) => Promise<Uint8Array>;
|
|
523
|
+
|
|
476
524
|
/**
|
|
477
525
|
* Fluent builder for common faucet component invocations.
|
|
478
526
|
* Mirrors `FaucetInvokeBuilder` from the Rust ootle-rs crate.
|
package/dist/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
3
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
|
-
import { aggregateInputMasks as e,
|
|
5
|
-
import { decodeEvent as
|
|
4
|
+
import { aggregateInputMasks as e, attachTransactionSignature as t, borEncodeTransaction as n, buildStealthInputsStatement as r, createStealthOutputWitness as i, encryptedDataDhKdfAead as a, generateKeypair as o, generateOotleAddress as s, generateStealthBalanceProofSignature as c, generateStealthOutputsStatement as l, hashUnsignedTransaction as ee, parseOotleAddress as te, sealTransaction as ne, stealthDhSecret as re, unblindOutput as ie, validateBalanceProofSignature as ae, validateStealthTransfer as oe } from "@tari-project/ootle-wasm";
|
|
5
|
+
import { decodeEvent as se, decodeExecuteResult as ce, decodeResource as le, decodeSubstateValue as ue, decodeTransactionReceipt as de, decodeUtxo as fe } from "@tari-project/ootle-wasm-bor";
|
|
6
6
|
var u = /* @__PURE__ */ (function(e11) {
|
|
7
7
|
return e11[e11.MainNet = 0] = "MainNet", e11[e11.StageNet = 1] = "StageNet", e11[e11.NextNet = 2] = "NextNet", e11[e11.LocalNet = 16] = "LocalNet", e11[e11.Igor = 36] = "Igor", e11[e11.Esmeralda = 38] = "Esmeralda", e11;
|
|
8
8
|
})({}), d = class extends Error {
|
|
9
9
|
constructor(e11, t2) {
|
|
10
10
|
super(e11, t2), this.name = new.target.name;
|
|
11
11
|
}
|
|
12
|
-
},
|
|
12
|
+
}, pe = class extends d {
|
|
13
13
|
constructor(e11, t2) {
|
|
14
14
|
super(e11, t2);
|
|
15
15
|
__publicField(this, "status");
|
|
@@ -25,7 +25,7 @@ var u = /* @__PURE__ */ (function(e11) {
|
|
|
25
25
|
__publicField(this, "rejectReason");
|
|
26
26
|
this.txId = t2.txId, this.reason = t2.reason, this.rejectReason = t2.rejectReason;
|
|
27
27
|
}
|
|
28
|
-
},
|
|
28
|
+
}, me = class extends d {
|
|
29
29
|
constructor(e11, t2) {
|
|
30
30
|
super(e11, t2);
|
|
31
31
|
__publicField(this, "txId");
|
|
@@ -47,9 +47,9 @@ var u = /* @__PURE__ */ (function(e11) {
|
|
|
47
47
|
this.context = t2 == null ? void 0 : t2.context;
|
|
48
48
|
}
|
|
49
49
|
}, v = class extends d {
|
|
50
|
-
},
|
|
50
|
+
}, he = class extends d {
|
|
51
51
|
};
|
|
52
|
-
function
|
|
52
|
+
function ge(e11, t2) {
|
|
53
53
|
throw new v(`assertUnreachable${t2 ? ` (${t2})` : ""}: ${JSON.stringify(e11)}`);
|
|
54
54
|
}
|
|
55
55
|
function y(e11, t2, n2) {
|
|
@@ -59,23 +59,23 @@ function y(e11, t2, n2) {
|
|
|
59
59
|
function b(e11) {
|
|
60
60
|
return Array.from(e11, (e12) => e12.toString(16).padStart(2, "0")).join("");
|
|
61
61
|
}
|
|
62
|
-
var
|
|
62
|
+
var _e = /^[0-9a-fA-F]*$/;
|
|
63
63
|
function x(e11) {
|
|
64
64
|
if (e11.length % 2 != 0) throw new v(`fromHexStr: hex string must have even length, got ${e11.length}`);
|
|
65
|
-
if (!
|
|
65
|
+
if (!_e.test(e11)) throw new v("fromHexStr: hex string contains non-hex characters");
|
|
66
66
|
let t2 = new Uint8Array(e11.length / 2);
|
|
67
67
|
for (let n2 = 0; n2 < t2.length; n2++) t2[n2] = parseInt(e11.substring(n2 * 2, n2 * 2 + 2), 16);
|
|
68
68
|
return t2;
|
|
69
69
|
}
|
|
70
|
-
var S = (1n << 64n) - 1n,
|
|
71
|
-
function
|
|
70
|
+
var S = (1n << 64n) - 1n, ve = 2n, C = 32, ye = C * 2, be = 32, xe = 128, Se = 129, Ce = 130, w = 131, we = 132, Te = 136, Ee = 138, De = 141, T = 0, Oe = 32, E = 64, ke = 96, D = 128, Ae = 160, O = 192;
|
|
71
|
+
function je(e11) {
|
|
72
72
|
switch (typeof e11) {
|
|
73
73
|
case "bigint":
|
|
74
74
|
return k(e11);
|
|
75
75
|
case "string":
|
|
76
|
-
return
|
|
76
|
+
return Pe(e11);
|
|
77
77
|
case "boolean":
|
|
78
|
-
return
|
|
78
|
+
return Fe(e11);
|
|
79
79
|
default:
|
|
80
80
|
if (e11 instanceof Uint8Array) return A(e11);
|
|
81
81
|
throw new v(`literalArg: cannot CBOR-encode value of type ${typeof e11}`);
|
|
@@ -85,14 +85,14 @@ function k(e11) {
|
|
|
85
85
|
if (e11 < 0n) throw new v(`amountLiteral: amount must be non-negative, got ${e11}`);
|
|
86
86
|
if (e11 >> 128n != 0n) throw new v(`amountLiteral: amount overflows u128: ${e11}`);
|
|
87
87
|
let t2 = [];
|
|
88
|
-
return e11 <= S ? I(t2, T, e11) :
|
|
88
|
+
return e11 <= S ? I(t2, T, e11) : Me(t2, e11), L(t2);
|
|
89
89
|
}
|
|
90
|
-
function
|
|
90
|
+
function Me(e11, t2) {
|
|
91
91
|
let n2 = [], r2 = t2;
|
|
92
92
|
for (; r2 > 0n; ) n2.unshift(Number(r2 & 255n)), r2 >>= 8n;
|
|
93
|
-
I(e11, O,
|
|
93
|
+
I(e11, O, ve), I(e11, E, BigInt(n2.length)), F(e11, n2);
|
|
94
94
|
}
|
|
95
|
-
function
|
|
95
|
+
function Ne(e11) {
|
|
96
96
|
let t2 = [];
|
|
97
97
|
if (e11 >= 0n) {
|
|
98
98
|
if (e11 > S) throw new v(`intLiteral: value exceeds the 64-bit CBOR integer range: ${e11}`);
|
|
@@ -100,11 +100,11 @@ function Ae(e11) {
|
|
|
100
100
|
} else {
|
|
101
101
|
let n2 = -1n - e11;
|
|
102
102
|
if (n2 > S) throw new v(`intLiteral: value exceeds the 64-bit CBOR integer range: ${e11}`);
|
|
103
|
-
I(t2,
|
|
103
|
+
I(t2, Oe, n2);
|
|
104
104
|
}
|
|
105
105
|
return L(t2);
|
|
106
106
|
}
|
|
107
|
-
function
|
|
107
|
+
function Pe(e11) {
|
|
108
108
|
let t2 = [];
|
|
109
109
|
return P(t2, e11), L(t2);
|
|
110
110
|
}
|
|
@@ -112,44 +112,44 @@ function A(e11) {
|
|
|
112
112
|
let t2 = [];
|
|
113
113
|
return I(t2, E, BigInt(e11.length)), F(t2, e11), L(t2);
|
|
114
114
|
}
|
|
115
|
-
function
|
|
115
|
+
function Fe(e11) {
|
|
116
116
|
return { Literal: e11 ? "f5" : "f4" };
|
|
117
117
|
}
|
|
118
118
|
function j(e11) {
|
|
119
119
|
return M(w, e11, "resource_");
|
|
120
120
|
}
|
|
121
|
-
function
|
|
122
|
-
return M(
|
|
121
|
+
function Ie(e11) {
|
|
122
|
+
return M(xe, e11, "component_");
|
|
123
123
|
}
|
|
124
|
-
function
|
|
125
|
-
let t2 = e11 instanceof Map ? e11 : new Map(Object.entries(e11)), n2 = new TextEncoder(), r2 = [...t2.entries()].sort(([e12], [t3]) =>
|
|
126
|
-
I(i2, O, BigInt(
|
|
124
|
+
function Le(e11) {
|
|
125
|
+
let t2 = e11 instanceof Map ? e11 : new Map(Object.entries(e11)), n2 = new TextEncoder(), r2 = [...t2.entries()].sort(([e12], [t3]) => Je(n2.encode(e12), n2.encode(t3))), i2 = [];
|
|
126
|
+
I(i2, O, BigInt(Se)), I(i2, Ae, BigInt(r2.length));
|
|
127
127
|
for (let [e12, t3] of r2) P(i2, e12), P(i2, t3);
|
|
128
128
|
return L(i2);
|
|
129
129
|
}
|
|
130
|
-
function
|
|
131
|
-
return M(
|
|
130
|
+
function Re(e11) {
|
|
131
|
+
return M(we, e11, "vault_");
|
|
132
132
|
}
|
|
133
|
-
function
|
|
134
|
-
return A(
|
|
133
|
+
function ze(e11) {
|
|
134
|
+
return A(Ge(e11, "template_"));
|
|
135
135
|
}
|
|
136
|
-
function
|
|
137
|
-
return M(
|
|
136
|
+
function Be(e11) {
|
|
137
|
+
return M(Te, e11, "tombstone_");
|
|
138
138
|
}
|
|
139
|
-
function
|
|
140
|
-
return M(
|
|
139
|
+
function Ve(e11) {
|
|
140
|
+
return M(Ee, e11, "vnfp_");
|
|
141
141
|
}
|
|
142
|
-
function
|
|
142
|
+
function He(e11) {
|
|
143
143
|
let t2 = typeof e11 == "string" ? x(e11) : e11;
|
|
144
|
-
return y(t2,
|
|
144
|
+
return y(t2, be, "publicKeyLiteral"), A(t2);
|
|
145
145
|
}
|
|
146
|
-
function
|
|
146
|
+
function Ue(e11) {
|
|
147
147
|
let t2 = [];
|
|
148
|
-
return I(t2, O, BigInt(
|
|
148
|
+
return I(t2, O, BigInt(Ce)), I(t2, D, 2n), N(t2, w, e11.resource_address, "resource_"), Ke(t2, e11.id), L(t2);
|
|
149
149
|
}
|
|
150
|
-
function
|
|
150
|
+
function We(e11) {
|
|
151
151
|
let t2 = [];
|
|
152
|
-
I(t2, O, BigInt(
|
|
152
|
+
I(t2, O, BigInt(De)), I(t2, D, 2n), N(t2, w, e11.resource_address, "resource_");
|
|
153
153
|
let n2 = x(e11.id);
|
|
154
154
|
return y(n2, C, "utxoAddressLiteral: id"), I(t2, E, BigInt(C)), F(t2, n2), L(t2);
|
|
155
155
|
}
|
|
@@ -158,25 +158,25 @@ function M(e11, t2, n2) {
|
|
|
158
158
|
return N(r2, e11, t2, n2), L(r2);
|
|
159
159
|
}
|
|
160
160
|
function N(e11, t2, n2, r2) {
|
|
161
|
-
let i2 =
|
|
161
|
+
let i2 = Ge(n2, r2);
|
|
162
162
|
I(e11, O, BigInt(t2)), I(e11, E, BigInt(C)), F(e11, i2);
|
|
163
163
|
}
|
|
164
|
-
function
|
|
164
|
+
function Ge(e11, t2) {
|
|
165
165
|
let n2 = e11.startsWith(t2) ? e11.slice(t2.length) : e11;
|
|
166
|
-
if (n2.length !==
|
|
166
|
+
if (n2.length !== ye) throw new v(`${t2}address must be 32 bytes (${ye} hex chars), got ${n2.length}`);
|
|
167
167
|
return x(n2);
|
|
168
168
|
}
|
|
169
|
-
function
|
|
169
|
+
function Ke(e11, t2) {
|
|
170
170
|
if (I(e11, D, 2n), "U256" in t2) {
|
|
171
171
|
I(e11, T, 0n), I(e11, D, 1n);
|
|
172
172
|
let n2 = x(t2.U256);
|
|
173
173
|
y(n2, C, "NonFungibleId.U256"), I(e11, E, BigInt(C)), F(e11, n2);
|
|
174
174
|
} else if ("String" in t2) I(e11, T, 1n), I(e11, D, 1n), P(e11, t2.String);
|
|
175
|
-
else if ("Uint32" in t2) I(e11, T, 2n), I(e11, D, 1n),
|
|
176
|
-
else if ("Uint64" in t2) I(e11, T, 3n), I(e11, D, 1n),
|
|
175
|
+
else if ("Uint32" in t2) I(e11, T, 2n), I(e11, D, 1n), qe(e11, t2.Uint32, "NonFungibleId.Uint32", (1n << 32n) - 1n);
|
|
176
|
+
else if ("Uint64" in t2) I(e11, T, 3n), I(e11, D, 1n), qe(e11, t2.Uint64, "NonFungibleId.Uint64", S);
|
|
177
177
|
else throw new v(`nonFungibleAddressLiteral: unrecognised NonFungibleId variant: ${JSON.stringify(t2)}`);
|
|
178
178
|
}
|
|
179
|
-
function
|
|
179
|
+
function qe(e11, t2, n2, r2) {
|
|
180
180
|
if (!Number.isInteger(t2) || t2 < 0) throw new v(`${n2} must be a non-negative integer, got ${t2}`);
|
|
181
181
|
if (r2 > BigInt(2 ** 53 - 1) && t2 > 2 ** 53 - 1) throw new v(`${n2} value ${t2} exceeds Number.MAX_SAFE_INTEGER (2^53-1) and cannot be encoded without precision loss \u2014 the binding types this id as a JS number. Use a U256/String id for large values.`);
|
|
182
182
|
let i2 = BigInt(t2);
|
|
@@ -185,14 +185,14 @@ function We(e11, t2, n2, r2) {
|
|
|
185
185
|
}
|
|
186
186
|
function P(e11, t2) {
|
|
187
187
|
let n2 = new TextEncoder().encode(t2);
|
|
188
|
-
I(e11,
|
|
188
|
+
I(e11, ke, BigInt(n2.length)), F(e11, n2);
|
|
189
189
|
}
|
|
190
190
|
function F(e11, t2) {
|
|
191
191
|
let n2 = e11.length;
|
|
192
192
|
e11.length = n2 + t2.length;
|
|
193
193
|
for (let r2 = 0; r2 < t2.length; r2++) e11[n2 + r2] = t2[r2];
|
|
194
194
|
}
|
|
195
|
-
function
|
|
195
|
+
function Je(e11, t2) {
|
|
196
196
|
let n2 = Math.min(e11.length, t2.length);
|
|
197
197
|
for (let r2 = 0; r2 < n2; r2++) if (e11[r2] !== t2[r2]) return e11[r2] < t2[r2] ? -1 : 1;
|
|
198
198
|
return e11.length - t2.length;
|
|
@@ -206,11 +206,11 @@ function L(e11) {
|
|
|
206
206
|
function R(e11) {
|
|
207
207
|
return k(e11);
|
|
208
208
|
}
|
|
209
|
-
function
|
|
209
|
+
function Ye(e11) {
|
|
210
210
|
if (e11 < 0n) throw new v(`microTariString: amount must be non-negative, got ${e11}`);
|
|
211
211
|
return e11.toString();
|
|
212
212
|
}
|
|
213
|
-
function
|
|
213
|
+
function Xe(e11) {
|
|
214
214
|
let t2 = e11.split(".");
|
|
215
215
|
if (t2.length > 2) throw new v("Invalid workspace key format. Only one dot is allowed.");
|
|
216
216
|
let n2 = t2[0];
|
|
@@ -225,24 +225,24 @@ function qe(e11) {
|
|
|
225
225
|
offset: r2
|
|
226
226
|
};
|
|
227
227
|
}
|
|
228
|
-
var
|
|
229
|
-
async function
|
|
228
|
+
var Ze = 2160, Qe = 10;
|
|
229
|
+
async function $e(e11, t2 = 10) {
|
|
230
230
|
if (!Number.isInteger(t2) || t2 < 1) throw new v(`resolveMaxEpoch: leadEpochs must be a positive integer, got ${t2}`);
|
|
231
|
-
if (t2 > 2160) throw new v(`resolveMaxEpoch: leadEpochs ${t2} exceeds the network's maximum validity window of ${
|
|
231
|
+
if (t2 > 2160) throw new v(`resolveMaxEpoch: leadEpochs ${t2} exceeds the network's maximum validity window of ${Ze} epochs`);
|
|
232
232
|
return await e11.getCurrentEpoch() + t2;
|
|
233
233
|
}
|
|
234
|
-
var
|
|
234
|
+
var et = (1n << 64n) - 1n;
|
|
235
235
|
function z(e11, t2) {
|
|
236
236
|
if (!Number.isInteger(e11) || e11 < 0) throw new v(`${t2} must be a non-negative integer epoch, got ${e11}`);
|
|
237
237
|
return e11;
|
|
238
238
|
}
|
|
239
|
-
function
|
|
239
|
+
function tt(e11) {
|
|
240
240
|
return e11.startsWith("template_") ? e11.slice(9) : e11;
|
|
241
241
|
}
|
|
242
|
-
function
|
|
242
|
+
function nt(e11) {
|
|
243
243
|
return typeof e11 != "object" || !e11 ? null : "PutLastInstructionOutputOnWorkspace" in e11 ? e11.PutLastInstructionOutputOnWorkspace.key : "TakeFromBucket" in e11 ? e11.TakeFromBucket.output_bucket : "AllocateAddress" in e11 ? e11.AllocateAddress.workspace_id : null;
|
|
244
244
|
}
|
|
245
|
-
var
|
|
245
|
+
var rt = class {
|
|
246
246
|
constructor() {
|
|
247
247
|
__publicField(this, "nextId", 0);
|
|
248
248
|
__publicField(this, "ids", /* @__PURE__ */ new Map());
|
|
@@ -266,12 +266,12 @@ var et = class {
|
|
|
266
266
|
resetFrom(e11) {
|
|
267
267
|
this.reset();
|
|
268
268
|
for (let t2 of e11) {
|
|
269
|
-
let e12 =
|
|
269
|
+
let e12 = nt(t2);
|
|
270
270
|
e12 !== null && this.observeAllocated(e12);
|
|
271
271
|
}
|
|
272
272
|
}
|
|
273
273
|
};
|
|
274
|
-
function
|
|
274
|
+
function it(e11) {
|
|
275
275
|
return new v(`No workspace variable named "${e11}" has been defined. Call builder.saveVar(${JSON.stringify(e11)}) on a preceding instruction whose output you want to reference.`);
|
|
276
276
|
}
|
|
277
277
|
var B = class e2 {
|
|
@@ -290,7 +290,7 @@ var B = class e2 {
|
|
|
290
290
|
main_signer: "None",
|
|
291
291
|
blobs: [],
|
|
292
292
|
nonce: 0
|
|
293
|
-
}, this.workspaceIds = new
|
|
293
|
+
}, this.workspaceIds = new rt(), this.feeWorkspaceIds = new rt();
|
|
294
294
|
}
|
|
295
295
|
static new(t2, n2) {
|
|
296
296
|
return new e2(t2, n2);
|
|
@@ -298,7 +298,7 @@ var B = class e2 {
|
|
|
298
298
|
callFunction(e11, t2) {
|
|
299
299
|
let n2 = this.resolveArgs(t2);
|
|
300
300
|
return this.addInstruction({ CallFunction: {
|
|
301
|
-
address:
|
|
301
|
+
address: tt(e11.templateAddress),
|
|
302
302
|
function: e11.functionName,
|
|
303
303
|
args: n2
|
|
304
304
|
} });
|
|
@@ -392,7 +392,7 @@ var B = class e2 {
|
|
|
392
392
|
}
|
|
393
393
|
observeAllocations(e11, t2) {
|
|
394
394
|
for (let n2 of t2) {
|
|
395
|
-
let t3 =
|
|
395
|
+
let t3 = nt(n2);
|
|
396
396
|
t3 !== null && e11.observeAllocated(t3);
|
|
397
397
|
}
|
|
398
398
|
}
|
|
@@ -401,10 +401,10 @@ var B = class e2 {
|
|
|
401
401
|
return this.unsignedTransaction.fee_instructions = n2.unsignedTransaction.instructions, this.feeWorkspaceIds.resetFrom(this.unsignedTransaction.fee_instructions), this;
|
|
402
402
|
}
|
|
403
403
|
addInput(e11) {
|
|
404
|
-
return this.unsignedTransaction.inputs.push(
|
|
404
|
+
return this.unsignedTransaction.inputs.push(at(e11)), this;
|
|
405
405
|
}
|
|
406
406
|
withInputs(e11) {
|
|
407
|
-
return this.unsignedTransaction.inputs.push(...e11.map(
|
|
407
|
+
return this.unsignedTransaction.inputs.push(...e11.map(at)), this;
|
|
408
408
|
}
|
|
409
409
|
withMainSigner(e11) {
|
|
410
410
|
return this.unsignedTransaction.main_signer = e11, this;
|
|
@@ -418,7 +418,7 @@ var B = class e2 {
|
|
|
418
418
|
withNonce(e11) {
|
|
419
419
|
if (typeof e11 == "number" && !Number.isInteger(e11)) throw new v(`withNonce: nonce must be an integer, got ${e11}`);
|
|
420
420
|
let t2 = typeof e11 == "bigint" ? e11 : BigInt(e11);
|
|
421
|
-
if (t2 < 0n || t2 >
|
|
421
|
+
if (t2 < 0n || t2 > et) throw new v(`withNonce: nonce must fit an unsigned 64-bit integer, got ${e11}`);
|
|
422
422
|
return this.unsignedTransaction.nonce = t2 > BigInt(2 ** 53 - 1) ? t2 : Number(t2), this;
|
|
423
423
|
}
|
|
424
424
|
withUnsignedTransaction(e11) {
|
|
@@ -449,11 +449,11 @@ var B = class e2 {
|
|
|
449
449
|
}
|
|
450
450
|
requireNamedId(e11) {
|
|
451
451
|
let t2 = this.workspaceIds.get(e11);
|
|
452
|
-
if (t2 === void 0) throw
|
|
452
|
+
if (t2 === void 0) throw it(e11);
|
|
453
453
|
return t2;
|
|
454
454
|
}
|
|
455
455
|
getOffsetIdFromWorkspaceName(e11) {
|
|
456
|
-
let t2 =
|
|
456
|
+
let t2 = Xe(e11);
|
|
457
457
|
return {
|
|
458
458
|
id: this.requireNamedId(t2.name),
|
|
459
459
|
offset: t2.offset
|
|
@@ -463,19 +463,19 @@ var B = class e2 {
|
|
|
463
463
|
return e11.map((e12) => typeof e12 == "object" && e12 && "Workspace" in e12 && typeof e12.Workspace == "string" ? { Workspace: this.getOffsetIdFromWorkspaceName(e12.Workspace) } : e12);
|
|
464
464
|
}
|
|
465
465
|
};
|
|
466
|
-
function
|
|
466
|
+
function at(e11) {
|
|
467
467
|
return {
|
|
468
468
|
substate_id: e11.substate_id,
|
|
469
469
|
version: e11.version,
|
|
470
470
|
is_write: "is_write" in e11 ? e11.is_write : true
|
|
471
471
|
};
|
|
472
472
|
}
|
|
473
|
-
var
|
|
473
|
+
var ot = {
|
|
474
474
|
[u.LocalNet]: "http://localhost:12500",
|
|
475
475
|
[u.Esmeralda]: "https://ootle-indexer-a.tari.com"
|
|
476
476
|
};
|
|
477
|
-
function
|
|
478
|
-
let t2 =
|
|
477
|
+
function st(e11) {
|
|
478
|
+
let t2 = ot[e11];
|
|
479
479
|
if (t2 !== void 0) return t2;
|
|
480
480
|
throw new v(`No default indexer URL is configured for ${u[e11]}. Pass an explicit URL via ProviderBuilder.withUrl(...) or IndexerProvider.connect({ url, network: Network.${u[e11]} }).`);
|
|
481
481
|
}
|
|
@@ -491,35 +491,35 @@ function V(e11, t2, n2) {
|
|
|
491
491
|
}
|
|
492
492
|
return JSON.parse(r2);
|
|
493
493
|
}
|
|
494
|
-
function at(e11) {
|
|
495
|
-
return V("decodeSubstateValue", se, e11);
|
|
496
|
-
}
|
|
497
|
-
function ot(e11) {
|
|
498
|
-
return V("decodeExecuteResult", ae, e11);
|
|
499
|
-
}
|
|
500
|
-
function st(e11) {
|
|
501
|
-
return V("decodeTransactionReceipt", ce, e11);
|
|
502
|
-
}
|
|
503
494
|
function ct(e11) {
|
|
504
|
-
return V("
|
|
495
|
+
return V("decodeSubstateValue", ue, e11);
|
|
505
496
|
}
|
|
506
497
|
function lt(e11) {
|
|
507
|
-
return V("
|
|
498
|
+
return V("decodeExecuteResult", ce, e11);
|
|
508
499
|
}
|
|
509
500
|
function ut(e11) {
|
|
510
|
-
return V("
|
|
501
|
+
return V("decodeTransactionReceipt", de, e11);
|
|
502
|
+
}
|
|
503
|
+
function dt(e11) {
|
|
504
|
+
return V("decodeEvent", se, e11);
|
|
505
|
+
}
|
|
506
|
+
function ft(e11) {
|
|
507
|
+
return V("decodeResource", le, e11);
|
|
508
|
+
}
|
|
509
|
+
function pt(e11) {
|
|
510
|
+
return V("decodeUtxo", fe, e11);
|
|
511
511
|
}
|
|
512
512
|
function H(e11) {
|
|
513
|
-
return "up" in e11.state ?
|
|
513
|
+
return "up" in e11.state ? ct(e11.state.up.substate) : null;
|
|
514
514
|
}
|
|
515
|
-
var
|
|
516
|
-
function*
|
|
515
|
+
var mt = 132, ht = 32;
|
|
516
|
+
function* gt(e11) {
|
|
517
517
|
let t2 = /* @__PURE__ */ new Set();
|
|
518
|
-
for (let n2 of U(e11,
|
|
518
|
+
for (let n2 of U(e11, mt)) n2.length === ht * 2 && !t2.has(n2) && (t2.add(n2), yield `vault_${n2}`);
|
|
519
519
|
}
|
|
520
|
-
async function
|
|
520
|
+
async function _t(e11, t2) {
|
|
521
521
|
let n2 = H(await e11.getSubstate(t2));
|
|
522
|
-
return
|
|
522
|
+
return yt(n2) ? Array.from(gt(n2.Component.body.state)) : [];
|
|
523
523
|
}
|
|
524
524
|
function* U(e11, t2) {
|
|
525
525
|
if (Array.isArray(e11)) {
|
|
@@ -532,7 +532,7 @@ function* U(e11, t2) {
|
|
|
532
532
|
if (r2 === "tag") {
|
|
533
533
|
let e12 = n2.value;
|
|
534
534
|
if (n2.tag === t2) {
|
|
535
|
-
let t3 =
|
|
535
|
+
let t3 = vt(e12);
|
|
536
536
|
t3 !== null && (yield t3);
|
|
537
537
|
}
|
|
538
538
|
yield* U(e12, t2);
|
|
@@ -544,18 +544,18 @@ function* U(e11, t2) {
|
|
|
544
544
|
}
|
|
545
545
|
for (let e12 of Object.values(n2)) yield* U(e12, t2);
|
|
546
546
|
}
|
|
547
|
-
function
|
|
547
|
+
function vt(e11) {
|
|
548
548
|
if (typeof e11 != "object" || !e11) return null;
|
|
549
549
|
let t2 = e11;
|
|
550
550
|
if (t2["@cbor"] !== "bytes") return null;
|
|
551
551
|
let n2 = t2.hex;
|
|
552
552
|
return typeof n2 == "string" ? n2 : null;
|
|
553
553
|
}
|
|
554
|
-
function
|
|
554
|
+
function yt(e11) {
|
|
555
555
|
return typeof e11 == "object" && !!e11 && "Component" in e11;
|
|
556
556
|
}
|
|
557
|
-
var
|
|
558
|
-
function
|
|
557
|
+
var bt = "resource_0101010101010101010101010101010101010101010101010101010101010101", xt = "component_0102030000000000000000000000000000000000000000000000000000000000", St = "vault_0102030000000000000000000000000000000000000000000000000000000001", Ct = "resource_0102030000000000000000000000000000000000000000000000000000000002", wt = "__ootleRawJson", Tt = "stealth_revealed_input", Et = "stealth_revealed_change";
|
|
558
|
+
function Dt(e11, t2) {
|
|
559
559
|
let n2 = e11.revealedInputBucket === null ? null : t2(e11.revealedInputBucket);
|
|
560
560
|
return { StealthTransfer: {
|
|
561
561
|
resource_address_ref: { Address: e11.resourceAddress },
|
|
@@ -564,7 +564,7 @@ function wt(e11, t2) {
|
|
|
564
564
|
} };
|
|
565
565
|
}
|
|
566
566
|
function W(e11) {
|
|
567
|
-
return { [
|
|
567
|
+
return { [wt]: e11.toCompactJson() };
|
|
568
568
|
}
|
|
569
569
|
function G(e11) {
|
|
570
570
|
return typeof e11 == "object" && !!e11 && "StealthTransfer" in e11;
|
|
@@ -574,7 +574,7 @@ function K(e11) {
|
|
|
574
574
|
if (typeof r3 == "bigint") return r3.toString();
|
|
575
575
|
if (typeof r3 == "object" && r3 && "__ootleRawJson" in r3) {
|
|
576
576
|
let e13 = n2(t2.length);
|
|
577
|
-
return t2.push(r3[
|
|
577
|
+
return t2.push(r3[wt]), e13;
|
|
578
578
|
}
|
|
579
579
|
return r3;
|
|
580
580
|
});
|
|
@@ -593,14 +593,14 @@ async function q(e11, t2) {
|
|
|
593
593
|
inputs: n2
|
|
594
594
|
};
|
|
595
595
|
}
|
|
596
|
-
function
|
|
597
|
-
let { secret_key: e11, public_key: t2 } =
|
|
596
|
+
function Ot() {
|
|
597
|
+
let { secret_key: e11, public_key: t2 } = o();
|
|
598
598
|
return {
|
|
599
599
|
secret_key: e11,
|
|
600
600
|
public_key: t2
|
|
601
601
|
};
|
|
602
602
|
}
|
|
603
|
-
function
|
|
603
|
+
function kt(e11, t2) {
|
|
604
604
|
return {
|
|
605
605
|
public_key: b(y(e11, 32, "publicKey")),
|
|
606
606
|
signature: b(y(t2, 64, "sr25519 signature"))
|
|
@@ -614,35 +614,35 @@ async function J(e11, t2) {
|
|
|
614
614
|
main_signer: { Authorizer: b(n2) }
|
|
615
615
|
};
|
|
616
616
|
}
|
|
617
|
-
async function
|
|
618
|
-
return
|
|
617
|
+
async function At(e11, t2, n2) {
|
|
618
|
+
return jt(e11, await J(e11, t2), n2);
|
|
619
619
|
}
|
|
620
|
-
async function
|
|
621
|
-
let r2 = n2 ??
|
|
620
|
+
async function jt(e11, t2, n2) {
|
|
621
|
+
let r2 = n2 ?? o(), i2 = y(r2.secret_key, 32, "sealKeypair.secret_key"), a2 = y(r2.public_key, 32, "sealKeypair.public_key"), s2 = [];
|
|
622
622
|
for (let n3 of e11) {
|
|
623
|
-
let e12 = await n3.signTransaction(t2,
|
|
623
|
+
let e12 = await n3.signTransaction(t2, a2);
|
|
624
624
|
s2.push(...e12);
|
|
625
625
|
}
|
|
626
|
-
let c2 =
|
|
626
|
+
let c2 = ne(`{"transaction":${K(t2)},"signatures":${JSON.stringify(s2)}}`, i2);
|
|
627
627
|
return {
|
|
628
628
|
sealedJson: c2,
|
|
629
629
|
transaction: JSON.parse(c2)
|
|
630
630
|
};
|
|
631
631
|
}
|
|
632
632
|
function Y(e11) {
|
|
633
|
-
return
|
|
633
|
+
return n(e11.sealedJson);
|
|
634
634
|
}
|
|
635
|
-
async function
|
|
635
|
+
async function Mt(e11, t2) {
|
|
636
636
|
return (await e11.submitTransaction(t2)).transaction_id;
|
|
637
637
|
}
|
|
638
|
-
function
|
|
638
|
+
function Nt(e11) {
|
|
639
639
|
var _a;
|
|
640
640
|
if (e11 === "Pending" || !("Finalized" in e11)) return null;
|
|
641
641
|
let t2 = e11.Finalized, n2 = t2.final_decision;
|
|
642
642
|
if (n2 === null) return null;
|
|
643
643
|
if (n2 === "Commit") return { outcome: n2 };
|
|
644
644
|
if (typeof n2 == "object" && n2 && "Abort" in n2) {
|
|
645
|
-
let e12 = t2.abort_details ?? JSON.stringify(n2.Abort), r2 = t2.execution_result === null ? void 0 : (_a =
|
|
645
|
+
let e12 = t2.abort_details ?? JSON.stringify(n2.Abort), r2 = t2.execution_result === null ? void 0 : (_a = lt(t2.execution_result).finalize) == null ? void 0 : _a.result;
|
|
646
646
|
return typeof r2 == "object" && r2 && "AcceptFeeRejectRest" in r2 ? {
|
|
647
647
|
outcome: "FeeIntentCommit",
|
|
648
648
|
reason: e12
|
|
@@ -653,12 +653,12 @@ function At(e11) {
|
|
|
653
653
|
}
|
|
654
654
|
throw new v(`Unexpected final_decision variant: ${JSON.stringify(n2)}`);
|
|
655
655
|
}
|
|
656
|
-
async function
|
|
656
|
+
async function Pt(e11, t2, n2) {
|
|
657
657
|
let r2 = (n2 == null ? void 0 : n2.pollIntervalMs) ?? 500, i2 = (n2 == null ? void 0 : n2.timeoutMs) ?? 6e4, a2 = Date.now() + i2;
|
|
658
658
|
for (; ; ) {
|
|
659
659
|
let n3 = await e11.getTransactionResult(t2), o2 = n3.result;
|
|
660
660
|
if (o2 !== "Pending" && "Finalized" in o2) {
|
|
661
|
-
let { outcome: e12, reason: r3 } =
|
|
661
|
+
let { outcome: e12, reason: r3 } = Nt(o2) ?? { outcome: "Reject" };
|
|
662
662
|
if (e12 === "Reject") throw new f(`Transaction ${t2} was rejected: ${r3}`, {
|
|
663
663
|
txId: t2,
|
|
664
664
|
reason: r3 ?? ""
|
|
@@ -669,21 +669,54 @@ async function jt(e11, t2, n2) {
|
|
|
669
669
|
});
|
|
670
670
|
return n3;
|
|
671
671
|
}
|
|
672
|
-
if (Date.now() >= a2) throw new
|
|
672
|
+
if (Date.now() >= a2) throw new me(`Transaction ${t2} did not finalize within ${i2}ms`, { txId: t2 });
|
|
673
673
|
await new Promise((e12) => setTimeout(e12, r2));
|
|
674
674
|
}
|
|
675
675
|
}
|
|
676
|
-
async function
|
|
676
|
+
async function Ft(e11, t2, n2, r2) {
|
|
677
677
|
let i2 = await q(e11, n2);
|
|
678
|
-
return
|
|
678
|
+
return Pt(e11, await Mt(e11, Y(await At(Array.isArray(t2) ? t2 : [t2], i2))), r2);
|
|
679
679
|
}
|
|
680
|
-
async function
|
|
681
|
-
return
|
|
680
|
+
async function It(e11, t2, n2, r2) {
|
|
681
|
+
return Ft(e11, t2, {
|
|
682
682
|
...n2,
|
|
683
683
|
dry_run: true
|
|
684
684
|
}, r2);
|
|
685
685
|
}
|
|
686
|
-
var
|
|
686
|
+
var Lt = class {
|
|
687
|
+
constructor(e11) {
|
|
688
|
+
__publicField(this, "publicKey");
|
|
689
|
+
__publicField(this, "sign");
|
|
690
|
+
__publicField(this, "address");
|
|
691
|
+
this.publicKey = y(e11.publicKey, 32, "ExternalKeySigner publicKey"), y(e11.viewPublicKey, 32, "ExternalKeySigner viewPublicKey"), this.sign = e11.sign, this.address = s(this.publicKey, e11.viewPublicKey, e11.network);
|
|
692
|
+
}
|
|
693
|
+
async getAddress() {
|
|
694
|
+
return Promise.resolve(this.address);
|
|
695
|
+
}
|
|
696
|
+
async getPublicKey() {
|
|
697
|
+
return Promise.resolve(this.publicKey);
|
|
698
|
+
}
|
|
699
|
+
async signTransaction(e11, n2) {
|
|
700
|
+
y(n2, 32, "ExternalKeySigner.signTransaction sealPublicKey");
|
|
701
|
+
let r2 = K(e11), i2 = ee(r2, n2), a2;
|
|
702
|
+
try {
|
|
703
|
+
a2 = await this.sign(i2);
|
|
704
|
+
} catch (e12) {
|
|
705
|
+
throw new g(`External signer failed: ${Rt(e12)}`, { cause: e12 });
|
|
706
|
+
}
|
|
707
|
+
let o2;
|
|
708
|
+
try {
|
|
709
|
+
o2 = t(r2, this.publicKey, a2, n2);
|
|
710
|
+
} catch (e12) {
|
|
711
|
+
throw new g(`External signature rejected: ${Rt(e12)}`, { cause: e12 });
|
|
712
|
+
}
|
|
713
|
+
return JSON.parse(o2).signatures;
|
|
714
|
+
}
|
|
715
|
+
};
|
|
716
|
+
function Rt(e11) {
|
|
717
|
+
return e11 instanceof Error ? e11.message : String(e11);
|
|
718
|
+
}
|
|
719
|
+
var zt = class {
|
|
687
720
|
constructor(e11, t2) {
|
|
688
721
|
__publicField(this, "builder");
|
|
689
722
|
this.builder = B.new(e11, t2);
|
|
@@ -709,7 +742,7 @@ var Pt = class {
|
|
|
709
742
|
build() {
|
|
710
743
|
return this.builder.buildUnsignedTransaction();
|
|
711
744
|
}
|
|
712
|
-
},
|
|
745
|
+
}, Bt = class {
|
|
713
746
|
constructor(e11, t2, n2) {
|
|
714
747
|
__publicField(this, "builder");
|
|
715
748
|
__publicField(this, "faucetAddress");
|
|
@@ -746,7 +779,7 @@ var Pt = class {
|
|
|
746
779
|
build() {
|
|
747
780
|
return this.builder.buildUnsignedTransaction();
|
|
748
781
|
}
|
|
749
|
-
},
|
|
782
|
+
}, Vt = class {
|
|
750
783
|
constructor() {
|
|
751
784
|
__publicField(this, "keyProviders");
|
|
752
785
|
__publicField(this, "defaultSignerAddress", null);
|
|
@@ -792,7 +825,7 @@ var Pt = class {
|
|
|
792
825
|
if (n2 === void 0) throw new m(t2 === "default" ? `No key provider registered for default address: ${e11}. Call wallet.registerKeyProvider(address, signer) for that address, or pick a different default with setDefaultSigner(otherAddress).` : `No key provider registered for address: ${e11}. Call wallet.registerKeyProvider(${JSON.stringify(e11)}, signer) before signing.`, { address: e11 });
|
|
793
826
|
return n2;
|
|
794
827
|
}
|
|
795
|
-
},
|
|
828
|
+
}, Ht = class {
|
|
796
829
|
constructor(e11, t2) {
|
|
797
830
|
__publicField(this, "bytes");
|
|
798
831
|
this.bytes = new Uint8Array(y(e11, 32, t2));
|
|
@@ -803,7 +836,7 @@ var Pt = class {
|
|
|
803
836
|
toHex() {
|
|
804
837
|
return b(this.bytes);
|
|
805
838
|
}
|
|
806
|
-
}, X = class e3 extends
|
|
839
|
+
}, X = class e3 extends Ht {
|
|
807
840
|
constructor(e11) {
|
|
808
841
|
super(e11, "Mask");
|
|
809
842
|
}
|
|
@@ -816,7 +849,7 @@ var Pt = class {
|
|
|
816
849
|
static fromHex(t2) {
|
|
817
850
|
return new e3(x(t2));
|
|
818
851
|
}
|
|
819
|
-
},
|
|
852
|
+
}, Ut = class e4 {
|
|
820
853
|
constructor(e11) {
|
|
821
854
|
__publicField(this, "bytes");
|
|
822
855
|
this.bytes = new Uint8Array(e11);
|
|
@@ -830,8 +863,8 @@ var Pt = class {
|
|
|
830
863
|
toHex() {
|
|
831
864
|
return b(this.bytes);
|
|
832
865
|
}
|
|
833
|
-
},
|
|
834
|
-
function
|
|
866
|
+
}, Wt = Object.freeze({ StealthPublicKey: Object.freeze({}) });
|
|
867
|
+
function Gt(e11) {
|
|
835
868
|
if (e11.amount <= 0n) throw new v(`Output amount must be > 0, got ${e11.amount}`);
|
|
836
869
|
return {
|
|
837
870
|
destination: e11.destination,
|
|
@@ -839,19 +872,19 @@ function Bt(e11) {
|
|
|
839
872
|
resourceAddress: e11.resourceAddress,
|
|
840
873
|
resourceViewKey: e11.resourceViewKey === void 0 ? void 0 : new Uint8Array(e11.resourceViewKey),
|
|
841
874
|
memo: e11.memo,
|
|
842
|
-
payTo: e11.payTo ??
|
|
875
|
+
payTo: e11.payTo ?? Wt,
|
|
843
876
|
minimumValuePromise: e11.minimumValuePromise ?? 0n
|
|
844
877
|
};
|
|
845
878
|
}
|
|
846
|
-
function
|
|
879
|
+
function Kt(e11, t2) {
|
|
847
880
|
if (e11.trim() === "") throw new v(`${t2} must be a non-empty decimal string`);
|
|
848
881
|
return BigInt(e11);
|
|
849
882
|
}
|
|
850
|
-
function
|
|
883
|
+
function qt(e11, t2) {
|
|
851
884
|
let n2 = e11.trim();
|
|
852
885
|
if (!n2.startsWith("{") || !n2.endsWith("}")) throw new v(`StealthTransferStatement.toCompactJson: ${t2} fragment is not a JSON object (got: ${e11.slice(0, 60)}...)`);
|
|
853
886
|
}
|
|
854
|
-
var
|
|
887
|
+
var Jt = class e5 extends Ht {
|
|
855
888
|
constructor(e11) {
|
|
856
889
|
super(e11, "StealthInput.commitment");
|
|
857
890
|
}
|
|
@@ -864,7 +897,7 @@ var Z = class e5 extends Lt {
|
|
|
864
897
|
static fromJSON(t2) {
|
|
865
898
|
return new e5(x(t2.commitment));
|
|
866
899
|
}
|
|
867
|
-
},
|
|
900
|
+
}, Z = class e6 {
|
|
868
901
|
constructor(e11, t2) {
|
|
869
902
|
__publicField(this, "_publicNonce");
|
|
870
903
|
__publicField(this, "_signature");
|
|
@@ -885,7 +918,7 @@ var Z = class e5 extends Lt {
|
|
|
885
918
|
static fromJSON(t2) {
|
|
886
919
|
return new e6(x(t2.public_nonce), x(t2.signature));
|
|
887
920
|
}
|
|
888
|
-
},
|
|
921
|
+
}, Yt = class e7 {
|
|
889
922
|
constructor(e11, t2, n2) {
|
|
890
923
|
__publicField(this, "inputs");
|
|
891
924
|
__publicField(this, "revealedAmount");
|
|
@@ -898,13 +931,13 @@ var Z = class e5 extends Lt {
|
|
|
898
931
|
toJSON() {
|
|
899
932
|
return {
|
|
900
933
|
inputs: this.inputs.map((e11) => e11.toJSON()),
|
|
901
|
-
revealed_amount:
|
|
934
|
+
revealed_amount: Ye(this.revealedAmount)
|
|
902
935
|
};
|
|
903
936
|
}
|
|
904
937
|
static fromJSON(t2) {
|
|
905
|
-
return new e7(t2.inputs.map(
|
|
938
|
+
return new e7(t2.inputs.map(Jt.fromJSON), Kt(t2.revealed_amount, "revealed_amount"));
|
|
906
939
|
}
|
|
907
|
-
},
|
|
940
|
+
}, Xt = class e8 {
|
|
908
941
|
constructor(e11) {
|
|
909
942
|
__publicField(this, "statementJson");
|
|
910
943
|
this.statementJson = e11;
|
|
@@ -918,7 +951,7 @@ var Z = class e5 extends Lt {
|
|
|
918
951
|
static fromJSON(t2) {
|
|
919
952
|
return new e8(t2);
|
|
920
953
|
}
|
|
921
|
-
},
|
|
954
|
+
}, Q = class e9 {
|
|
922
955
|
constructor(e11, t2, n2) {
|
|
923
956
|
__publicField(this, "inputsStatement");
|
|
924
957
|
__publicField(this, "outputsStatement");
|
|
@@ -934,15 +967,15 @@ var Z = class e5 extends Lt {
|
|
|
934
967
|
}
|
|
935
968
|
toCompactJson() {
|
|
936
969
|
let e11 = this.inputsStatement.statementJson ?? JSON.stringify(this.inputsStatement.toJSON()), t2 = this.outputsStatement.statementJson;
|
|
937
|
-
|
|
970
|
+
qt(e11, "inputs_statement"), qt(t2, "outputs_statement");
|
|
938
971
|
let n2 = `{"inputs_statement":${e11},"outputs_statement":${t2},"covenant_claims":[]`;
|
|
939
972
|
return this.balanceProof !== void 0 && (n2 += `,"balance_proof":${JSON.stringify(this.balanceProof.toJSON())}`), n2 + "}";
|
|
940
973
|
}
|
|
941
974
|
static fromJSON(t2) {
|
|
942
|
-
return new e9(
|
|
975
|
+
return new e9(Yt.fromJSON(t2.inputs), Xt.fromJSON(t2.outputs), t2.balance_proof === void 0 ? void 0 : Z.fromJSON(t2.balance_proof));
|
|
943
976
|
}
|
|
944
977
|
};
|
|
945
|
-
function
|
|
978
|
+
function Zt(e11, t2) {
|
|
946
979
|
let n2 = new Uint8Array(e11.length * 32);
|
|
947
980
|
for (let r2 = 0; r2 < e11.length; r2++) {
|
|
948
981
|
let i2 = e11[r2];
|
|
@@ -950,7 +983,7 @@ function Gt(e11, t2) {
|
|
|
950
983
|
}
|
|
951
984
|
return n2;
|
|
952
985
|
}
|
|
953
|
-
var
|
|
986
|
+
var Qt = "[]", $t = class {
|
|
954
987
|
constructor(e11 = u.LocalNet) {
|
|
955
988
|
__publicField(this, "network");
|
|
956
989
|
this.network = e11;
|
|
@@ -958,34 +991,34 @@ var Kt = "[]", qt = class {
|
|
|
958
991
|
async generateOutputsStatement(e11, t2) {
|
|
959
992
|
let n2 = `[${e11.map((e12) => this.outputWitness(e12)).join(",")}]`, r2 = 0n, i2 = new Uint8Array(32);
|
|
960
993
|
t2 !== null && (y(t2.receiver, 32, "revealed output receiver"), r2 = t2.amount, i2 = t2.receiver);
|
|
961
|
-
let a2 =
|
|
994
|
+
let a2 = l(n2, r2, i2);
|
|
962
995
|
return y(a2.aggregated_output_mask, 32, "StealthOutputsResult.aggregated_output_mask"), {
|
|
963
|
-
statement:
|
|
996
|
+
statement: Xt.fromJSON(a2.statement_json),
|
|
964
997
|
outputMask: X.fromBytes(a2.aggregated_output_mask)
|
|
965
998
|
};
|
|
966
999
|
}
|
|
967
1000
|
outputWitness(e11) {
|
|
968
|
-
let t2 =
|
|
969
|
-
return
|
|
1001
|
+
let t2 = te(e11.destination), n2 = en(e11.payTo) ? null : JSON.stringify(e11.payTo), r2 = e11.memo === void 0 ? null : JSON.stringify(e11.memo), a2 = e11.resourceViewKey ?? null;
|
|
1002
|
+
return i(this.network, t2.owner_key, t2.view_key, e11.amount, e11.resourceAddress, a2, r2, n2, e11.minimumValuePromise);
|
|
970
1003
|
}
|
|
971
1004
|
async buildInputsStatement(e11, t2) {
|
|
972
|
-
return new
|
|
1005
|
+
return new Yt(e11, t2, r(Zt(e11.map((e12) => e12.commitment), "input commitment"), t2));
|
|
973
1006
|
}
|
|
974
1007
|
async generateBalanceProofSignature(e11, t2, n2, r2) {
|
|
975
|
-
let i2 =
|
|
976
|
-
return y(i2.public_nonce, 32, "balance proof public_nonce"), y(i2.signature, 32, "balance proof signature"), new
|
|
1008
|
+
let i2 = c(e11.toBytes(), t2.toBytes(), n2, r2, Qt);
|
|
1009
|
+
return y(i2.public_nonce, 32, "balance proof public_nonce"), y(i2.signature, 32, "balance proof signature"), new Z(i2.public_nonce, i2.signature);
|
|
977
1010
|
}
|
|
978
1011
|
async validateBalanceProofSignature(e11, t2, n2) {
|
|
979
|
-
return
|
|
1012
|
+
return ae(e11.publicNonce, e11.signature, t2, n2, Qt);
|
|
980
1013
|
}
|
|
981
1014
|
async deriveAeadKey(e11, t2) {
|
|
982
1015
|
y(e11, 32, "deriveAeadKey privateKey"), y(t2, 32, "deriveAeadKey publicKey");
|
|
983
|
-
let n2 =
|
|
1016
|
+
let n2 = a(e11, t2);
|
|
984
1017
|
return y(n2, 32, "derived AEAD key"), n2;
|
|
985
1018
|
}
|
|
986
1019
|
async unblindOutput(e11, t2, n2, r2) {
|
|
987
1020
|
y(e11, 32, "unblindOutput commitment"), y(n2, 32, "unblindOutput aeadKey");
|
|
988
|
-
let i2 =
|
|
1021
|
+
let i2 = ie(e11, t2, n2, r2);
|
|
989
1022
|
return {
|
|
990
1023
|
mask: X.fromBytes(i2.mask),
|
|
991
1024
|
value: i2.value,
|
|
@@ -993,61 +1026,61 @@ var Kt = "[]", qt = class {
|
|
|
993
1026
|
};
|
|
994
1027
|
}
|
|
995
1028
|
async aggregateInputMasks(t2) {
|
|
996
|
-
let n2 = e(
|
|
1029
|
+
let n2 = e(Zt(t2.map((e11) => e11.toBytes()), "input mask"));
|
|
997
1030
|
return X.fromBytes(n2);
|
|
998
1031
|
}
|
|
999
1032
|
async stealthDhSecret(e11, t2, n2, r2) {
|
|
1000
1033
|
y(t2, 32, "stealthDhSecret ownerSecret"), y(n2, 32, "stealthDhSecret viewSecret"), y(r2, 32, "stealthDhSecret publicNonce");
|
|
1001
|
-
let i2 =
|
|
1034
|
+
let i2 = re(e11, t2, n2, r2);
|
|
1002
1035
|
return y(i2, 32, "stealth DH secret"), i2;
|
|
1003
1036
|
}
|
|
1004
1037
|
async validateTransfer(e11) {
|
|
1005
|
-
|
|
1038
|
+
oe(e11.toCompactJson(), null);
|
|
1006
1039
|
}
|
|
1007
1040
|
};
|
|
1008
|
-
function
|
|
1041
|
+
function en(e11) {
|
|
1009
1042
|
let t2 = Object.keys(e11);
|
|
1010
1043
|
if (t2.length !== 1 || t2[0] !== "StealthPublicKey") return false;
|
|
1011
1044
|
let n2 = e11.StealthPublicKey;
|
|
1012
1045
|
return typeof n2 == "object" && !!n2 && Object.keys(n2).length === 0;
|
|
1013
1046
|
}
|
|
1014
|
-
var
|
|
1015
|
-
function
|
|
1016
|
-
return `${
|
|
1047
|
+
var tn = "utxo";
|
|
1048
|
+
function nn(e11, t2) {
|
|
1049
|
+
return `${tn}_${e11.startsWith("resource_") ? e11.slice(9) : e11}_${b(t2)}`;
|
|
1017
1050
|
}
|
|
1018
|
-
var
|
|
1019
|
-
function
|
|
1051
|
+
var rn = 64;
|
|
1052
|
+
function an(e11) {
|
|
1020
1053
|
return typeof e11 == "object" && !!e11 && "Utxo" in e11;
|
|
1021
1054
|
}
|
|
1022
|
-
function
|
|
1055
|
+
function on(e11) {
|
|
1023
1056
|
return e11.length > 0 && /^[0-9a-fA-F]+$/.test(e11);
|
|
1024
1057
|
}
|
|
1025
|
-
function
|
|
1058
|
+
function sn(e11) {
|
|
1026
1059
|
let t2 = e11.split("_");
|
|
1027
|
-
if (t2.length < 3 || t2[0] !==
|
|
1060
|
+
if (t2.length < 3 || t2[0] !== tn) return null;
|
|
1028
1061
|
let n2 = t2[t2.length - 1];
|
|
1029
|
-
return n2.length !==
|
|
1062
|
+
return n2.length !== rn || !on(n2) ? null : x(n2);
|
|
1030
1063
|
}
|
|
1031
|
-
function
|
|
1064
|
+
function cn(e11, t2) {
|
|
1032
1065
|
let n2 = H(e11);
|
|
1033
|
-
if (n2 === null || !
|
|
1066
|
+
if (n2 === null || !an(n2)) return null;
|
|
1034
1067
|
let r2 = n2.Utxo;
|
|
1035
1068
|
if (r2.output === null || r2.is_frozen) return null;
|
|
1036
|
-
let i2 =
|
|
1069
|
+
let i2 = sn(t2);
|
|
1037
1070
|
return i2 === null ? null : {
|
|
1038
1071
|
commitment: i2,
|
|
1039
1072
|
body: r2.output.output
|
|
1040
1073
|
};
|
|
1041
1074
|
}
|
|
1042
|
-
var
|
|
1043
|
-
constructor(e11, t2, n2 = new
|
|
1075
|
+
var ln = 0, un = class {
|
|
1076
|
+
constructor(e11, t2, n2 = new $t(e11.network())) {
|
|
1044
1077
|
__publicField(this, "provider");
|
|
1045
1078
|
__publicField(this, "crypto");
|
|
1046
1079
|
__publicField(this, "builder");
|
|
1047
1080
|
__publicField(this, "state");
|
|
1048
1081
|
__publicField(this, "maxEpoch", null);
|
|
1049
1082
|
__publicField(this, "prepared", false);
|
|
1050
|
-
this.provider = e11, this.crypto = n2, this.builder = B.new(e11.network(),
|
|
1083
|
+
this.provider = e11, this.crypto = n2, this.builder = B.new(e11.network(), ln), this.state = {
|
|
1051
1084
|
resource: t2,
|
|
1052
1085
|
revealedInput: null,
|
|
1053
1086
|
inputsToSpend: /* @__PURE__ */ new Map(),
|
|
@@ -1089,7 +1122,7 @@ var nn = 0, rn = class {
|
|
|
1089
1122
|
return this.builder = e11(this.builder), this;
|
|
1090
1123
|
}
|
|
1091
1124
|
spendStealthInput(e11, t2) {
|
|
1092
|
-
let n2 = new
|
|
1125
|
+
let n2 = new Jt(t2), r2 = b(n2.commitment), i2 = this.state.inputsToSpend.get(r2);
|
|
1093
1126
|
if (i2 !== void 0) throw new v(`spendStealthInput: duplicate commitment ${r2} \u2014 each commitment is one UTXO and may be spent once (already added for owner ${i2.owner}). A commitment uniquely identifies a UTXO; adding it again (even under a different owner) would self-double-spend.`);
|
|
1094
1127
|
return this.state.inputsToSpend.set(r2, {
|
|
1095
1128
|
input: n2,
|
|
@@ -1100,8 +1133,8 @@ var nn = 0, rn = class {
|
|
|
1100
1133
|
var _a;
|
|
1101
1134
|
if (this.prepared) throw new v("StealthTransfer.prepare: already prepared \u2014 create a new StealthTransfer to build again");
|
|
1102
1135
|
this.validate(), this.prepared = true;
|
|
1103
|
-
let { statement: e11, outputMask: t2 } = await this.crypto.generateOutputsStatement(this.state.outputs, this.state.revealedOutput), n2 = new
|
|
1104
|
-
this.emitInstructions(n2), this.maxEpoch === null && this.builder.buildUnsignedTransaction().max_epoch ===
|
|
1136
|
+
let { statement: e11, outputMask: t2 } = await this.crypto.generateOutputsStatement(this.state.outputs, this.state.revealedOutput), n2 = new Q(await this.crypto.buildInputsStatement([...this.state.inputsToSpend.values()].map((e12) => e12.input), ((_a = this.state.revealedInput) == null ? void 0 : _a.amount) ?? 0n), e11, void 0);
|
|
1137
|
+
this.emitInstructions(n2), this.maxEpoch === null && this.builder.buildUnsignedTransaction().max_epoch === ln && this.builder.withMaxEpoch(await $e(this.provider));
|
|
1105
1138
|
let r2 = /* @__PURE__ */ new Set();
|
|
1106
1139
|
if (this.state.revealedInput !== null) {
|
|
1107
1140
|
let e12 = this.state.revealedInput.source;
|
|
@@ -1109,14 +1142,14 @@ var nn = 0, rn = class {
|
|
|
1109
1142
|
substate_id: e12,
|
|
1110
1143
|
version: null
|
|
1111
1144
|
}), r2.add(e12);
|
|
1112
|
-
let t3 = await
|
|
1145
|
+
let t3 = await _t(this.provider, e12);
|
|
1113
1146
|
for (let e13 of t3) r2.has(e13) || (this.builder.addInput({
|
|
1114
1147
|
substate_id: e13,
|
|
1115
1148
|
version: null
|
|
1116
1149
|
}), r2.add(e13));
|
|
1117
1150
|
}
|
|
1118
1151
|
for (let { input: e12 } of this.state.inputsToSpend.values()) {
|
|
1119
|
-
let t3 =
|
|
1152
|
+
let t3 = nn(this.state.resource, e12.commitment);
|
|
1120
1153
|
r2.has(t3) || (this.builder.addInput({
|
|
1121
1154
|
substate_id: t3,
|
|
1122
1155
|
version: null
|
|
@@ -1155,38 +1188,38 @@ var nn = 0, rn = class {
|
|
|
1155
1188
|
t2 !== null && (this.builder.callMethod({
|
|
1156
1189
|
componentAddress: t2.source,
|
|
1157
1190
|
methodName: "withdraw"
|
|
1158
|
-
}, [j(this.state.resource), k(t2.amount)]).saveVar(
|
|
1191
|
+
}, [j(this.state.resource), k(t2.amount)]).saveVar(Tt), n2 = Tt), this.builder.addInstruction(Dt({
|
|
1159
1192
|
resourceAddress: this.state.resource,
|
|
1160
1193
|
revealedInputBucket: n2,
|
|
1161
1194
|
statement: e11
|
|
1162
|
-
}, (e12) => this.builder.resolveWorkspaceOffsetId(e12))), this.state.revealedOutput !== null && t2 !== null && this.builder.saveVar(
|
|
1195
|
+
}, (e12) => this.builder.resolveWorkspaceOffsetId(e12))), this.state.revealedOutput !== null && t2 !== null && this.builder.saveVar(Et).callMethod({
|
|
1163
1196
|
componentAddress: t2.source,
|
|
1164
1197
|
methodName: "deposit"
|
|
1165
|
-
}, [{ Workspace:
|
|
1198
|
+
}, [{ Workspace: Et }]);
|
|
1166
1199
|
}
|
|
1167
1200
|
};
|
|
1168
|
-
function
|
|
1169
|
-
if (
|
|
1201
|
+
function dn(e11) {
|
|
1202
|
+
if (fn(e11) || e11.statementJson !== void 0) return e11.statementJson;
|
|
1170
1203
|
if (e11.inputs.length > 0) throw new _("inputs statement has confidential inputs but no WASM statementJson \u2014 call buildInputsStatement first", { context: "statementJsonFor" });
|
|
1171
1204
|
return JSON.stringify(e11.toJSON());
|
|
1172
1205
|
}
|
|
1173
|
-
function
|
|
1206
|
+
function fn(e11) {
|
|
1174
1207
|
return !("inputs" in e11);
|
|
1175
1208
|
}
|
|
1176
|
-
async function
|
|
1177
|
-
let a2 =
|
|
1209
|
+
async function pn(e11, t2, n2, r2, i2) {
|
|
1210
|
+
let a2 = dn(r2), o2 = dn(i2);
|
|
1178
1211
|
return e11.generateBalanceProofSignature(t2, n2, a2, o2);
|
|
1179
1212
|
}
|
|
1180
|
-
async function
|
|
1213
|
+
async function $(e11, t2, n2, r2) {
|
|
1181
1214
|
let i2 = await e11.deriveAeadKey(r2.viewSecret, r2.senderPublicNonce);
|
|
1182
1215
|
return e11.unblindOutput(t2, n2, i2, r2.skipMemo);
|
|
1183
1216
|
}
|
|
1184
|
-
async function
|
|
1185
|
-
let i2 =
|
|
1217
|
+
async function mn(e11, t2, n2, r2) {
|
|
1218
|
+
let i2 = cn(n2, r2);
|
|
1186
1219
|
if (i2 === null) return null;
|
|
1187
1220
|
let a2 = x(i2.body.encrypted_data), o2 = x(i2.body.public_nonce);
|
|
1188
1221
|
try {
|
|
1189
|
-
return await
|
|
1222
|
+
return await $(e11, i2.commitment, a2, {
|
|
1190
1223
|
senderPublicNonce: o2,
|
|
1191
1224
|
viewSecret: t2,
|
|
1192
1225
|
skipMemo: false
|
|
@@ -1195,33 +1228,33 @@ async function ln(e11, t2, n2, r2) {
|
|
|
1195
1228
|
return null;
|
|
1196
1229
|
}
|
|
1197
1230
|
}
|
|
1198
|
-
async function
|
|
1231
|
+
async function hn(e11, t2, n2) {
|
|
1199
1232
|
if (t2.length === 0) throw new v("generateOutputsStatement: at least one stealth output is required");
|
|
1200
1233
|
let { statement: r2, outputMask: i2 } = await e11.generateOutputsStatement(t2, n2), a2 = await e11.buildInputsStatement([], 0n);
|
|
1201
|
-
return new
|
|
1234
|
+
return new Q(a2, r2, await pn(e11, X.zero(), i2, a2, r2));
|
|
1202
1235
|
}
|
|
1203
|
-
var
|
|
1236
|
+
var gn = class e10 {
|
|
1204
1237
|
constructor(e11, t2, n2, r2, i2) {
|
|
1205
1238
|
this.wallet = e11, this.spec = t2, this.crypto = n2, this.mustSignWithAccountKey = r2, this.viewSecret = i2;
|
|
1206
1239
|
}
|
|
1207
1240
|
static fromSpec(t2, n2, r2 = {}) {
|
|
1208
|
-
return new e10(t2, n2, r2.crypto ?? new
|
|
1241
|
+
return new e10(t2, n2, r2.crypto ?? new $t(), r2.mustSignWithAccountKey ?? true, r2.viewSecret);
|
|
1209
1242
|
}
|
|
1210
1243
|
async prepare(e11) {
|
|
1211
|
-
let t2 = await this.resolveStealthInputs(e11), n2 = t2.length === 0 ? X.zero() : await this.crypto.aggregateInputMasks(t2.map((e12) => e12.mask)), r2 = await
|
|
1244
|
+
let t2 = await this.resolveStealthInputs(e11), n2 = t2.length === 0 ? X.zero() : await this.crypto.aggregateInputMasks(t2.map((e12) => e12.mask)), r2 = await pn(this.crypto, n2, this.spec.outputMask, this.spec.statement.inputsStatement, this.spec.statement.outputsStatement), i2 = new Q(this.spec.statement.inputsStatement, this.spec.statement.outputsStatement, r2);
|
|
1212
1245
|
await this.crypto.validateTransfer(i2);
|
|
1213
|
-
let a2 =
|
|
1246
|
+
let a2 = vn(this.spec.unsignedTx, i2), o2 = this.mustSignWithAccountKey ? await J([this.wallet], a2) : a2, s2 = {
|
|
1214
1247
|
...this.spec,
|
|
1215
1248
|
unsignedTx: o2,
|
|
1216
1249
|
statement: i2
|
|
1217
1250
|
};
|
|
1218
|
-
return new
|
|
1251
|
+
return new _n({
|
|
1219
1252
|
wallet: this.wallet,
|
|
1220
1253
|
crypto: this.crypto,
|
|
1221
1254
|
spec: s2,
|
|
1222
1255
|
resolvedInputs: t2,
|
|
1223
1256
|
mustSignWithAccountKey: this.mustSignWithAccountKey,
|
|
1224
|
-
sealKeypair:
|
|
1257
|
+
sealKeypair: Ot()
|
|
1225
1258
|
});
|
|
1226
1259
|
}
|
|
1227
1260
|
async resolveViewSecret() {
|
|
@@ -1246,11 +1279,11 @@ var dn = class e10 {
|
|
|
1246
1279
|
let t2 = await this.resolveViewSecret(), n2 = this.spec.state.resource, r2 = await Promise.allSettled(this.spec.inputs.map(async ({ input: r3, owner: i3 }) => {
|
|
1247
1280
|
let a2 = b(r3.commitment), o2 = await e11.getStealthUtxo(n2, r3.commitment);
|
|
1248
1281
|
if (o2 === null) throw new p(`WalletStealthAuthorizer.prepare: stealth input UTXO not found (spent or never created) for ${a2}`);
|
|
1249
|
-
let s2 =
|
|
1282
|
+
let s2 = cn(o2, nn(n2, r3.commitment));
|
|
1250
1283
|
if (s2 === null) throw new p(`WalletStealthAuthorizer.prepare: stealth input ${a2} is not a live, spendable UTXO`);
|
|
1251
1284
|
let c2 = x(s2.body.public_nonce), l2;
|
|
1252
1285
|
try {
|
|
1253
|
-
l2 = await
|
|
1286
|
+
l2 = await $(this.crypto, s2.commitment, x(s2.body.encrypted_data), {
|
|
1254
1287
|
senderPublicNonce: c2,
|
|
1255
1288
|
viewSecret: t2,
|
|
1256
1289
|
skipMemo: true
|
|
@@ -1272,7 +1305,7 @@ var dn = class e10 {
|
|
|
1272
1305
|
if (i2 !== void 0) throw i2.reason;
|
|
1273
1306
|
return r2.map((e12) => e12.value);
|
|
1274
1307
|
}
|
|
1275
|
-
},
|
|
1308
|
+
}, _n = class {
|
|
1276
1309
|
constructor(e11) {
|
|
1277
1310
|
__publicField(this, "wallet");
|
|
1278
1311
|
__publicField(this, "crypto");
|
|
@@ -1318,10 +1351,10 @@ var dn = class e10 {
|
|
|
1318
1351
|
let e11 = (await this.createAuthorizations()).flatMap((e12) => e12.signatures), t2 = [];
|
|
1319
1352
|
this.mustSignWithAccountKey && t2.push(this.wallet);
|
|
1320
1353
|
let n2 = [...e11, ...this.extraSignatures];
|
|
1321
|
-
return n2.length > 0 && t2.push(new
|
|
1354
|
+
return n2.length > 0 && t2.push(new yn(n2)), Y(await jt(t2, this.spec.unsignedTx, this.sealKeypair));
|
|
1322
1355
|
}
|
|
1323
1356
|
};
|
|
1324
|
-
function
|
|
1357
|
+
function vn(e11, t2) {
|
|
1325
1358
|
let n2 = e11.instructions.findIndex(G);
|
|
1326
1359
|
if (n2 < 0) throw new v("patchStealthStatement: expected exactly one StealthTransfer instruction, found 0 (not a stealth tx)");
|
|
1327
1360
|
if (e11.instructions.slice(n2 + 1).findIndex(G) >= 0) throw new v("patchStealthStatement: expected exactly one StealthTransfer instruction, found more than one (malformed)");
|
|
@@ -1334,7 +1367,7 @@ function pn(e11, t2) {
|
|
|
1334
1367
|
instructions: i2
|
|
1335
1368
|
};
|
|
1336
1369
|
}
|
|
1337
|
-
var
|
|
1370
|
+
var yn = class {
|
|
1338
1371
|
constructor(e11) {
|
|
1339
1372
|
this.signatures = e11;
|
|
1340
1373
|
}
|
|
@@ -1349,95 +1382,96 @@ var mn = class {
|
|
|
1349
1382
|
}
|
|
1350
1383
|
};
|
|
1351
1384
|
export {
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1385
|
+
zt as AccountInvokeBuilder,
|
|
1386
|
+
_n as AuthorizedTransfer,
|
|
1387
|
+
Z as BalanceProofSignature,
|
|
1355
1388
|
_ as CryptoBridgeError,
|
|
1356
|
-
|
|
1389
|
+
Qe as DEFAULT_TRANSACTION_VALIDITY_EPOCHS,
|
|
1357
1390
|
h as DefaultSignerNotSetError,
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1391
|
+
Ut as EncryptedData,
|
|
1392
|
+
Lt as ExternalKeySigner,
|
|
1393
|
+
Bt as FaucetInvokeBuilder,
|
|
1394
|
+
pe as IndexerClientError,
|
|
1361
1395
|
v as InvalidArgumentError,
|
|
1362
1396
|
m as KeyProviderNotFoundError,
|
|
1363
|
-
|
|
1397
|
+
Ze as MAX_TRANSACTION_VALIDITY_EPOCHS,
|
|
1364
1398
|
X as Mask,
|
|
1365
1399
|
u as Network,
|
|
1366
1400
|
d as OotleError,
|
|
1367
|
-
|
|
1368
|
-
|
|
1401
|
+
Vt as OotleWallet,
|
|
1402
|
+
he as OperationCancelledError,
|
|
1369
1403
|
g as SignerError,
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1404
|
+
Jt as StealthInput,
|
|
1405
|
+
Yt as StealthInputsStatement,
|
|
1406
|
+
Xt as StealthOutputsStatement,
|
|
1407
|
+
un as StealthTransfer,
|
|
1408
|
+
Q as StealthTransferStatement,
|
|
1409
|
+
bt as TARI_RESOURCE_ADDRESS,
|
|
1376
1410
|
B as TransactionBuilder,
|
|
1377
1411
|
f as TransactionRejectedError,
|
|
1378
|
-
|
|
1412
|
+
me as TransactionTimeoutError,
|
|
1379
1413
|
p as WalletError,
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1414
|
+
gn as WalletStealthAuthorizer,
|
|
1415
|
+
$t as WasmStealthCrypto,
|
|
1416
|
+
Ct as XTR_FAUCET_CLAIM_RESOURCE_ADDRESS,
|
|
1417
|
+
xt as XTR_FAUCET_COMPONENT_ADDRESS,
|
|
1418
|
+
St as XTR_FAUCET_VAULT_ADDRESS,
|
|
1385
1419
|
k as amountLiteral,
|
|
1386
1420
|
y as assertByteLength,
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1421
|
+
ge as assertUnreachable,
|
|
1422
|
+
Fe as boolLiteral,
|
|
1423
|
+
kt as buildTransactionSignature,
|
|
1390
1424
|
A as bytesLiteral,
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1425
|
+
Be as claimedOutputTombstoneAddressLiteral,
|
|
1426
|
+
Nt as classifyOutcome,
|
|
1427
|
+
sn as commitmentOf,
|
|
1428
|
+
Ie as componentAddressLiteral,
|
|
1429
|
+
Gt as createOutput,
|
|
1430
|
+
dt as decodeEvent,
|
|
1431
|
+
lt as decodeExecuteResult,
|
|
1432
|
+
ft as decodeResource,
|
|
1433
|
+
ct as decodeSubstateValue,
|
|
1434
|
+
ut as decodeTransactionReceipt,
|
|
1435
|
+
pt as decodeUtxo,
|
|
1436
|
+
$ as decryptInputData,
|
|
1437
|
+
mn as decryptOwnedUtxo,
|
|
1438
|
+
st as defaultIndexerUrl,
|
|
1405
1439
|
x as fromHexStr,
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1440
|
+
hn as generateOutputsStatement,
|
|
1441
|
+
Ot as generateSealKeypair,
|
|
1442
|
+
_t as getVaultIdsForAccount,
|
|
1443
|
+
Ne as intLiteral,
|
|
1410
1444
|
G as isStealthTransferInstruction,
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1445
|
+
gt as iterVaultIdsInState,
|
|
1446
|
+
je as literalArg,
|
|
1447
|
+
Le as metadataLiteral,
|
|
1414
1448
|
R as microTariLiteral,
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1449
|
+
Ye as microTariString,
|
|
1450
|
+
Ue as nonFungibleAddressLiteral,
|
|
1451
|
+
cn as parseSubstateUtxo,
|
|
1452
|
+
Xe as parseWorkspaceStringKey,
|
|
1453
|
+
vn as patchStealthStatement,
|
|
1454
|
+
He as publicKeyLiteral,
|
|
1421
1455
|
J as resolveMainSigner,
|
|
1422
|
-
|
|
1456
|
+
$e as resolveMaxEpoch,
|
|
1423
1457
|
q as resolveTransaction,
|
|
1424
1458
|
j as resourceAddressLiteral,
|
|
1425
1459
|
Y as sealTransaction,
|
|
1426
|
-
|
|
1427
|
-
|
|
1460
|
+
It as sendDryRun,
|
|
1461
|
+
Ft as sendTransaction,
|
|
1428
1462
|
K as serializeUnsignedTx,
|
|
1429
|
-
|
|
1430
|
-
|
|
1463
|
+
pn as signBalanceProof,
|
|
1464
|
+
At as signTransaction,
|
|
1431
1465
|
W as statementAsWire,
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1466
|
+
Dt as stealthTransferInstruction,
|
|
1467
|
+
nn as stealthUtxoSubstateId,
|
|
1468
|
+
Pe as stringLiteral,
|
|
1469
|
+
Mt as submitTransaction,
|
|
1470
|
+
ze as templateAddressLiteral,
|
|
1437
1471
|
b as toHexStr,
|
|
1438
1472
|
H as upSubstateValue,
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1473
|
+
We as utxoAddressLiteral,
|
|
1474
|
+
Ve as validatorFeePoolAddressLiteral,
|
|
1475
|
+
Re as vaultIdLiteral,
|
|
1476
|
+
Pt as watchTransaction
|
|
1443
1477
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tari-project/ootle",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/tari-project/ootle.ts.git",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"@tari-project/ootle-wasm-bor": "^0.49.1"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
+
"@scure/sr25519": "^2.4.0",
|
|
33
34
|
"@types/node": "^25.5.0",
|
|
34
35
|
"@microsoft/api-extractor": "^7.57.7",
|
|
35
36
|
"typescript": "^5.9.3",
|