@river-build/web3
Version:
Dapps for our Space and Registry contracts
35 lines • 1.36 kB
TypeScript
import { BigNumber, TypedDataDomain, TypedDataField } from 'ethers';
import { Address } from '../ContractTypes';
/**
* https://github.com/ethereum/EIPs/blob/master/EIPS/eip-712.md
* */
interface LinkedWalletValue {
message: string;
userID: Address;
nonce: BigNumber;
}
interface Eip712LinkedWalletArgs {
domain: TypedDataDomain;
nonce: BigNumber;
userID: Address;
message: string;
}
export declare function createEip712LinkedWalletdData({ domain, userID, nonce, message, }: Eip712LinkedWalletArgs): {
types: Record<string, TypedDataField[]>;
domain: TypedDataDomain;
value: LinkedWalletValue;
};
export declare function getDomainSeparator(domain: TypedDataDomain): string;
export declare function toLinkedWalletHash(message: string, address: string, nonce: BigNumber): string;
/**
* @dev Returns the keccak256 digest of an EIP-712 typed data (EIP-191 version `0x01`).
*
* The digest is calculated from a `domainSeparator` and a `structHash`, by prefixing them with
* `0x1901` and hashing the result. It corresponds to the hash signed by the
* https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] JSON-RPC method as part of EIP-712.
*
* See {ECDSA-recover}.
*/
export declare function toTypedDataHash(domain: TypedDataDomain, structHash: string): string;
export {};
//# sourceMappingURL=EIP-712.d.ts.map