@orbinum/sdk 1.1.1 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-Y6LNYJAJ.mjs → chunk-A2ZRMEYW.mjs} +147 -13
- package/dist/{index-JYVjYJtf.d.mts → index-V5Z9igEN.d.mts} +41 -1
- package/dist/{index-JYVjYJtf.d.ts → index-V5Z9igEN.d.ts} +41 -1
- package/dist/index.d.mts +224 -10
- package/dist/index.d.ts +224 -10
- package/dist/index.js +485 -130
- package/dist/index.mjs +320 -98
- package/dist/wallet/worker/index.d.mts +1 -1
- package/dist/wallet/worker/index.d.ts +1 -1
- package/dist/wallet/worker/index.js +1 -0
- package/dist/wallet/worker/index.mjs +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Z as ZkNote, D as DecryptedMemo, N as NoteInput, S as ScanCommitment, a as DecryptPool, b as ScanKeys } from './index-
|
|
2
|
-
export { C as CURRENT_CIRCUIT_VERSION, c as DECRYPT_YIELD_EVERY, d as DecryptBatchResult, e as DecryptRequest, E as EMPTY_BATCH_RESULT, K as KnownEphEntry, f as KnownEphWindow, M as MAX_WORKERS, g as MatchSource, h as MerkleTreeInfo, P as PAIRWISE_EPH_WINDOW, i as SELF_EPH_WINDOW, W as WORKER_CRASHED, j as WorkerFactory, k as WorkerLike, l as WorkerMessage, m as clearKnownEphWindow, n as createDecryptPool, o as createMainThreadPool, p as createWorkerPool, q as decryptHintBatch, r as getKnownEphWindow } from './index-
|
|
1
|
+
import { Z as ZkNote, D as DecryptedMemo, N as NoteInput, S as ScanCommitment, O as OutgoingNoteRecord, a as DecryptPool, b as ScanKeys } from './index-V5Z9igEN.mjs';
|
|
2
|
+
export { C as CURRENT_CIRCUIT_VERSION, c as DECRYPT_YIELD_EVERY, d as DecryptBatchResult, e as DecryptRequest, E as EMPTY_BATCH_RESULT, K as KnownEphEntry, f as KnownEphWindow, M as MAX_WORKERS, g as MatchSource, h as MerkleTreeInfo, P as PAIRWISE_EPH_WINDOW, i as SELF_EPH_WINDOW, W as WORKER_CRASHED, j as WorkerFactory, k as WorkerLike, l as WorkerMessage, m as clearKnownEphWindow, n as createDecryptPool, o as createMainThreadPool, p as createWorkerPool, q as decryptHintBatch, r as getKnownEphWindow } from './index-V5Z9igEN.mjs';
|
|
3
3
|
import { ArtifactProvider, ProofResult, CircuitType } from '@orbinum/proof-generator';
|
|
4
4
|
export { ArtifactProvider, CircuitType, ProofResult, WebArtifactProvider, shouldProveSingleThreaded } from '@orbinum/proof-generator';
|
|
5
5
|
import * as polkadot_api from 'polkadot-api';
|
|
@@ -1107,6 +1107,115 @@ declare function serializeMemo(value: bigint, ownerPk: Uint8Array, blinding: Uin
|
|
|
1107
1107
|
*/
|
|
1108
1108
|
declare function deriveViewTag(sharedSecret: Uint8Array): number;
|
|
1109
1109
|
|
|
1110
|
+
/**
|
|
1111
|
+
* OutgoingBlob — the OVK "wrap-the-key" primitive.
|
|
1112
|
+
*
|
|
1113
|
+
* When a wallet sends a private_transfer, the recipient's memo is encrypted ECDH
|
|
1114
|
+
* toward the RECIPIENT's ivk; the sender cannot reopen it, so a cold restore
|
|
1115
|
+
* loses the outgoing history (who/how much). This blob fixes that: it wraps the
|
|
1116
|
+
* memo's 32-byte `sharedSecret` under a key derived from the SENDER's ovk. On
|
|
1117
|
+
* restore the sender unwraps the sharedSecret and feeds it to the SAME memo
|
|
1118
|
+
* decryption path the recipient uses — one decryption routine in the whole
|
|
1119
|
+
* system (OVK plan requirement #7).
|
|
1120
|
+
*
|
|
1121
|
+
* This is Zcash Sapling's `outCiphertext` / Penumbra's `OvkWrappedKey`, adapted
|
|
1122
|
+
* to a shared secret that is a field element (32 bytes), not a group point — so
|
|
1123
|
+
* the blob contains no group element to decode, sidestepping Zcash's canonical-
|
|
1124
|
+
* encoding class of bugs.
|
|
1125
|
+
*
|
|
1126
|
+
* Layout (56 bytes): nonce_suffix(8) || ciphertext(32) || MAC(16).
|
|
1127
|
+
* Cipher: ChaCha20-Poly1305 (IETF), same primitive as EncryptedMemo.
|
|
1128
|
+
*
|
|
1129
|
+
* The outgoing cipher key binds every unique-per-output public value:
|
|
1130
|
+
* ock = HKDF(ikm=ovk, salt=commitment_bytes||ephPk_bytes, info=OCK_DOMAIN)
|
|
1131
|
+
* so each ock encrypts exactly one message. Uniqueness comes from the COMMITMENT
|
|
1132
|
+
* (Poseidon4 with random blinding, consensus rejects duplicates); the ephPk adds
|
|
1133
|
+
* the on-chain binding, not the uniqueness — two self-notes can share an ephPk
|
|
1134
|
+
* but never a commitment, so their ock still differs.
|
|
1135
|
+
*
|
|
1136
|
+
* SALT IS RAW ON-CHAIN BYTES. `commitment_bytes` and `ephPk_bytes` must be the
|
|
1137
|
+
* exact bytes that are/go on chain, never a re-serialization of a decoded point:
|
|
1138
|
+
* two encodings of "the same point" produce different ock and the AEAD fails —
|
|
1139
|
+
* no ambiguity to exploit.
|
|
1140
|
+
*/
|
|
1141
|
+
/** Total on-chain blob size: nonce_suffix(8) || ciphertext(32) || MAC(16). */
|
|
1142
|
+
declare const OVK_BLOB_SIZE: number;
|
|
1143
|
+
/**
|
|
1144
|
+
* Derive the 32-byte outgoing cipher key.
|
|
1145
|
+
* ock = HKDF-SHA256(ikm=ovk, salt=commitmentBytes||ephPkBytes, info=OCK_DOMAIN)
|
|
1146
|
+
*
|
|
1147
|
+
* Both salt parts must be the raw 32-byte on-chain values (see file header).
|
|
1148
|
+
* Throws if either is not exactly 32 bytes — a wrong length here would silently
|
|
1149
|
+
* change the key and make recovery fail far from the cause.
|
|
1150
|
+
*/
|
|
1151
|
+
declare function deriveOutgoingCipherKey(ovk: Uint8Array, commitmentBytes: Uint8Array, ephPkBytes: Uint8Array): Uint8Array;
|
|
1152
|
+
/**
|
|
1153
|
+
* Seal a sharedSecret into a 56-byte outgoing blob under the sender's ovk.
|
|
1154
|
+
*
|
|
1155
|
+
* @param ovk sender's 32-byte outgoing viewing key
|
|
1156
|
+
* @param sharedSecret the memo's 32-byte ECDH shared secret (what we wrap)
|
|
1157
|
+
* @param commitmentBytes raw 32-byte on-chain commitment of the recipient output
|
|
1158
|
+
* @param ephPkBytes raw 32-byte ephemeral public key (from the memo, not recomputed)
|
|
1159
|
+
* @returns 56 bytes: nonce_suffix(8) || ciphertext(32) || MAC(16)
|
|
1160
|
+
*/
|
|
1161
|
+
declare function sealOutgoingBlob(ovk: Uint8Array, sharedSecret: Uint8Array, commitmentBytes: Uint8Array, ephPkBytes: Uint8Array): Uint8Array;
|
|
1162
|
+
/**
|
|
1163
|
+
* Open an outgoing blob, returning the wrapped sharedSecret or null.
|
|
1164
|
+
*
|
|
1165
|
+
* Never throws — this runs in recovery loops over hints that may be foreign,
|
|
1166
|
+
* pre-OVK, or ovk=⊥ random. A wrong ovk, wrong commitment, wrong ephPk, or any
|
|
1167
|
+
* corrupted byte fails the MAC and returns null.
|
|
1168
|
+
*/
|
|
1169
|
+
declare function openOutgoingBlob(ovk: Uint8Array, blob: Uint8Array, commitmentBytes: Uint8Array, ephPkBytes: Uint8Array): Uint8Array | null;
|
|
1170
|
+
/**
|
|
1171
|
+
* A 56-byte random blob for the ovk=⊥ case (sender opts out of recoverability).
|
|
1172
|
+
*
|
|
1173
|
+
* Indistinguishable on-chain from a real blob: a real one is a random 8-byte
|
|
1174
|
+
* suffix plus ChaCha20/Poly1305 output, both uniform without the key. This is
|
|
1175
|
+
* the ONLY path for ⊥ — never zeros (distinguishable), never omission (a length
|
|
1176
|
+
* or SCALE-tag difference is a permanent, retroactive privacy label).
|
|
1177
|
+
*/
|
|
1178
|
+
declare function randomOutgoingBlob(): Uint8Array;
|
|
1179
|
+
|
|
1180
|
+
/** The fields a payment slip carries — all public on-chain. */
|
|
1181
|
+
interface PaymentSlipFields {
|
|
1182
|
+
/** 0x-prefixed 32-byte LE commitment hex of the recipient output. */
|
|
1183
|
+
commitmentHex: string;
|
|
1184
|
+
/** 0x-prefixed encrypted memo hex (180 bytes) of the recipient output. */
|
|
1185
|
+
encryptedMemo: string;
|
|
1186
|
+
/** Merkle leaf index, when known. Informational — spends re-fetch the proof. */
|
|
1187
|
+
leafIndex?: number;
|
|
1188
|
+
/** Transaction hash of the transfer, when known. Informational — a reference
|
|
1189
|
+
* the recipient can show as proof of the payment; not needed to reconstruct. */
|
|
1190
|
+
txHash?: string;
|
|
1191
|
+
}
|
|
1192
|
+
/**
|
|
1193
|
+
* Seal slip fields toward a recipient.
|
|
1194
|
+
*
|
|
1195
|
+
* A fresh ephemeral keypair is generated; `sharedSecret = [ephSk]·recipientIvk`
|
|
1196
|
+
* is the ECDH secret only the recipient can reproduce (with their `ivsk`). The
|
|
1197
|
+
* ephemeral public key travels in the clear so the recipient can run ECDH.
|
|
1198
|
+
*
|
|
1199
|
+
* @param recipientIvkPacked 32-byte LE packed BJJ viewing public key of the recipient
|
|
1200
|
+
* @param fields the slip fields to seal
|
|
1201
|
+
* @returns envelope: ephPk(32) || nonce_suffix(8) || ciphertext || MAC(16)
|
|
1202
|
+
*/
|
|
1203
|
+
declare function sealPaymentSlip(recipientIvkPacked: Uint8Array, fields: PaymentSlipFields): Uint8Array;
|
|
1204
|
+
/**
|
|
1205
|
+
* Open a payment slip with the recipient's viewing secret key. Returns the fields
|
|
1206
|
+
* or null (not ours / corrupt). Never throws — safe in import loops.
|
|
1207
|
+
*/
|
|
1208
|
+
declare function openPaymentSlip(recipientIvsk: Uint8Array, envelope: Uint8Array): PaymentSlipFields | null;
|
|
1209
|
+
/** URI scheme prefix. The version is in the name, so a v2 reader can refuse a v1. */
|
|
1210
|
+
declare const PAYMENT_SLIP_SCHEME = "orbslip1:";
|
|
1211
|
+
/** Encode a sealed slip envelope into a shareable `orbslip1:` string. */
|
|
1212
|
+
declare function encodePaymentSlip(envelope: Uint8Array): string;
|
|
1213
|
+
/**
|
|
1214
|
+
* Decode an `orbslip1:` string back into the sealed envelope, or null. A wrong
|
|
1215
|
+
* scheme, a bad checksum (mistyped/truncated), or malformed payload returns null.
|
|
1216
|
+
*/
|
|
1217
|
+
declare function decodePaymentSlip(text: string): Uint8Array | null;
|
|
1218
|
+
|
|
1110
1219
|
/**
|
|
1111
1220
|
* Derive the deterministic 32-byte ephemeral secret for self-note `index`.
|
|
1112
1221
|
* Feed it to EncryptedMemo.encrypt / NoteBuilder.build as `ephSkOverride`.
|
|
@@ -1308,6 +1417,41 @@ declare function tryDecryptNoteVerbose(commitment: ScanCommitment, viewingSecret
|
|
|
1308
1417
|
note: ZkNote | null;
|
|
1309
1418
|
reason?: string;
|
|
1310
1419
|
};
|
|
1420
|
+
/** A scan hint plus the per-transaction OVK blob the indexer serves alongside it. */
|
|
1421
|
+
type OutgoingHint = ScanCommitment & {
|
|
1422
|
+
ovkBlob?: string | null;
|
|
1423
|
+
};
|
|
1424
|
+
/**
|
|
1425
|
+
* Recover a note the caller SENT, using their outgoing viewing key (ovk).
|
|
1426
|
+
*
|
|
1427
|
+
* The sender's memo was encrypted toward the RECIPIENT, so they cannot reopen it
|
|
1428
|
+
* directly. Instead the ovk blob wraps the memo's shared secret; unwrapping it
|
|
1429
|
+
* gives the same secret the recipient gets via ECDH, and feeding it to the shared
|
|
1430
|
+
* decrypt-and-verify step rebuilds the sent note's public facts.
|
|
1431
|
+
*
|
|
1432
|
+
* Returns an OutgoingNoteRecord (value, recipient stealth pk, counterparty,
|
|
1433
|
+
* circuit version) — NEVER a spendable note: no spendingKey, no nullifier. The
|
|
1434
|
+
* sender does not own this note. Never throws (runs in recovery loops).
|
|
1435
|
+
*
|
|
1436
|
+
* Security (OVK plan §3.4), in three non-algebraic but sound layers:
|
|
1437
|
+
* 1. The blob MAC (openOutgoingBlob) proves whoever wrote it knew the ovk, and
|
|
1438
|
+
* the ock binds it to THIS (commitment, ephPk) — blobs are not transplantable.
|
|
1439
|
+
* 2. The memo MAC (inside decryptAndVerifyPlaintext) proves this shared secret
|
|
1440
|
+
* is the one that encrypted this memo — the same secret the recipient derives.
|
|
1441
|
+
* 3. The commitment check ties the recovered fields to the note in the tree.
|
|
1442
|
+
* Not verifiable by the sender: that `sharedSecret` corresponds to `ephPk` — that
|
|
1443
|
+
* needs the recipient's ivsk. Residual: a leaked ovk lets an attacker fabricate a
|
|
1444
|
+
* self-consistent (commitment, memo, blob) and plant false outgoing history. It
|
|
1445
|
+
* moves no funds; Zcash accepts the same residual. Mitigated in the app by only
|
|
1446
|
+
* running this over commitments from extrinsics that spent our own nullifiers.
|
|
1447
|
+
*
|
|
1448
|
+
* @param hint scan hint with commitmentHex, encryptedMemo, and ovkBlob.
|
|
1449
|
+
* @param ovk the sender's 32-byte outgoing viewing key.
|
|
1450
|
+
* @param opts viewTagActivationLeaf gates the view-tag check for legacy memos.
|
|
1451
|
+
*/
|
|
1452
|
+
declare function tryRecoverOutgoing(hint: OutgoingHint, ovk: Uint8Array, opts?: {
|
|
1453
|
+
viewTagActivationLeaf?: number;
|
|
1454
|
+
}): OutgoingNoteRecord | null;
|
|
1311
1455
|
|
|
1312
1456
|
/**
|
|
1313
1457
|
* Proving what ONE note holds, without granting any power to spend it.
|
|
@@ -1732,6 +1876,20 @@ declare function deriveViewingPublicKey(ivsk: Uint8Array): Uint8Array;
|
|
|
1732
1876
|
* Returns 0n if BabyJubJub computation fails (e.g. invalid scalar).
|
|
1733
1877
|
*/
|
|
1734
1878
|
declare function deriveOwnerPk(spendingKey: bigint): bigint;
|
|
1879
|
+
/**
|
|
1880
|
+
* Derive the 32-byte outgoing viewing key (ovk) from master bytes.
|
|
1881
|
+
* ovk = HKDF-SHA256(ikm=masterBytes, info="orbinum-ovk-v1")
|
|
1882
|
+
*
|
|
1883
|
+
* Mirror of the vault-key derivation: rooted at masterBytes, not the spendingKey
|
|
1884
|
+
* scalar (see the derivation chain above for why). The ovk lets the SENDER of a
|
|
1885
|
+
* private transfer recover what they sent — it wraps the memo's shared secret so
|
|
1886
|
+
* a cold restore rebuilds the outgoing history. Sibling of the ivsk, delegable
|
|
1887
|
+
* independently.
|
|
1888
|
+
*
|
|
1889
|
+
* SECRET. Never embed it in a shareable address — it stays out of
|
|
1890
|
+
* encodePrivacyAddress by construction (there is no public component to derive).
|
|
1891
|
+
*/
|
|
1892
|
+
declare function deriveOutgoingViewingKey(masterBytes: Uint8Array): Uint8Array;
|
|
1735
1893
|
|
|
1736
1894
|
/**
|
|
1737
1895
|
* PrivacyKeyManager
|
|
@@ -1791,6 +1949,11 @@ declare class PrivacyKeyManager {
|
|
|
1791
1949
|
getViewingPublicKeyPacked(): Uint8Array;
|
|
1792
1950
|
/** Returns the BabyJubJub owner public key (x-coordinate). Throws if not loaded. */
|
|
1793
1951
|
getOwnerPk(): bigint;
|
|
1952
|
+
/**
|
|
1953
|
+
* Returns the 32-byte outgoing viewing key (ovk). Throws if not loaded.
|
|
1954
|
+
* Used to seal/open the outgoing blob that lets the sender recover a transfer.
|
|
1955
|
+
*/
|
|
1956
|
+
getOutgoingViewingKey(): Uint8Array;
|
|
1794
1957
|
/** Returns the spending key as a 32-byte little-endian Uint8Array. Throws if not loaded. */
|
|
1795
1958
|
getSpendingKeyBytes(): Uint8Array;
|
|
1796
1959
|
/**
|
|
@@ -4340,9 +4503,9 @@ declare function windowSizeForCounter(counter: number): number;
|
|
|
4340
4503
|
* Phase 1 — walk the hint feed and trial-decrypt every memo against the wallet's
|
|
4341
4504
|
* keys.
|
|
4342
4505
|
*
|
|
4343
|
-
* Pure collection:
|
|
4344
|
-
*
|
|
4345
|
-
*
|
|
4506
|
+
* Pure collection: this phase itself writes nothing — persistence happens only
|
|
4507
|
+
* through the injected `onPage`/`onBatchDone` callbacks, so the caller decides
|
|
4508
|
+
* what (if anything) is checkpointed while the scan runs.
|
|
4346
4509
|
*
|
|
4347
4510
|
* Transport, in order of preference:
|
|
4348
4511
|
* 1. Sealed chunks — the immutable bulk of the feed, digest-addressed and
|
|
@@ -4437,6 +4600,15 @@ interface CollectScanEntriesParams {
|
|
|
4437
4600
|
note: ZkNote;
|
|
4438
4601
|
isNew: boolean;
|
|
4439
4602
|
}>) => Promise<void>) | undefined;
|
|
4603
|
+
/**
|
|
4604
|
+
* Awaited after each fully processed chunk/page — AFTER `onPage`, so the
|
|
4605
|
+
* batch's notes are already in the caller's hands — with the highest valid
|
|
4606
|
+
* leaf seen so far. Fires for every batch, including ones with no owned
|
|
4607
|
+
* notes: that is the common case, and the checkpoint must advance past
|
|
4608
|
+
* other people's leaves too. Lets callers persist the scan cursor
|
|
4609
|
+
* incrementally so an aborted scan resumes instead of restarting.
|
|
4610
|
+
*/
|
|
4611
|
+
onBatchDone?: ((maxLeafIndex: number | undefined) => Promise<void>) | undefined;
|
|
4440
4612
|
/**
|
|
4441
4613
|
* Bounds `outcome.onChainHexes` to commitments the wallet actually holds.
|
|
4442
4614
|
* Pass the pre-scan snapshot, since `existingHexes` grows during the scan.
|
|
@@ -4515,14 +4687,16 @@ declare function resolveSpentStatus(params: {
|
|
|
4515
4687
|
* casing between runs cannot split one nullifier into two entries.
|
|
4516
4688
|
*/
|
|
4517
4689
|
|
|
4518
|
-
interface
|
|
4690
|
+
interface OpenSpentSetParams {
|
|
4519
4691
|
source: NullifierSource;
|
|
4520
4692
|
cache: NullifierCache;
|
|
4521
|
-
/** The wallet's own nullifiers, lowercase hex. */
|
|
4522
|
-
ownNullifiers: Set<string>;
|
|
4523
4693
|
signal?: AbortSignal | undefined;
|
|
4524
4694
|
onWarning?: ((message: string, cause?: unknown) => void) | undefined;
|
|
4525
4695
|
}
|
|
4696
|
+
interface ResolveSpentSetParams extends OpenSpentSetParams {
|
|
4697
|
+
/** The wallet's own nullifiers, lowercase hex. */
|
|
4698
|
+
ownNullifiers: Set<string>;
|
|
4699
|
+
}
|
|
4526
4700
|
/**
|
|
4527
4701
|
* Returns ONLY the spent members of `ownNullifiers` as a Map hex → spend details
|
|
4528
4702
|
* (block timestamp + spending tx hash, each null when the row carried none).
|
|
@@ -4870,6 +5044,38 @@ declare function decodeNoteBackup(json: string | object): NoteBackupEntry[];
|
|
|
4870
5044
|
*/
|
|
4871
5045
|
declare function importNotesFromBackup(entries: NoteBackupEntry[], keys: BackupImportKeys): ZkNote[];
|
|
4872
5046
|
|
|
5047
|
+
/**
|
|
5048
|
+
* Reconstruct a note from a payment slip.
|
|
5049
|
+
*
|
|
5050
|
+
* The recipient of a private transfer receives an `orbslip1:` string (or the raw
|
|
5051
|
+
* envelope) that the sender produced. Opening it yields the note's public
|
|
5052
|
+
* locators — commitment, encrypted memo, leaf index — which are fed to the SAME
|
|
5053
|
+
* decryption path a scan uses (`tryDecryptNote`): it decrypts the memo with the
|
|
5054
|
+
* recipient's viewing key, derives the stealth spending key, and verifies the
|
|
5055
|
+
* commitment. The result is a fully spendable `ZkNote`, obtained without scanning
|
|
5056
|
+
* the pool.
|
|
5057
|
+
*/
|
|
5058
|
+
|
|
5059
|
+
/** Keys the recipient needs to open a slip and reconstruct the note. */
|
|
5060
|
+
interface SlipImportKeys {
|
|
5061
|
+
/** 32-byte viewing secret key (ivsk) — opens the slip envelope AND the memo. */
|
|
5062
|
+
viewingSecretKey: Uint8Array;
|
|
5063
|
+
/** Spending key scalar — derives the note's nullifier / stealth key. */
|
|
5064
|
+
spendingKey: bigint;
|
|
5065
|
+
/** The recipient's global owner pk (Ax), for stealth detection. */
|
|
5066
|
+
ownerPk: bigint;
|
|
5067
|
+
}
|
|
5068
|
+
/**
|
|
5069
|
+
* Open a slip and reconstruct its note, or null.
|
|
5070
|
+
*
|
|
5071
|
+
* Accepts an `orbslip1:` string or a raw envelope. Returns null when the slip is
|
|
5072
|
+
* not this recipient's (envelope does not decrypt), or when the memo does not
|
|
5073
|
+
* belong to them, or when the recomputed commitment does not match — the last
|
|
5074
|
+
* check (inside `tryDecryptNote`) is what stops a forged slip from planting a
|
|
5075
|
+
* phantom note. Never throws.
|
|
5076
|
+
*/
|
|
5077
|
+
declare function importPaymentSlip(slip: string | Uint8Array, keys: SlipImportKeys): ZkNote | null;
|
|
5078
|
+
|
|
4873
5079
|
/**
|
|
4874
5080
|
* The steps every spend shares, in the order a spend performs them.
|
|
4875
5081
|
*
|
|
@@ -4989,7 +5195,15 @@ interface TransferParams {
|
|
|
4989
5195
|
senderPk?: bigint | undefined;
|
|
4990
5196
|
fee?: bigint | undefined;
|
|
4991
5197
|
}
|
|
4992
|
-
|
|
5198
|
+
/**
|
|
5199
|
+
* A transfer result, plus — for a transfer to another user — a `paymentSlip`:
|
|
5200
|
+
* the `orbslip1:` string the sender can hand the recipient so they rebuild their
|
|
5201
|
+
* note without scanning. Absent for self-transfers and change-only transfers.
|
|
5202
|
+
*/
|
|
5203
|
+
type TransferResult = TxResult & {
|
|
5204
|
+
paymentSlip?: string;
|
|
5205
|
+
};
|
|
5206
|
+
declare function transferNotes(deps: TransferDeps, params: TransferParams, onProgress?: (step: TransferStep) => void): Promise<TransferResult>;
|
|
4993
5207
|
|
|
4994
5208
|
type UnshieldStep = 'fetching-proof' | 'checking-nullifier' | 'generating-zk' | 'submitting';
|
|
4995
5209
|
/** The extrinsic arguments, marshalled and ready for whatever transport submits them. */
|
|
@@ -5477,4 +5691,4 @@ declare class OrbinumWallet {
|
|
|
5477
5691
|
private requireKey;
|
|
5478
5692
|
}
|
|
5479
5693
|
|
|
5480
|
-
export { type AssetRegisteredEvent, type AssetUnverifiedEvent, type AssetVerifiedEvent, BABYJUB_SUBORDER, BN254_R, type BackupImportKeys, type BlockInfo, type BuildNoteDeps, type BuildNoteParams, type Bytes32, CachedNullifier, type ChainInfo, ChainModule, type ChunkInfo, CircuitId, CircuitVersionResolver, type ClaimShieldedFeesParams, type ClientProviderConfig, type CoinSelection, type CollectScanEntriesParams, type CommitmentsInsertedEvent, type ConnectionStatus, type CryptoKey$1 as CryptoKey, CryptoPrecompiles, type DecodedPrecompile, DecryptPool, DecryptedMemo, type DynamicBuilder, ENCRYPTED_MEMO_SIZE, EncryptedMemo, EncryptedNoteRecord, EncryptedTxRecord, type EventData, type EventPhase, type EventRecord, type EvmAddressInfo, type EvmBlock, EvmClient, EvmExplorer, type EvmLog, type EvmSigner, type EvmTransaction, type EvmTxRequest, type EvmTxSummary, type ExtrinsicDecoder, type ExtrinsicFacts, type ExtrinsicRecord, type FeeClaimDeps, type FeeClaimParams, type FeeClaimProofInputs, type FeeClaimProofOutput, type FeeClaimStep, type FormatOptions, KNOWN_PALLET_ERRORS, KNOWN_PRECOMPILES, type KnownPrecompileInfo, LEAVES_PER_TREE, MIN_GASLESS_FEE, MIN_SIGNATURE_BYTES, MemoryVaultStorage, type MerkleRootUpdatedEvent, type MutableWalletSession, NATIVE_ASSET_ID, NOTE_BACKUP_VERSION, NOTE_BIGINT_FIELDS, NOTE_TRANSFER_URI_SCHEME, type NoteBackup, type NoteBackupEntry, type NoteBuildKeys, NoteBuilder, type NoteDisclosure, NoteInput, NoteStatusUpdate, NoteStorage, type NoteTransferEntry, type NoteTransferPayload, type NoteWithMeta, type NotesCache, NullifierCache, type NullifierChunkBody, type NullifierManifest, type NullifierSource, NullifierSyncMeta, type NullifierTail, type NullifiersSpentEvent, type ObservableNotesCache, OrbinumClient, type OrbinumClientConfig, OrbinumClientProvider, OrbinumWallet, type OrbinumWalletConfig, PAGE_SIZE, PRECOMPILE_ADDR, type PairwiseEphWindowEntry, type PalletErrorKind, type PersistParams, type PrecompileMethod, PrivacyKeyManager, type PrivacyMerkleProof, PrivacyModule, type PrivateTransferArgs, type PrivateTransferInput, type PrivateTransferOutput, type PrivateTransferParams, type PrivateTransferProofInputs, type ProofOptions, type ProviderFactory, QR_PAGE_MAX_CHARS, RECOVERED_TX_RESULT, type RawBlock, type RawBlockHeader, type RawTransferInput, type RawTransferOutput, type ReconstructDeps, type ReconstructedTxRecord, type RegisterAssetArgs, type RelayerInfo, RelayerStatusModule, type ResolveSpentSetParams, type ResolvedProverVersion, type ResolvedSpendVersion, type RpcV2MerkleProof, RpcV2Module, type RpcV2NullifierStatus, type RpcV2PoolAssetBalance, type RpcV2PoolStats, type RunScanParams, SPENDING_KEY_CANONICAL_ORIGIN, SPENDING_KEY_VERIFYING_CONTRACT, SPENDING_KEY_WARNING, type ScanChunkManifest, ScanCommitment, type ScanHint, type ScanHintPage, type ScanHintSource, ScanKeys, type ScanOptions, type ScanOutcome, type ScanProgress, type ScanResult, SecretStore, type SelfEphWindowEntry, type SelfStealthKeys, type SessionCacheDeps, type ShieldArgs, type ShieldBatchArgs, type ShieldBatchItem, type ShieldBatchParams, type ShieldOperation, type ShieldParams, type ShieldedEvent, type ShieldedPoolCall, type ShieldedPoolEvent, ShieldedPoolModule, ShieldedPoolPrecompile, SpendDetails, type SpendPlanProblem, type SpendPrivacyReads, type SpendVault, type SpendableInputsCheck, type SpendingKeyTypedData, type StatusChangeEvent, type StatusListener, SubstrateClient, type SystemHealth, TRANSFER_INPUTS, TRANSFER_OUTPUTS, type TokenInfo, type TokenTransfer, type TransferDeps, type TransferFactsRow, type TransferFactsSource, type TransferInputNote, type TransferOutputNote, type TransferParams, type TransferPlan, type TransferStep, type TransferSubmitRequest, type TxFactsSource, TxHistoryStore, type TxKind, type TxLandingPollOptions, type TxResult, type UnsafeTxOptions, type UnshieldArgs, type UnshieldDeps, type UnshieldNoteParams, type UnshieldParams, type UnshieldPlan, type UnshieldProofInputs, type UnshieldProofResult, type UnshieldStep, type UnshieldSubmitRequest, type UnshieldedEvent, type UnverifyAssetArgs, VAULT_SCHEMA_VERSION, VaultConfigRecord, VaultLockedError, VaultStorage, VaultStore, type VaultStoreDeps, type VaultUnlockOptions, type VerifyAssetArgs, type VersionedArtifactProvider, type WalletScanKeys, type WalletSession, ZkNote, type ZkVerifierCircuitVersionInfo, type ZkVerifierHistoricalVersion, ZkVerifierModule, type ZkVerifierVersionStats, type ZkVerifierVkHash, accountIdHexToSs58, addressToAccountIdHex, addressToFieldElement, applyBatch, applyNoteStatus, assembleNoteTransfer, base64UrlDecode, base64UrlEncode, bigintTo32Be, bigintTo32Le, bigintTo32LeArr, blindTag, buildConfig, buildDummyTransferInput, buildShieldBatchOperations, buildShieldParams, buildZkNote, bytesToBigintLE, bytesToBjjScalar, cacheSession, canPairWith, canonicalAccountId, chainActiveCircuitVersion, checkSpendableInputs, claimFees, classifyChainError, clearSession, collectNullifiersToQuery, collectScanEntries, commitmentHexOf, computeNoteCommitment, computeNullifier, computePathIndices, connectInjectedExtension, createNoteDisclosureKey, createNotesCache, createWalletSession, decodeNoteBackup, decodeNoteDisclosureKey, decodeNoteTransferPage, decodePrecompileCalldata, decryptJson, decryptNoteRecord, deriveMasterKeyBytes, deriveOwnerPk, derivePairwiseEphSk, derivePairwiseSharedSecret, deriveSelfEphSk, deriveSpendingKeyFromMaster, deriveSpendingKeyFromSignature, deriveSpendingKeyMessageV2, deriveSpendingKeyTypedData, deriveStealthOwnerPk, deriveStealthSk, deriveVaultBlindKey, deriveVaultKey, deriveViewTag, deriveViewingPublicKey, deriveViewingSecretKey, detectCommitmentMismatch, encodeNoteBackup, encodeNoteTransferPages, encryptJson, encryptNote, ensureCreatedAt, ensureHexPrefix, evmAddressToAccountId, evmToImplicitSubstrate, evmToMappedAccountHex, evmToSubstrate, extractPalletError, failed, fastMulBase, fastMulPoint, fetchExtrinsicFacts, formatAmountPlain, formatBalance, formatORB, fromBase64, fromHex, gapMargin, generateFeeClaimProof, generateTransferProof, generateUnshieldProof, getInjectedExtensions, getPrecompileLabel, hasCachedSession, hasInjectedExtensions, hexToBigint, hexToNumber, implicitSubstrateToEvm, importNotesFromBackup, isAbortError, isAlreadySpentError, isConnectionLossError, isEvmAddress, isGhostNoteError, isImplicitEvmAccount, isNativeAsset, isNoteSelfConsistent, isSpendable, isSs58, isSubstrateAddress, isUnifiedAddress, isValidLeafIndex, leHexToBigint, mapExtrinsicArgs, mapZkEventData, markInputsSpent, normalizeChainFingerprint, normalizeEvmAddress, normalizeNote, normalizeNotes, noteBlindTag, noteCreatedAt, noteCreatedTxHash, noteMatchesCommitment, noteOrigin, noteSpentTxHash, noteToTransferEntry, noteTxKind, pairwiseEphWindow, palletErrorKind, parseAmount, parseEvmAddress, persistCursor, persistScanResults, planTransfer, planUnshield, randomBlinding, reconstructOutgoingTxRecords, recoverOwnerPkPoint, recoverSelfStealthNote, refuseIfAlreadySpent, removeByCommitment, requireSessionKeys, reservePairwiseIndex, reserveSelfEphIndex, resolveSelfEphCeiling, resolveSpentSet, resolveSpentStatus, restoreSession, runScan, scalarToHex, scanAbortError, selectGhosts, selectNotes, selfEphWindow, serializeMemo, sessionCacheKey, shortHash, signAndSubmitTx, spendableBalance, stampCreatedAt, stampCreatedTxHash, stampSpentTxHash, substrateSs58ToAccountIdHex, substrateToEvm, toBase64, toHex, toTxResult, transferNotes, treeIdOf, treeOf, truncateMiddle, tryDecryptNote, tryDecryptNoteVerbose, txLandedAfterError, unshieldNote, upsertNote, vaultReplacer, vaultReviver, vaultStorageName, windowSizeForCounter };
|
|
5694
|
+
export { type AssetRegisteredEvent, type AssetUnverifiedEvent, type AssetVerifiedEvent, BABYJUB_SUBORDER, BN254_R, type BackupImportKeys, type BlockInfo, type BuildNoteDeps, type BuildNoteParams, type Bytes32, CachedNullifier, type ChainInfo, ChainModule, type ChunkInfo, CircuitId, CircuitVersionResolver, type ClaimShieldedFeesParams, type ClientProviderConfig, type CoinSelection, type CollectScanEntriesParams, type CommitmentsInsertedEvent, type ConnectionStatus, type CryptoKey$1 as CryptoKey, CryptoPrecompiles, type DecodedPrecompile, DecryptPool, DecryptedMemo, type DynamicBuilder, ENCRYPTED_MEMO_SIZE, EncryptedMemo, EncryptedNoteRecord, EncryptedTxRecord, type EventData, type EventPhase, type EventRecord, type EvmAddressInfo, type EvmBlock, EvmClient, EvmExplorer, type EvmLog, type EvmSigner, type EvmTransaction, type EvmTxRequest, type EvmTxSummary, type ExtrinsicDecoder, type ExtrinsicFacts, type ExtrinsicRecord, type FeeClaimDeps, type FeeClaimParams, type FeeClaimProofInputs, type FeeClaimProofOutput, type FeeClaimStep, type FormatOptions, KNOWN_PALLET_ERRORS, KNOWN_PRECOMPILES, type KnownPrecompileInfo, LEAVES_PER_TREE, MIN_GASLESS_FEE, MIN_SIGNATURE_BYTES, MemoryVaultStorage, type MerkleRootUpdatedEvent, type MutableWalletSession, NATIVE_ASSET_ID, NOTE_BACKUP_VERSION, NOTE_BIGINT_FIELDS, NOTE_TRANSFER_URI_SCHEME, type NoteBackup, type NoteBackupEntry, type NoteBuildKeys, NoteBuilder, type NoteDisclosure, NoteInput, NoteStatusUpdate, NoteStorage, type NoteTransferEntry, type NoteTransferPayload, type NoteWithMeta, type NotesCache, NullifierCache, type NullifierChunkBody, type NullifierManifest, type NullifierSource, NullifierSyncMeta, type NullifierTail, type NullifiersSpentEvent, OVK_BLOB_SIZE, type ObservableNotesCache, OrbinumClient, type OrbinumClientConfig, OrbinumClientProvider, OrbinumWallet, type OrbinumWalletConfig, type OutgoingHint, OutgoingNoteRecord, PAGE_SIZE, PAYMENT_SLIP_SCHEME, PRECOMPILE_ADDR, type PairwiseEphWindowEntry, type PalletErrorKind, type PaymentSlipFields, type PersistParams, type PrecompileMethod, PrivacyKeyManager, type PrivacyMerkleProof, PrivacyModule, type PrivateTransferArgs, type PrivateTransferInput, type PrivateTransferOutput, type PrivateTransferParams, type PrivateTransferProofInputs, type ProofOptions, type ProviderFactory, QR_PAGE_MAX_CHARS, RECOVERED_TX_RESULT, type RawBlock, type RawBlockHeader, type RawTransferInput, type RawTransferOutput, type ReconstructDeps, type ReconstructedTxRecord, type RegisterAssetArgs, type RelayerInfo, RelayerStatusModule, type ResolveSpentSetParams, type ResolvedProverVersion, type ResolvedSpendVersion, type RpcV2MerkleProof, RpcV2Module, type RpcV2NullifierStatus, type RpcV2PoolAssetBalance, type RpcV2PoolStats, type RunScanParams, SPENDING_KEY_CANONICAL_ORIGIN, SPENDING_KEY_VERIFYING_CONTRACT, SPENDING_KEY_WARNING, type ScanChunkManifest, ScanCommitment, type ScanHint, type ScanHintPage, type ScanHintSource, ScanKeys, type ScanOptions, type ScanOutcome, type ScanProgress, type ScanResult, SecretStore, type SelfEphWindowEntry, type SelfStealthKeys, type SessionCacheDeps, type ShieldArgs, type ShieldBatchArgs, type ShieldBatchItem, type ShieldBatchParams, type ShieldOperation, type ShieldParams, type ShieldedEvent, type ShieldedPoolCall, type ShieldedPoolEvent, ShieldedPoolModule, ShieldedPoolPrecompile, type SlipImportKeys, SpendDetails, type SpendPlanProblem, type SpendPrivacyReads, type SpendVault, type SpendableInputsCheck, type SpendingKeyTypedData, type StatusChangeEvent, type StatusListener, SubstrateClient, type SystemHealth, TRANSFER_INPUTS, TRANSFER_OUTPUTS, type TokenInfo, type TokenTransfer, type TransferDeps, type TransferFactsRow, type TransferFactsSource, type TransferInputNote, type TransferOutputNote, type TransferParams, type TransferPlan, type TransferResult, type TransferStep, type TransferSubmitRequest, type TxFactsSource, TxHistoryStore, type TxKind, type TxLandingPollOptions, type TxResult, type UnsafeTxOptions, type UnshieldArgs, type UnshieldDeps, type UnshieldNoteParams, type UnshieldParams, type UnshieldPlan, type UnshieldProofInputs, type UnshieldProofResult, type UnshieldStep, type UnshieldSubmitRequest, type UnshieldedEvent, type UnverifyAssetArgs, VAULT_SCHEMA_VERSION, VaultConfigRecord, VaultLockedError, VaultStorage, VaultStore, type VaultStoreDeps, type VaultUnlockOptions, type VerifyAssetArgs, type VersionedArtifactProvider, type WalletScanKeys, type WalletSession, ZkNote, type ZkVerifierCircuitVersionInfo, type ZkVerifierHistoricalVersion, ZkVerifierModule, type ZkVerifierVersionStats, type ZkVerifierVkHash, accountIdHexToSs58, addressToAccountIdHex, addressToFieldElement, applyBatch, applyNoteStatus, assembleNoteTransfer, base64UrlDecode, base64UrlEncode, bigintTo32Be, bigintTo32Le, bigintTo32LeArr, blindTag, buildConfig, buildDummyTransferInput, buildShieldBatchOperations, buildShieldParams, buildZkNote, bytesToBigintLE, bytesToBjjScalar, cacheSession, canPairWith, canonicalAccountId, chainActiveCircuitVersion, checkSpendableInputs, claimFees, classifyChainError, clearSession, collectNullifiersToQuery, collectScanEntries, commitmentHexOf, computeNoteCommitment, computeNullifier, computePathIndices, connectInjectedExtension, createNoteDisclosureKey, createNotesCache, createWalletSession, decodeNoteBackup, decodeNoteDisclosureKey, decodeNoteTransferPage, decodePaymentSlip, decodePrecompileCalldata, decryptJson, decryptNoteRecord, deriveMasterKeyBytes, deriveOutgoingCipherKey, deriveOutgoingViewingKey, deriveOwnerPk, derivePairwiseEphSk, derivePairwiseSharedSecret, deriveSelfEphSk, deriveSpendingKeyFromMaster, deriveSpendingKeyFromSignature, deriveSpendingKeyMessageV2, deriveSpendingKeyTypedData, deriveStealthOwnerPk, deriveStealthSk, deriveVaultBlindKey, deriveVaultKey, deriveViewTag, deriveViewingPublicKey, deriveViewingSecretKey, detectCommitmentMismatch, encodeNoteBackup, encodeNoteTransferPages, encodePaymentSlip, encryptJson, encryptNote, ensureCreatedAt, ensureHexPrefix, evmAddressToAccountId, evmToImplicitSubstrate, evmToMappedAccountHex, evmToSubstrate, extractPalletError, failed, fastMulBase, fastMulPoint, fetchExtrinsicFacts, formatAmountPlain, formatBalance, formatORB, fromBase64, fromHex, gapMargin, generateFeeClaimProof, generateTransferProof, generateUnshieldProof, getInjectedExtensions, getPrecompileLabel, hasCachedSession, hasInjectedExtensions, hexToBigint, hexToNumber, implicitSubstrateToEvm, importNotesFromBackup, importPaymentSlip, isAbortError, isAlreadySpentError, isConnectionLossError, isEvmAddress, isGhostNoteError, isImplicitEvmAccount, isNativeAsset, isNoteSelfConsistent, isSpendable, isSs58, isSubstrateAddress, isUnifiedAddress, isValidLeafIndex, leHexToBigint, mapExtrinsicArgs, mapZkEventData, markInputsSpent, normalizeChainFingerprint, normalizeEvmAddress, normalizeNote, normalizeNotes, noteBlindTag, noteCreatedAt, noteCreatedTxHash, noteMatchesCommitment, noteOrigin, noteSpentTxHash, noteToTransferEntry, noteTxKind, openOutgoingBlob, openPaymentSlip, pairwiseEphWindow, palletErrorKind, parseAmount, parseEvmAddress, persistCursor, persistScanResults, planTransfer, planUnshield, randomBlinding, randomOutgoingBlob, reconstructOutgoingTxRecords, recoverOwnerPkPoint, recoverSelfStealthNote, refuseIfAlreadySpent, removeByCommitment, requireSessionKeys, reservePairwiseIndex, reserveSelfEphIndex, resolveSelfEphCeiling, resolveSpentSet, resolveSpentStatus, restoreSession, runScan, scalarToHex, scanAbortError, sealOutgoingBlob, sealPaymentSlip, selectGhosts, selectNotes, selfEphWindow, serializeMemo, sessionCacheKey, shortHash, signAndSubmitTx, spendableBalance, stampCreatedAt, stampCreatedTxHash, stampSpentTxHash, substrateSs58ToAccountIdHex, substrateToEvm, toBase64, toHex, toTxResult, transferNotes, treeIdOf, treeOf, truncateMiddle, tryDecryptNote, tryDecryptNoteVerbose, tryRecoverOutgoing, txLandedAfterError, unshieldNote, upsertNote, vaultReplacer, vaultReviver, vaultStorageName, windowSizeForCounter };
|