Skip to content

Commit

Permalink
Merge branch 'master' into salt
Browse files Browse the repository at this point in the history
  • Loading branch information
lbeder committed Jan 15, 2024
2 parents 3c517b9 + c374d68 commit f364fcb
Show file tree
Hide file tree
Showing 16 changed files with 112 additions and 219 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ await transaction.wait();
To verify an offchain attestation, you can use the `verifyOffchainAttestationSignature` function provided by the EAS SDK. Here's an example:

```javascript
import { OffChainAttestationVersion, Offchain, PartialTypedDataConfig } from "@ethereum-attestation-service/eas-sdk";
import { OffchainAttestationVersion, Offchain, PartialTypedDataConfig } from "@ethereum-attestation-service/eas-sdk";

const attestation = {
// your offchain attestation
Expand All @@ -297,7 +297,7 @@ const attestation = {
},
uid: "0x5134f511e0533f997e569dac711952dde21daf14b316f3cce23835defc82c065",
message: {
version: OffChainAttestationVersion.Version2,
version: OffchainAttestationVersion.Version2,
schema: "0x27d06e3659317e9a4f8154d1e849eb53d43d91fb4f219884d1684f86d797804a",
refUID: "0x0000000000000000000000000000000000000000000000000000000000000000",
time: 1671219600,
Expand All @@ -316,7 +316,7 @@ const EAS_CONFIG: PartialTypedDataConfig = {
version: attestation.sig.domain.version,
chainId: attestation.sig.domain.chainId,
};
const offchain = new Offchain(EAS_CONFIG, OffChainAttestationVersion.Version2);
const offchain = new Offchain(EAS_CONFIG, OffchainAttestationVersion.Version2);
const isValidAttestation = offchain.verifyOffchainAttestationSignature(
attestation.signer,
attestation.sig
Expand Down
2 changes: 1 addition & 1 deletion dist/eas.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 5 additions & 26 deletions dist/offchain/offchain-utils.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { OffChainAttestationVersion, SignedOffchainAttestation } from './offchain';
import { SignedOffchainAttestation } from './offchain';
export interface SignedOffchainAttestationV1 extends Omit<SignedOffchainAttestation, 'signature' | 'version'> {
r: string;
s: string;
Expand All @@ -8,27 +8,7 @@ export interface AttestationShareablePackageObject {
sig: SignedOffchainAttestation;
signer: string;
}
export interface CompactAttestationShareablePackageObject {
offchainVersion: OffChainAttestationVersion;
contractVersion: string;
chainId: bigint;
verifyingContract: string;
r: string;
s: string;
v: number;
signer: string;
uid: string;
schema: string;
recipient: string;
time: number;
expirationTime: number;
refUID: string;
revocable: boolean;
data: string;
salt?: string;
nonce: number;
}
type CompactAttestationShareablePackageObjectV1 = [
export type CompactAttestationShareablePackageObject = [
contractVersion: string,
chainId: bigint,
verifyingContract: string,
Expand All @@ -45,13 +25,12 @@ type CompactAttestationShareablePackageObjectV1 = [
revocable: boolean,
data: string,
nonce: number,
offchainVersion?: number
offchainVersion?: number,
salt?: string
];
export declare const createOffchainURL: (pkg: AttestationShareablePackageObject) => string;
export declare const zipAndEncodeToBase64: (pkg: AttestationShareablePackageObject) => string;
export declare const decodeBase64ZippedBase64: (base64: string) => AttestationShareablePackageObject;
export declare const compactOffchainAttestationPackage: (pkg: AttestationShareablePackageObject) => CompactAttestationShareablePackageObject | CompactAttestationShareablePackageObjectV1;
export declare const compactOffchainAttestationPackage: (pkg: AttestationShareablePackageObject) => CompactAttestationShareablePackageObject;
export declare const uncompactOffchainAttestationPackage: (compacted: CompactAttestationShareablePackageObject) => AttestationShareablePackageObject;
export declare const uncompactOffchainAttestationPackageV1: (compacted: CompactAttestationShareablePackageObjectV1) => AttestationShareablePackageObject;
export declare const isSignedOffchainAttestationV1: (attestation: SignedOffchainAttestation | SignedOffchainAttestationV1) => attestation is SignedOffchainAttestationV1;
export {};
160 changes: 37 additions & 123 deletions dist/offchain/offchain-utils.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f364fcb

Please sign in to comment.