UNPKG

@tokenlon/contracts-lib

Version:

Common utility functions (e.g., signing order, encoding data) to interact with [Tokenlon contracts](https://github.com/consenlabs/tokenlon-contracts).

29 lines (28 loc) 851 B
import { TypedDataField } from "@ethersproject/abstract-signer"; export declare enum SignatureType { EIP712 = "02", WalletBytes = "04", WalletBytes32 = "05" } export declare type SigningOptions = { type: SignatureType; signer: EIP712Signer; verifyingContract: string; }; export declare type EIP712DomainOptions = { chainId: number; verifyingContract: string; }; export declare type EIP712Domain = { name: string; version: string; chainId: number; verifyingContract: string; }; export declare type EIP712Types = Record<string, TypedDataField[]>; export declare type EIP712Value = Record<string, any>; export interface EIP712Signer { getAddress(): Promise<string>; getChainId(): Promise<number>; _signTypedData(domain: EIP712Domain, types: EIP712Types, value: EIP712Value): Promise<string>; }