@invisi-labs/primitives 1.3.4 → 1.3.6
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/address.cjs +1 -304
- package/dist/address.cjs.map +1 -1
- package/dist/address.js +1 -9
- package/dist/chunk-27LYU3N6.js +2 -0
- package/dist/chunk-27LYU3N6.js.map +1 -0
- package/dist/chunk-BEYWZRRT.js +2 -0
- package/dist/{chunk-PNJ3LCJE.js.map → chunk-BEYWZRRT.js.map} +1 -1
- package/dist/chunk-C35XZ674.js +2 -0
- package/dist/{chunk-VXBZSY4Y.js.map → chunk-C35XZ674.js.map} +1 -1
- package/dist/chunk-HJWID3PL.js +2 -0
- package/dist/chunk-HJWID3PL.js.map +1 -0
- package/dist/credit.cjs +1 -1184
- package/dist/credit.cjs.map +1 -1
- package/dist/credit.js +1 -45
- package/dist/index.cjs +4 -2883
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +21 -1
- package/dist/index.d.ts +21 -1
- package/dist/index.js +4 -1365
- package/dist/index.js.map +1 -1
- package/dist/note.cjs +1 -934
- package/dist/note.cjs.map +1 -1
- package/dist/note.js +1 -17
- package/package.json +1 -1
- package/dist/chunk-5KF55DN7.js +0 -169
- package/dist/chunk-5KF55DN7.js.map +0 -1
- package/dist/chunk-JQJPQGFX.js +0 -1178
- package/dist/chunk-JQJPQGFX.js.map +0 -1
- package/dist/chunk-PNJ3LCJE.js +0 -21
- package/dist/chunk-VXBZSY4Y.js +0 -192
package/dist/index.d.cts
CHANGED
|
@@ -217,6 +217,8 @@ declare class Detector {
|
|
|
217
217
|
#private;
|
|
218
218
|
constructor(key: Uint8Array);
|
|
219
219
|
getClueKey(): Uint8Array;
|
|
220
|
+
/** Detect a full-precision clue locally without exporting the detection key. */
|
|
221
|
+
detectClue(clue: Uint8Array): boolean;
|
|
220
222
|
/** Full detection delegation; the receiver chooses the checked prefix length. */
|
|
221
223
|
exportKey(): Uint8Array;
|
|
222
224
|
toJSON(): {
|
|
@@ -282,6 +284,24 @@ declare class Wallet extends WalletAddress {
|
|
|
282
284
|
static fromAddress(address: ReceivingAddress | string): Wallet;
|
|
283
285
|
}
|
|
284
286
|
|
|
287
|
+
/** The exact v1 message bytes for EIP-191 personal signing. */
|
|
288
|
+
declare function buildReceivingKeyMessage(ownerAddress: string): Uint8Array;
|
|
289
|
+
|
|
290
|
+
interface ReceivingSignatureInput {
|
|
291
|
+
readonly ownerAddress: string;
|
|
292
|
+
readonly signature: string | Uint8Array;
|
|
293
|
+
}
|
|
294
|
+
/** Local receiving capabilities and public address derived for a verified EVM owner. */
|
|
295
|
+
declare class ReceivingKeyMaterial extends WalletAddress {
|
|
296
|
+
#private;
|
|
297
|
+
constructor(viewer: ViewingCapability, detector: Detector);
|
|
298
|
+
getViewer(): ViewingCapability;
|
|
299
|
+
getDetector(): Detector;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
/** Verify the v1 personal signature and restore viewing and detection capabilities. */
|
|
303
|
+
declare function deriveReceivingKeysFromSignature({ ownerAddress, signature, }: ReceivingSignatureInput): ReceivingKeyMaterial;
|
|
304
|
+
|
|
285
305
|
type Hex = `0x${string}`;
|
|
286
306
|
type Address = `0x${string}`;
|
|
287
307
|
|
|
@@ -505,4 +525,4 @@ declare class DeliveryAuthenticationError extends Error {
|
|
|
505
525
|
constructor(cause?: unknown);
|
|
506
526
|
}
|
|
507
527
|
|
|
508
|
-
export { type Address, AuthorizedStatement, CreditDataV1, CreditDeliveryState, type CreditOpening, CreditPolicy, CreditState, CreditStateDecryptionContext, CreditUsage, D_CNULL, D_CREDIT, D_CREDIT_KEY_HASH, D_CREDIT_RECOVERY, D_CREDIT_STATE_NONCE, D_IDENT, D_NOTE, D_NULL, DeliveryAuthenticationError, DeliveryDecryptionError, type DeliveryDecryptionResult, type DeliveryDecryptor, type DeliveryDetectionBatch, type DeliveryDetectionCandidate, type DeliveryKind, Detector, Disclosure, type DisclosureExport, type DisclosureOutput, type DisclosureResult, FIELD_MODULUS, FundsDataV1, type Hex, MAX_CIPHERTEXT_BYTES, MAX_WALLET_BATCH_BYTES, MissingCapabilityError, NativeWalletError, Note, NoteBytes, NoteDecryptionContext, NullifierCapability, type PreparedWalletRequest, ProtocolContext, ReceivingAddress, ReceivingKeys, type SigningRequest, TREE_DEPTH, ViewingCapability, WALLET_AUTHORIZATION_TYPES, Wallet, type WalletAcceptedResults, type WalletAuthorizationRequest, type WalletAuthorizationWitness, type WalletBytes, type WalletDecryptContext, type WalletHex, type WalletMethod, type WalletOperation, type WalletParams, type WalletRequest, type WalletResponse, type WalletResults, type WalletWireContext, acceptWalletResponse, acceptWalletResponses, authenticatedDecryptor, computeOwnerAddress, computeWalletAuthorizationDigest, createClue, createClueFromSeed, createSigningRequest, creditV1, decodeDeliveryHeader, deliveryCodec, deliveryHeader, deriveClueKey, fundsV1, generateCreditSharedKey, generateNonce, poseidonHash, prepareWalletRequest, provenanceIntentHash, validateClueKey, validateDeliveryCiphertext, validateWalletBatch, validateWalletResponses, verifyWalletAuthorization, viewingPublicKey, walletAuthorizationTypedData };
|
|
528
|
+
export { type Address, AuthorizedStatement, CreditDataV1, CreditDeliveryState, type CreditOpening, CreditPolicy, CreditState, CreditStateDecryptionContext, CreditUsage, D_CNULL, D_CREDIT, D_CREDIT_KEY_HASH, D_CREDIT_RECOVERY, D_CREDIT_STATE_NONCE, D_IDENT, D_NOTE, D_NULL, DeliveryAuthenticationError, DeliveryDecryptionError, type DeliveryDecryptionResult, type DeliveryDecryptor, type DeliveryDetectionBatch, type DeliveryDetectionCandidate, type DeliveryKind, Detector, Disclosure, type DisclosureExport, type DisclosureOutput, type DisclosureResult, FIELD_MODULUS, FundsDataV1, type Hex, MAX_CIPHERTEXT_BYTES, MAX_WALLET_BATCH_BYTES, MissingCapabilityError, NativeWalletError, Note, NoteBytes, NoteDecryptionContext, NullifierCapability, type PreparedWalletRequest, ProtocolContext, ReceivingAddress, ReceivingKeyMaterial, ReceivingKeys, type ReceivingSignatureInput, type SigningRequest, TREE_DEPTH, ViewingCapability, WALLET_AUTHORIZATION_TYPES, Wallet, type WalletAcceptedResults, type WalletAuthorizationRequest, type WalletAuthorizationWitness, type WalletBytes, type WalletDecryptContext, type WalletHex, type WalletMethod, type WalletOperation, type WalletParams, type WalletRequest, type WalletResponse, type WalletResults, type WalletWireContext, acceptWalletResponse, acceptWalletResponses, authenticatedDecryptor, buildReceivingKeyMessage, computeOwnerAddress, computeWalletAuthorizationDigest, createClue, createClueFromSeed, createSigningRequest, creditV1, decodeDeliveryHeader, deliveryCodec, deliveryHeader, deriveClueKey, deriveReceivingKeysFromSignature, fundsV1, generateCreditSharedKey, generateNonce, poseidonHash, prepareWalletRequest, provenanceIntentHash, validateClueKey, validateDeliveryCiphertext, validateWalletBatch, validateWalletResponses, verifyWalletAuthorization, viewingPublicKey, walletAuthorizationTypedData };
|
package/dist/index.d.ts
CHANGED
|
@@ -217,6 +217,8 @@ declare class Detector {
|
|
|
217
217
|
#private;
|
|
218
218
|
constructor(key: Uint8Array);
|
|
219
219
|
getClueKey(): Uint8Array;
|
|
220
|
+
/** Detect a full-precision clue locally without exporting the detection key. */
|
|
221
|
+
detectClue(clue: Uint8Array): boolean;
|
|
220
222
|
/** Full detection delegation; the receiver chooses the checked prefix length. */
|
|
221
223
|
exportKey(): Uint8Array;
|
|
222
224
|
toJSON(): {
|
|
@@ -282,6 +284,24 @@ declare class Wallet extends WalletAddress {
|
|
|
282
284
|
static fromAddress(address: ReceivingAddress | string): Wallet;
|
|
283
285
|
}
|
|
284
286
|
|
|
287
|
+
/** The exact v1 message bytes for EIP-191 personal signing. */
|
|
288
|
+
declare function buildReceivingKeyMessage(ownerAddress: string): Uint8Array;
|
|
289
|
+
|
|
290
|
+
interface ReceivingSignatureInput {
|
|
291
|
+
readonly ownerAddress: string;
|
|
292
|
+
readonly signature: string | Uint8Array;
|
|
293
|
+
}
|
|
294
|
+
/** Local receiving capabilities and public address derived for a verified EVM owner. */
|
|
295
|
+
declare class ReceivingKeyMaterial extends WalletAddress {
|
|
296
|
+
#private;
|
|
297
|
+
constructor(viewer: ViewingCapability, detector: Detector);
|
|
298
|
+
getViewer(): ViewingCapability;
|
|
299
|
+
getDetector(): Detector;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
/** Verify the v1 personal signature and restore viewing and detection capabilities. */
|
|
303
|
+
declare function deriveReceivingKeysFromSignature({ ownerAddress, signature, }: ReceivingSignatureInput): ReceivingKeyMaterial;
|
|
304
|
+
|
|
285
305
|
type Hex = `0x${string}`;
|
|
286
306
|
type Address = `0x${string}`;
|
|
287
307
|
|
|
@@ -505,4 +525,4 @@ declare class DeliveryAuthenticationError extends Error {
|
|
|
505
525
|
constructor(cause?: unknown);
|
|
506
526
|
}
|
|
507
527
|
|
|
508
|
-
export { type Address, AuthorizedStatement, CreditDataV1, CreditDeliveryState, type CreditOpening, CreditPolicy, CreditState, CreditStateDecryptionContext, CreditUsage, D_CNULL, D_CREDIT, D_CREDIT_KEY_HASH, D_CREDIT_RECOVERY, D_CREDIT_STATE_NONCE, D_IDENT, D_NOTE, D_NULL, DeliveryAuthenticationError, DeliveryDecryptionError, type DeliveryDecryptionResult, type DeliveryDecryptor, type DeliveryDetectionBatch, type DeliveryDetectionCandidate, type DeliveryKind, Detector, Disclosure, type DisclosureExport, type DisclosureOutput, type DisclosureResult, FIELD_MODULUS, FundsDataV1, type Hex, MAX_CIPHERTEXT_BYTES, MAX_WALLET_BATCH_BYTES, MissingCapabilityError, NativeWalletError, Note, NoteBytes, NoteDecryptionContext, NullifierCapability, type PreparedWalletRequest, ProtocolContext, ReceivingAddress, ReceivingKeys, type SigningRequest, TREE_DEPTH, ViewingCapability, WALLET_AUTHORIZATION_TYPES, Wallet, type WalletAcceptedResults, type WalletAuthorizationRequest, type WalletAuthorizationWitness, type WalletBytes, type WalletDecryptContext, type WalletHex, type WalletMethod, type WalletOperation, type WalletParams, type WalletRequest, type WalletResponse, type WalletResults, type WalletWireContext, acceptWalletResponse, acceptWalletResponses, authenticatedDecryptor, computeOwnerAddress, computeWalletAuthorizationDigest, createClue, createClueFromSeed, createSigningRequest, creditV1, decodeDeliveryHeader, deliveryCodec, deliveryHeader, deriveClueKey, fundsV1, generateCreditSharedKey, generateNonce, poseidonHash, prepareWalletRequest, provenanceIntentHash, validateClueKey, validateDeliveryCiphertext, validateWalletBatch, validateWalletResponses, verifyWalletAuthorization, viewingPublicKey, walletAuthorizationTypedData };
|
|
528
|
+
export { type Address, AuthorizedStatement, CreditDataV1, CreditDeliveryState, type CreditOpening, CreditPolicy, CreditState, CreditStateDecryptionContext, CreditUsage, D_CNULL, D_CREDIT, D_CREDIT_KEY_HASH, D_CREDIT_RECOVERY, D_CREDIT_STATE_NONCE, D_IDENT, D_NOTE, D_NULL, DeliveryAuthenticationError, DeliveryDecryptionError, type DeliveryDecryptionResult, type DeliveryDecryptor, type DeliveryDetectionBatch, type DeliveryDetectionCandidate, type DeliveryKind, Detector, Disclosure, type DisclosureExport, type DisclosureOutput, type DisclosureResult, FIELD_MODULUS, FundsDataV1, type Hex, MAX_CIPHERTEXT_BYTES, MAX_WALLET_BATCH_BYTES, MissingCapabilityError, NativeWalletError, Note, NoteBytes, NoteDecryptionContext, NullifierCapability, type PreparedWalletRequest, ProtocolContext, ReceivingAddress, ReceivingKeyMaterial, ReceivingKeys, type ReceivingSignatureInput, type SigningRequest, TREE_DEPTH, ViewingCapability, WALLET_AUTHORIZATION_TYPES, Wallet, type WalletAcceptedResults, type WalletAuthorizationRequest, type WalletAuthorizationWitness, type WalletBytes, type WalletDecryptContext, type WalletHex, type WalletMethod, type WalletOperation, type WalletParams, type WalletRequest, type WalletResponse, type WalletResults, type WalletWireContext, acceptWalletResponse, acceptWalletResponses, authenticatedDecryptor, buildReceivingKeyMessage, computeOwnerAddress, computeWalletAuthorizationDigest, createClue, createClueFromSeed, createSigningRequest, creditV1, decodeDeliveryHeader, deliveryCodec, deliveryHeader, deriveClueKey, deriveReceivingKeysFromSignature, fundsV1, generateCreditSharedKey, generateNonce, poseidonHash, prepareWalletRequest, provenanceIntentHash, validateClueKey, validateDeliveryCiphertext, validateWalletBatch, validateWalletResponses, verifyWalletAuthorization, viewingPublicKey, walletAuthorizationTypedData };
|