const domain = {
name: "PCS MM Pool",
version: "1",
chainId: // 1 or 56,
verifyingContract: // please refer to the address above,
};
const quoteType = {
Quote: [
{ name: "nonce", type: "uint256" },
{ name: "user", type: "address" },
{ name: "baseToken", type: "address" },
{ name: "quoteToken", type: "address" },
{ name: "baseTokenAmount", type: "uint256" },
{ name: "quoteTokenAmount", type: "uint256" },
{ name: "expiryTimestamp", type: "uint256" },
],
};
const quoteValue = {
nonce,
user,
baseToken,
quoteToken,
baseTokenAmount,
quoteTokenAmount,
expiryTimestamp,
};
// EIP 712 Signature
const signature = await mm._signTypedData(domain, quoteType, quoteValue);
struct Quote {
uint256 nonce;
address user;
address baseToken;
address quoteToken;
uint256 baseTokenAmount;
uint256 quoteTokenAmount;
uint256 expiryTimestamp;
}
function swap(
address _mmSigner,
Quote calldata _quote,
bytes calldata _signature
) external payable