@xmtp/xmtp-js
Advanced tools
Comparing version 9.0.0-beta.1 to 9.0.0-beta.2
@@ -25,36 +25,5 @@ import { signature, publicKey, ciphertext, privateKey, authn, keystore, conversationReference, messageApi, invitation, content, message } from '@xmtp/proto'; | ||
} | ||
declare class AccountLinkedStaticSignatureV1 implements signature.AccountLinkedStaticSignature_V1 { | ||
text: Uint8Array; | ||
signature: Signature; | ||
private _walletEcdsaCompact; | ||
constructor(obj: Partial<signature.AccountLinkedStaticSignature_V1>); | ||
get walletEcdsaCompact(): ECDSACompactWithRecovery; | ||
} | ||
declare class AccountLinkedStaticSignature extends AccountLinkedStaticSignatureV1 implements signature.AccountLinkedStaticSignature { | ||
v1: signature.AccountLinkedStaticSignature_V1; | ||
constructor(obj: Partial<signature.AccountLinkedStaticSignature>); | ||
static create(text: Uint8Array, signature: Signature): AccountLinkedStaticSignature; | ||
} | ||
declare class AccountLinkedSIWESignatureV1 implements signature.AccountLinkedSIWESignature_V1 { | ||
text: Uint8Array; | ||
signature: Signature; | ||
private _walletEcdsaCompact; | ||
constructor(obj: Partial<signature.AccountLinkedStaticSignature_V1>); | ||
get walletEcdsaCompact(): ECDSACompactWithRecovery; | ||
} | ||
declare class AccountLinkedSIWESignature extends AccountLinkedSIWESignatureV1 implements signature.AccountLinkedSIWESignature { | ||
v1: signature.AccountLinkedSIWESignature_V1; | ||
constructor(obj: Partial<signature.AccountLinkedSIWESignature>); | ||
static create(text: Uint8Array, signature: Signature): AccountLinkedSIWESignature; | ||
} | ||
interface KeySigner { | ||
signKey(key: UnsignedPublicKey): Promise<SignedPublicKey>; | ||
} | ||
declare enum AccountLinkedRole { | ||
INBOX_KEY = 0, | ||
SEND_KEY = 1 | ||
} | ||
interface AccountLinkSigner { | ||
signKeyWithRole(key: UnsignedPublicKey, role: AccountLinkedRole): Promise<AccountLinkedPublicKey>; | ||
} | ||
@@ -92,19 +61,2 @@ declare type secp256k1Uncompressed = { | ||
} | ||
declare class AccountLinkedPublicKeyV1 extends UnsignedPublicKey implements publicKey.AccountLinkedPublicKey_V1 { | ||
keyBytes: Uint8Array; | ||
staticSignature: AccountLinkedStaticSignature | undefined; | ||
siweSignature: AccountLinkedSIWESignature | undefined; | ||
constructor(obj: publicKey.AccountLinkedPublicKey_V1); | ||
private bytesToSign; | ||
private getSIWELinkedAddressWithoutDomainCheck; | ||
getLinkedAddress(role: AccountLinkedRole): string; | ||
verify(signature: Signature, digest: Uint8Array): boolean; | ||
verifyKey(pub: PublicKey | SignedPublicKey): Promise<boolean>; | ||
} | ||
declare class AccountLinkedPublicKey extends AccountLinkedPublicKeyV1 implements publicKey.AccountLinkedPublicKey { | ||
v1: publicKey.AccountLinkedPublicKey_V1; | ||
constructor(obj: publicKey.AccountLinkedPublicKey); | ||
static create(keyBytes: Uint8Array, staticSignature: AccountLinkedStaticSignature | undefined, siweSignature: AccountLinkedSIWESignature | undefined): AccountLinkedPublicKey; | ||
static fromLegacyKey(legacyKey: SignedPublicKey, role: AccountLinkedRole): AccountLinkedPublicKey; | ||
} | ||
declare class PublicKey extends UnsignedPublicKey implements publicKey.PublicKey { | ||
@@ -121,9 +73,2 @@ signature?: Signature; | ||
declare class SignedPublicKeyBundleV2 implements publicKey.SignedPublicKeyBundleV2 { | ||
accountLinkedKey: AccountLinkedPublicKey; | ||
preKey: SignedPublicKey; | ||
constructor(bundle: publicKey.SignedPublicKeyBundleV2); | ||
getLinkedAddress(role: AccountLinkedRole): string; | ||
equals(other: this): boolean; | ||
} | ||
declare class SignedPublicKeyBundle implements publicKey.SignedPublicKeyBundle { | ||
@@ -180,18 +125,2 @@ identityKey: SignedPublicKey; | ||
} | ||
declare class AccountLinkedPrivateKeyV1 implements privateKey.AccountLinkedPrivateKey_V1, KeySigner { | ||
createdNs: Long; | ||
secp256k1: secp256k1; | ||
publicKey: AccountLinkedPublicKey; | ||
constructor(obj: privateKey.AccountLinkedPrivateKey_V1); | ||
private sign; | ||
signKey(pub: UnsignedPublicKey): Promise<SignedPublicKey>; | ||
matches(key: AccountLinkedPublicKey): boolean; | ||
} | ||
declare class AccountLinkedPrivateKey extends AccountLinkedPrivateKeyV1 implements privateKey.AccountLinkedPrivateKey { | ||
v1: privateKey.AccountLinkedPrivateKey_V1 | undefined; | ||
constructor(obj: privateKey.AccountLinkedPrivateKey); | ||
static generate(signer: AccountLinkSigner, role: AccountLinkedRole): Promise<AccountLinkedPrivateKey>; | ||
static fromLegacyKey(key: SignedPrivateKey, role: AccountLinkedRole): AccountLinkedPrivateKey; | ||
sharedSecret(peer: PublicKey | SignedPublicKey): Uint8Array; | ||
} | ||
declare class PrivateKey implements privateKey.PrivateKey { | ||
@@ -214,17 +143,2 @@ timestamp: Long; | ||
declare class PrivateKeyBundleV3 implements privateKey.PrivateKeyBundleV3 { | ||
accountLinkedKey: AccountLinkedPrivateKey; | ||
preKeys: SignedPrivateKey[]; | ||
private _publicKeyBundle; | ||
constructor(bundle: privateKey.PrivateKeyBundleV3); | ||
static generate(wallet: Signer, role: AccountLinkedRole): Promise<PrivateKeyBundleV3>; | ||
static generateSIWE(wallet: Signer, role: AccountLinkedRole): Promise<PrivateKeyBundleV3>; | ||
static fromLegacyBundle(bundle: PrivateKeyBundleV2, role: AccountLinkedRole): PrivateKeyBundleV3; | ||
getLinkedAddress(role: AccountLinkedRole): string; | ||
getPublicKeyBundle(): SignedPublicKeyBundleV2; | ||
private addPreKey; | ||
getCurrentPreKey(): SignedPrivateKey; | ||
private findPreKey; | ||
sharedSecret(peer: SignedPublicKeyBundleV2, myPreKey: SignedPublicKey, isRecipient: boolean): Promise<Uint8Array>; | ||
} | ||
declare class PrivateKeyBundleV2 implements privateKey.PrivateKeyBundleV2 { | ||
@@ -527,34 +441,2 @@ identityKey: SignedPrivateKey; | ||
} | ||
declare class SealedInvitationHeaderV2 implements invitation.SealedInvitationHeaderV2 { | ||
peerHeader: invitation.SealedInvitationHeaderV2_PeerInvitationHeader | undefined; | ||
selfHeader: invitation.SealedInvitationHeaderV2_SelfInvitationHeader | undefined; | ||
private _sendKeyBundle; | ||
private _inboxKeyBundle; | ||
private _createdNs; | ||
constructor({ peerHeader, selfHeader }: invitation.SealedInvitationHeaderV2); | ||
static create(sendKeyBundle: PrivateKeyBundleV3, inboxKeyBundle: SignedPublicKeyBundleV2, peerAddress: string, created: Date): SealedInvitationHeaderV2; | ||
get createdNs(): Long; | ||
get sendKeyBundle(): SignedPublicKeyBundleV2; | ||
get inboxKeyBundle(): SignedPublicKeyBundleV2; | ||
getPeerAddress(selfAddress: string): string; | ||
toBytes(): Uint8Array; | ||
static fromBytes(bytes: Uint8Array): SealedInvitationHeaderV2; | ||
} | ||
declare class SealedInvitationV2 implements invitation.SealedInvitationV2 { | ||
headerBytes: Uint8Array; | ||
ciphertext: Ciphertext; | ||
private _header?; | ||
private _invitation?; | ||
constructor({ headerBytes, ciphertext }: invitation.SealedInvitationV2); | ||
/** | ||
* Accessor method for the full header object | ||
*/ | ||
get header(): SealedInvitationHeaderV2; | ||
/** | ||
* getInvitation decrypts and returns the InvitationV1 stored in the ciphertext of the Sealed Invitation | ||
*/ | ||
getInvitation(viewerInboxKeyBundle: PrivateKeyBundleV3): Promise<InvitationV1>; | ||
toBytes(): Uint8Array; | ||
static fromBytes(bytes: Uint8Array): SealedInvitationV2; | ||
} | ||
/** | ||
@@ -593,4 +475,3 @@ * SealedInvitationHeaderV1 is a protobuf message to be used as the headerBytes in a SealedInvitationV1 | ||
v1: SealedInvitationV1 | undefined; | ||
v2: SealedInvitationV2 | undefined; | ||
constructor({ v1, v2 }: invitation.SealedInvitation); | ||
constructor({ v1 }: invitation.SealedInvitation); | ||
toBytes(): Uint8Array; | ||
@@ -609,19 +490,2 @@ static fromBytes(bytes: Uint8Array): SealedInvitation; | ||
}): Promise<SealedInvitation>; | ||
/** | ||
* Create a SealedInvitation with a SealedInvitationV1 payload | ||
* Will encrypt all contents and validate inputs | ||
* | ||
* @param sendKeyBundle MUST be a bundle linked to the current viewer | ||
* @param inboxKeyBundle a bundle either linked to the current viewer, or to the invitee | ||
* @param peerAddress the address of the invitee to whom the invitation is being sent | ||
* @param created the time at which the invitation was created | ||
* @param invitation the invitation to be sent | ||
*/ | ||
static createV2({ sendKeyBundle, inboxKeyBundle, peerAddress, created, invitation, }: { | ||
sendKeyBundle: PrivateKeyBundleV3; | ||
inboxKeyBundle: SignedPublicKeyBundleV2; | ||
peerAddress: string; | ||
created: Date; | ||
invitation: InvitationV1; | ||
}): Promise<SealedInvitation>; | ||
} | ||
@@ -628,0 +492,0 @@ |
{ | ||
"name": "@xmtp/xmtp-js", | ||
"version": "9.0.0-beta.1", | ||
"version": "9.0.0-beta.2", | ||
"description": "XMTP client SDK for interacting with XMTP networks.", | ||
@@ -84,8 +84,7 @@ "type": "module", | ||
"@noble/secp256k1": "^1.5.2", | ||
"@xmtp/proto": "^3.24.0-beta.2", | ||
"@xmtp/proto": "^3.24.0", | ||
"async-mutex": "^0.4.0", | ||
"elliptic": "^6.5.4", | ||
"ethers": "^5.5.3", | ||
"long": "^5.2.0", | ||
"siwe": "^2.1.3" | ||
"long": "^5.2.0" | ||
}, | ||
@@ -92,0 +91,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
6
0
1597970
12330
- Removedsiwe@^2.1.3
- Removed@noble/hashes@1.7.1(transitive)
- Removed@spruceid/siwe-parser@2.1.2(transitive)
- Removed@stablelib/binary@1.0.1(transitive)
- Removed@stablelib/int@1.0.1(transitive)
- Removed@stablelib/random@1.0.2(transitive)
- Removed@stablelib/wipe@1.0.1(transitive)
- Removedapg-js@4.4.0(transitive)
- Removedpunycode@2.3.1(transitive)
- Removedsiwe@2.3.2(transitive)
- Removeduri-js@4.4.1(transitive)
- Removedvalid-url@1.0.9(transitive)
Updated@xmtp/proto@^3.24.0