@opendatalabs/vana-sdk 3.22.0-pr.207.5c11fe3 → 3.22.0-pr.207.e47cd30

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.
@@ -37,7 +37,7 @@ export { parseWeb3SignedHeader, verifyWeb3Signed, type Web3SignedPayload, type V
37
37
  export { buildWeb3SignedHeader, computeBodyHash, type Web3SignedSignFn, } from "./auth/web3-signed-builder.js";
38
38
  export { MissingAuthError, InvalidSignatureError, ExpiredTokenError, } from "./auth/errors.js";
39
39
  export { NATIVE_VANA_ASSET, dataRegistryDomain, grantRegistrationDomain, grantRevocationDomain, serverRegistrationDomain, builderRegistrationDomain, escrowPaymentDomain, GRANT_REGISTRATION_TYPES, GRANT_REVOCATION_TYPES, SERVER_REGISTRATION_TYPES, BUILDER_REGISTRATION_TYPES, ADD_DATA_TYPES, RECORD_DATA_ACCESS_TYPES, type DataPortabilityContracts, type DataPortabilityGatewayConfig, type GrantRegistrationMessage, type GrantRevocationMessage, type ServerRegistrationMessage, type BuilderRegistrationMessage, type AddDataMessage, type RecordDataAccessMessage, } from "./protocol/eip712.js";
40
- export { ENCLAVE_IDENTITY_EVIDENCE_VERSION, USER_PS_ID_DOMAIN, ENCLAVE_WALLET_PURPOSE, MASTER_SIGNATURE_DELIVERY_VERSION, SEALED_ENVELOPE_VERSION, ENCLAVE_TRUST_ANCHORS, userPsId, appRootPreimage, kmsIssuedPreimage, verifyEnclaveIdentityEvidence, buildMasterSignatureDelivery, encryptMasterSignatureDelivery, type UserPsId, type EnclaveIdentityEvidence, type ExpectedIdentity, type IdentityRequest, type IdentityState, type IdentityResponse, type IdentityRegistrationRequest, type IdentityRegistrationResponse, type MasterSignatureDelivery, type SealedSecretSubmission, type SealedSecretResponse, type AesGcmBox, type SealedEnvelope, type EnclaveTrustAnchors, } from "./protocol/identity.js";
40
+ export { ENCLAVE_IDENTITY_EVIDENCE_VERSION, USER_PS_ID_DOMAIN, ENCLAVE_WALLET_PURPOSE, MASTER_SIGNATURE_DELIVERY_VERSION, SEALED_ENVELOPE_VERSION, ENCLAVE_TRUST_ANCHORS, userPsId, appRootPreimage, kmsIssuedPreimage, verifyEnclaveIdentityEvidence, buildMasterSignatureDelivery, encryptMasterSignatureDelivery, type UserPsId, type EnclaveIdentityEvidence, type IdentityRequest, type IdentityState, type IdentityResponse, type IdentityRegistrationRequest, type IdentityRegistrationResponse, type MasterSignatureDelivery, type SealedSecretSubmission, type SealedSecretResponse, type AesGcmBox, type SealedEnvelope, type EnclaveTrustAnchors, } from "./protocol/identity.js";
41
41
  export { PERSONAL_SERVER_REGISTRATION_DEFAULT_CHAIN_ID, PERSONAL_SERVER_REGISTRATION_DEFAULT_VERIFYING_CONTRACT, personalServerRegistrationDomain, createViemPersonalServerRegistrationSigner, buildPersonalServerRegistrationTypedData, buildPersonalServerRegistrationSignature, registerPersonalServerSignature, type PersonalServerRegistrationTypedData, type PersonalServerRegistrationSigner, type PersonalServerRegistrationDomainInput, type ViemPersonalServerRegistrationWalletClient, type ViemPersonalServerRegistrationSignerSource, type BuildPersonalServerRegistrationTypedDataInput, type BuildPersonalServerRegistrationSignatureInput, type PersonalServerRegistrationSignature, } from "./protocol/personal-server-registration.js";
42
42
  export { PERSONAL_SERVER_LITE_OWNER_BINDING_VERSION, PERSONAL_SERVER_LITE_OWNER_BINDING_PURPOSE, PERSONAL_SERVER_LITE_OWNER_BINDING_PREFIX, buildPersonalServerLiteOwnerBindingMessage, createViemPersonalServerLiteOwnerBindingSigner, buildPersonalServerLiteOwnerBindingSignature, signPersonalServerLiteOwnerBinding, type PersonalServerLiteOwnerBindingPurpose, type PersonalServerLiteOwnerBindingMessage, type PersonalServerLiteOwnerBindingSigner, type ViemPersonalServerLiteOwnerBindingWalletClient, type ViemPersonalServerLiteOwnerBindingSignerSource, type BuildPersonalServerLiteOwnerBindingSignatureInput, type PersonalServerLiteOwnerBindingSignature, } from "./personal-server-lite/owner-binding.js";
43
43
  export { ACCOUNT_PERSONAL_SERVER_REGISTRATION_INTENT, AccountPersonalServerRegistrationError, signPersonalServerRegistrationWithAccount, type AccountPersonalServerRegistrationIntent, type AccountPersonalServerRegistrationSignature, type AccountPersonalServerRegistrationStatus, type AccountPersonalServerRegistrationRequest, type AccountPersonalServerRegistrationConfig, type AccountSignedPersonalServerRegistration, type AccountConfirmationRequiredPersonalServerRegistration, type AccountFallbackSignedPersonalServerRegistration, type AccountPersonalServerRegistrationResult, } from "./account/personal-server-registration.js";
@@ -31744,7 +31744,6 @@ import {
31744
31744
  encodePacked,
31745
31745
  fromHex as fromHex5,
31746
31746
  getAddress,
31747
- isAddressEqual,
31748
31747
  keccak256,
31749
31748
  recoverPublicKey,
31750
31749
  toBytes
@@ -31795,31 +31794,13 @@ async function recoverChainKey(hash, signature, link) {
31795
31794
  throw new Error(`Invalid enclave signature chain link ${link}`);
31796
31795
  }
31797
31796
  }
31798
- async function verifyEnclaveIdentityEvidence(evidence, anchors, expected) {
31797
+ async function verifyEnclaveIdentityEvidence(evidence, anchors) {
31799
31798
  if (evidence.v !== ENCLAVE_IDENTITY_EVIDENCE_VERSION) {
31800
31799
  throw new Error("Unsupported enclave identity evidence version");
31801
31800
  }
31802
31801
  if (!Number.isInteger(evidence.epoch) || evidence.epoch < 1) {
31803
31802
  throw new Error("Invalid enclave identity epoch");
31804
31803
  }
31805
- if (evidence.chainId !== expected.chainId) {
31806
- throw new Error(
31807
- "Enclave identity chain ID does not match expected chain ID"
31808
- );
31809
- }
31810
- if (!isAddressEqual(evidence.ownerAddress, expected.ownerAddress)) {
31811
- throw new Error("Enclave identity owner does not match expected owner");
31812
- }
31813
- if (evidence.epoch !== expected.epoch) {
31814
- throw new Error("Enclave identity epoch does not match expected epoch");
31815
- }
31816
- const expectedUserPsId = userPsId(expected.chainId, expected.ownerAddress);
31817
- if (evidence.userPsId.toLowerCase() !== expectedUserPsId.toLowerCase()) {
31818
- throw new Error("Enclave userPsId does not match expected identity");
31819
- }
31820
- if (evidence.purpose !== ENCLAVE_WALLET_PURPOSE) {
31821
- throw new Error("Unexpected enclave wallet purpose");
31822
- }
31823
31804
  const derivedAddress = publicKeyToAddress(evidence.publicKey);
31824
31805
  if (getAddress(derivedAddress) !== getAddress(evidence.address)) {
31825
31806
  throw new Error("Enclave public key does not match its address");
@@ -31848,12 +31829,8 @@ async function verifyEnclaveIdentityEvidence(evidence, anchors, expected) {
31848
31829
  throw new Error("Enclave app ID is not trusted");
31849
31830
  }
31850
31831
  }
31851
- async function buildMasterSignatureDelivery(evidence, masterSignature, now = Math.floor(Date.now() / 1e3)) {
31832
+ function buildMasterSignatureDelivery(evidence, masterSignature, now = Math.floor(Date.now() / 1e3)) {
31852
31833
  deriveMasterKey(masterSignature);
31853
- const signerAddress = await recoverServerOwner(masterSignature);
31854
- if (!isAddressEqual(signerAddress, evidence.ownerAddress)) {
31855
- throw new Error("Master signature signer does not match evidence owner");
31856
- }
31857
31834
  return {
31858
31835
  v: MASTER_SIGNATURE_DELIVERY_VERSION,
31859
31836
  userPsId: evidence.userPsId,